Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic simulation examples #443

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft
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 @@ -319,7 +319,7 @@ public void runTransient(double dt) {

setTempPres(thermoSystem.getTemperature(), thermoSystem.getPressure());

liquidLevel = thermoSystem.getPhase(1).getVolume() * 1e-5 / (liquidVolume + gasVolume);
liquidLevel = thermoSystem.getPhase(1).getVolume() / (liquidVolume + gasVolume);
// System.out.println("liquid level " + liquidLevel);
liquidVolume = getLiquidLevel() * 3.14 / 4.0 * getInternalDiameter() * getInternalDiameter()
* getSeparatorLength();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ public void testStaticSimulationWithController() {
neqsim.thermo.system.SystemInterface testSystem = getTestSystem();

Stream stream_1 = new Stream("Stream1", testSystem);
stream_1.setFlowRate(100.0 + getRandomDistrurbanceFlowRate(), "kg/hr");
stream_1.setFlowRate(200.0 + getRandomDistrurbanceFlowRate(), "kg/hr");
stream_1.setPressure(10.0, "bara");
stream_1.setCalculateSteadyState(false);

ThrottlingValve valve_1 = new ThrottlingValve("valve_1", stream_1);
valve_1.setOutletPressure(5.0);
Expand Down Expand Up @@ -90,7 +91,7 @@ public void testStaticSimulationWithController() {

// transient behaviour
p.setTimeStep(1.0);
for (int i = 0; i < 55; i++) {
for (int i = 0; i < 51; i++) {
flowController.setControllerSetPoint(65.0 + getRandomDistrurbanceFlowRate());
p.runTransient();
System.out.println(
Expand All @@ -102,7 +103,6 @@ public void testStaticSimulationWithController() {

for (int i = 0; i < 100; i++) {
flowController.setControllerSetPoint(55.0 + getRandomDistrurbanceFlowRate());
// stream_1.runTransient(1.0);
p.runTransient();
System.out.println(
"flow rate " + valve_1.getOutletStream().getFluid().getPhase("gas").getFlowRate("kg/hr")
Expand All @@ -112,8 +112,7 @@ public void testStaticSimulationWithController() {
}

// transient behaviour
p.setTimeStep(1.0);
for (int i = 0; i < 55; i++) {
for (int i = 0; i < 100; i++) {
flowController.setControllerSetPoint(75.0 + getRandomDistrurbanceFlowRate());
p.runTransient();
System.out.println(
Expand Down
Loading