Skip to content

Commit

Permalink
update model
Browse files Browse the repository at this point in the history
  • Loading branch information
EvenSol committed Dec 3, 2023
1 parent 4d78342 commit 4113eb9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -331,11 +331,8 @@ public void runTransient(double dt, UUID id) {
thermoSystem.init(0);
for (int i = 0; i < thermoSystem.getPhase(0).getNumberOfComponents(); i++) {
double dncomp = 0.0;
for (int j = 0; j < inletStreamMixer.getOutletStream().getFluid()
.getNumberOfPhases(); j++) {
dncomp += inletStreamMixer.getOutletStream().getThermoSystem().getPhase(j).getComponent(i)
.getNumberOfMolesInPhase();
}
dncomp +=
inletStreamMixer.getOutletStream().getThermoSystem().getComponent(i).getNumberOfmoles();
dncomp += -gasOutStream.getThermoSystem().getComponent(i).getNumberOfmoles()
- liquidOutStream.getThermoSystem().getComponent(i).getNumberOfmoles();
thermoSystem.addComponent(i, dncomp * dt);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ public void testDynamicCalculation() {
// transient behaviour
p.setTimeStep(1.0);
for (int i = 0; i < 50; i++) {
System.out.println("volume flow " + flowTransmitter.getMeasuredValue() + " valve opening "
+ valve1.getPercentValveOpening() + " pressure "
+ separator1.getGasOutStream().getPressure());
// System.out.println("volume flow " + flowTransmitter.getMeasuredValue() + " valve opening "
// + valve1.getPercentValveOpening() + " pressure "
// + separator1.getGasOutStream().getPressure());
p.runTransient();
for (SimulationInterface sim : p.getUnitOperations()) {
assertEquals(sim.getCalculationIdentifier(), p.getCalculationIdentifier());
Expand Down Expand Up @@ -169,7 +169,7 @@ public void testDynamicCalculation2() {
separatorLevelController.setReverseActing(false);
separatorLevelController.setTransmitter(separatorLevelTransmitter);
separatorLevelController.setControllerSetPoint(0.45);
separatorLevelController.setControllerParameters(1.0, 0.0, 0.0);
separatorLevelController.setControllerParameters(0.1, 0.0, 0.0);

PressureTransmitter separatorPressureTransmitter =
new PressureTransmitter(separator1.getGasOutStream());
Expand All @@ -181,7 +181,7 @@ public void testDynamicCalculation2() {
separatorPressureController.setTransmitter(separatorPressureTransmitter);
separatorPressureController.setReverseActing(false);
separatorPressureController.setControllerSetPoint(7.0);
separatorPressureController.setControllerParameters(0.1, 50.0, 0.0);
separatorPressureController.setControllerParameters(1.5, 100.0, 0.0);

p.add(stream1);
p.add(streamPurge);
Expand All @@ -204,12 +204,12 @@ public void testDynamicCalculation2() {
}

// p.displayResult();
p.setTimeStep(1.0);
for (int i = 0; i < 100; i++) {
System.out.println("pressure " + separator1.getGasOutStream().getPressure() + " flow "
+ separator1.getGasOutStream().getFlowRate("kg/hr") + " sepr height "
+ separatorLevelTransmitter.getMeasuredValue() + "valve2 opening "
+ valve2.getPercentValveOpening() + "valve3 opening " + valve3.getPercentValveOpening());
p.setTimeStep(2.0);
for (int i = 0; i < 500; i++) {
// System.out.println("pressure " + separator1.getGasOutStream().getPressure() + " flow "
// + separator1.getGasOutStream().getFlowRate("kg/hr") + " sepr height "
// + separatorLevelTransmitter.getMeasuredValue() + "valve2 opening "
// + valve2.getPercentValveOpening() + "valve3 opening " + valve3.getPercentValveOpening());
p.runTransient();
for (SimulationInterface sim : p.getUnitOperations()) {
assertEquals(p.getCalculationIdentifier(), sim.getCalculationIdentifier());
Expand Down

0 comments on commit 4113eb9

Please sign in to comment.