Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,10 @@ public void runTransient(double dt, UUID id) {
// double liqoutMoles = liquidOutStream.getThermoSystem().getNumberOfMoles();
thermoSystem.init(3);
gasOutStream.getThermoSystem().init(3);
liquidOutStream.getThermoSystem().init(3);
if (liquidOutStream.getThermoSystem().hasPhaseType("oil")) {
liquidOutStream.getThermoSystem().init(3);
}

double volume1 = thermoSystem.getVolume();
// System.out.println("volume1 " + volume1);
double deltaEnergy = inletStreamMixer.getOutletStream().getThermoSystem().getEnthalpy()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public void testDynamicCalculation() {
flowController.setControllerSetPoint(63.5);
flowController.setControllerParameters(0.1, 0.10, 0.0);

p = new ProcessSystem();
p.add(stream1);
p.add(valve1);
p.add(separator1);
Expand Down Expand Up @@ -170,6 +171,7 @@ public void testDynamicCalculation2() {
separatorPressureController.setControllerSetPoint(7.0);
separatorPressureController.setControllerParameters(0.5, 10.0, 0.0);

p = new ProcessSystem();
p.add(stream1);
p.add(valve1);

Expand Down Expand Up @@ -214,4 +216,51 @@ public void testDynamicCalculation2() {
}
}
}

@Test
public void testDynamicCalculation3() {
neqsim.thermo.system.SystemInterface testSystem2 =
new neqsim.thermo.system.SystemSrkEos((273.15 + 25.0), 100.00);
testSystem2.addComponent("methane", 1.1);
testSystem2.addComponent("n-heptane", 1.1);
testSystem2.setMixingRule(2);


Stream feedStreeam = new Stream("Purge Stream", testSystem2);

Separator separator1 = new Separator("separator_1");
separator1.addStream(feedStreeam);
separator1.setCalculateSteadyState(false);
separator1.setInternalDiameter(1.0);
separator1.setSeparatorLength(3.0);

ThrottlingValve gasValve = new ThrottlingValve("valve_gas", separator1.getGasOutStream());
gasValve.setOutletPressure(7.0);
gasValve.setPercentValveOpening(50);

ThrottlingValve liquidValve = new ThrottlingValve("valve_gas", separator1.getLiquidOutStream());
liquidValve.setOutletPressure(7.0);
liquidValve.setPercentValveOpening(50);

p = new ProcessSystem();
p.add(feedStreeam);
p.add(separator1);
p.add(gasValve);
p.add(liquidValve);

p.run();

feedStreeam.setFlowRate(1e-10, "kg/sec");
liquidValve.setPercentValveOpening(1e-10);
System.out.println("pressure " + separator1.getPressure());
p.runTransient(0.01);
System.out.println("pressure " + separator1.getPressure());
p.runTransient(0.01);
System.out.println("pressure " + separator1.getPressure());
p.runTransient(0.01);
System.out.println("pressure " + separator1.getPressure());
p.runTransient(0.01);
System.out.println("pressure " + separator1.getPressure());

}
}