diff --git a/src/main/java/neqsim/processSimulation/processEquipment/util/NeqSimUnit.java b/src/main/java/neqsim/processSimulation/processEquipment/util/NeqSimUnit.java index 87af34311..161b84bef 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/util/NeqSimUnit.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/util/NeqSimUnit.java @@ -26,7 +26,7 @@ public class NeqSimUnit extends TwoPortEquipment { private String equipment = "pipeline"; String flowPattern = "stratified"; private double length = 1.0; - public int numberOfNodes = 100; + public int numberOfNodes = 10; private double ID = 0.5; private double outerTemperature = 283.15; public double interfacialArea = 0.0; @@ -87,11 +87,11 @@ public void run(UUID id) { public void runDroplet() { PipeData pipe1 = new PipeData(getID(), 0.00025); FlowNodeInterface test = new DropletFlowNode(thermoSystem, pipe1); - test.setInterphaseModelType(1); + test.setInterphaseModelType(0); test.setLengthOfNode(getLength() / (numberOfNodes * 1.0)); test.getGeometry().getSurroundingEnvironment().setTemperature(getOuterTemperature()); - test.getFluidBoundary().setHeatTransferCalc(false); + test.getFluidBoundary().setHeatTransferCalc(true); test.getFluidBoundary().setMassTransferCalc(true); double length = 0; test.initFlowCalc(); diff --git a/src/test/java/neqsim/processSimulation/processSystem/MassTransferTest.java b/src/test/java/neqsim/processSimulation/processSystem/MassTransferTest.java new file mode 100644 index 000000000..3e3f88c66 --- /dev/null +++ b/src/test/java/neqsim/processSimulation/processSystem/MassTransferTest.java @@ -0,0 +1,51 @@ +package neqsim.processSimulation.processSystem; + +import org.junit.jupiter.api.Test; +import neqsim.processSimulation.processEquipment.mixer.StaticPhaseMixer; +import neqsim.processSimulation.processEquipment.stream.Stream; +import neqsim.thermo.system.SystemInterface; +import neqsim.thermo.system.SystemSrkEos; + +public class MassTransferTest extends neqsim.NeqSimTest { + + @Test + public void runProcess() throws InterruptedException { + SystemInterface thermoSystem = new SystemSrkEos(273.15 + 15, 60.0); + thermoSystem.addComponent("nitrogen", 0.01); + thermoSystem.addComponent("CO2", 0.019); + thermoSystem.addComponent("methane", 0.925); + thermoSystem.addComponent("ethane", 0.045); + thermoSystem.setMixingRule("classic"); + + SystemInterface ethaneSystem = ((SystemInterface) thermoSystem).clone(); + ethaneSystem.setMolarComposition(new double[] {0, 0, 0, 1.0}); + + Stream feedStream = new Stream("feed stream", thermoSystem); + feedStream.setFlowRate(10.0 * 24, "MSm3/day"); + + Stream ethaneStream = new Stream("ethane stream", ethaneSystem); + feedStream.setFlowRate(200000.0, "kg/hr"); + + StaticPhaseMixer mainMixer = new StaticPhaseMixer("gas ethane mixer"); + mainMixer.addStream(feedStream); + mainMixer.addStream(ethaneStream); + + neqsim.processSimulation.processEquipment.util.NeqSimUnit pipeline = + new neqsim.processSimulation.processEquipment.util.NeqSimUnit(mainMixer.getOutletStream(), + "pipeline", "stratified"); + pipeline.setLength(0.1); + pipeline.setID(1.0); + + neqsim.processSimulation.processSystem.ProcessSystem operations = + new neqsim.processSimulation.processSystem.ProcessSystem(); + operations.add(feedStream); + operations.add(ethaneStream); + operations.add(mainMixer); + operations.add(pipeline); + + operations.run(); + + pipeline.getOutletStream().getFluid().prettyPrint(); + + } +}