Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
EvenSol committed Sep 18, 2024
1 parent 45fcef4 commit a5fa749
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,22 @@ public boolean needRecalculation() {
return false;
}

public void runAntiSurgeCalc(UUID id) {

for (int i = 0; i < inputVariable.size(); i++) {
// distance inputVariable.get;
}
}


/** {@inheritDoc} */
@Override
public void run(UUID id) {
double sum = 0.0;
if (name.equals("anti surge calculator")) {
runAntiSurgeCalc(id);
return;
}

if (name.equals("MEG makeup calculator")) {
for (int i = 0; i < inputVariable.size(); i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import neqsim.processSimulation.processEquipment.splitter.Splitter;
import neqsim.processSimulation.processEquipment.stream.Stream;
import neqsim.processSimulation.processEquipment.stream.StreamInterface;
import neqsim.processSimulation.processEquipment.util.Calculator;
import neqsim.processSimulation.processEquipment.util.Recycle;
import neqsim.processSimulation.processEquipment.valve.ThrottlingValve;
import neqsim.thermo.system.SystemInterface;
Expand Down Expand Up @@ -185,6 +186,10 @@ public void runAntiSurgeProcess() throws InterruptedException {
recycl.setOutletStream(recyclegasstream);
recycl.run();

Calculator antisurgeCalculator = new Calculator("anti surge calculator");
antisurgeCalculator.addInputVariable(gascompressor);
antisurgeCalculator.setOutputVariable(gassplitter);

neqsim.processSimulation.processSystem.ProcessSystem operations =
new neqsim.processSimulation.processSystem.ProcessSystem();
operations.add(gas_from_separator);
Expand All @@ -195,6 +200,7 @@ public void runAntiSurgeProcess() throws InterruptedException {
operations.add(gassplitter);
operations.add(antisurgevalve);
operations.add(recycl);
operations.add(antisurgeCalculator);
operations.run();

assertEquals(6.9999999, gassplitter.getSplitStream(0).getFlowRate("MSm3/day"), 1e-4);
Expand Down

0 comments on commit a5fa749

Please sign in to comment.