From a5bfd6cffd5359b6f49be89576cd657d5ac3405c Mon Sep 17 00:00:00 2001 From: Even Solbraa <41290109+EvenSol@users.noreply.github.com> Date: Mon, 30 Dec 2024 21:55:16 +0000 Subject: [PATCH] update --- .../equipment/distillation/SimpleTray.java | 17 +++++++++++++---- .../flashops/TPflash.java | 2 +- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/main/java/neqsim/process/equipment/distillation/SimpleTray.java b/src/main/java/neqsim/process/equipment/distillation/SimpleTray.java index caa53592cb..caecd5676a 100644 --- a/src/main/java/neqsim/process/equipment/distillation/SimpleTray.java +++ b/src/main/java/neqsim/process/equipment/distillation/SimpleTray.java @@ -16,8 +16,7 @@ * @author ESOL * @version $Id: $Id */ -public class SimpleTray extends neqsim.process.equipment.mixer.Mixer - implements TrayInterface { +public class SimpleTray extends neqsim.process.equipment.mixer.Mixer implements TrayInterface { private static final long serialVersionUID = 1000; static Logger logger = LogManager.getLogger(SimpleTray.class); @@ -120,11 +119,17 @@ public void run(UUID id) { // double flowRate = ((Stream) // streams.get(0)).getThermoSystem().getFlowRate("kg/hr"); // ((Stream) streams.get(0)).getThermoSystem().display(); + boolean changeTo2Phase = false; SystemInterface thermoSystem2 = streams.get(0).getThermoSystem().clone(); - + if (thermoSystem2.doMultiPhaseCheck()) { + changeTo2Phase = true; + thermoSystem2.setMultiPhaseCheck(false); + } // System.out.println("total number of moles " + // thermoSystem2.getTotalNumberOfMoles()); - if (trayPressure > 0) { + if (trayPressure > 0) + + { thermoSystem2.setPressure(trayPressure); } mixedStream.setThermoSystem(thermoSystem2); @@ -173,6 +178,10 @@ public void run(UUID id) { .println("error...." + mixedStream.getFluid().getNumberOfPhases() + " phases on tray"); logger.warn("error...." + mixedStream.getFluid().getNumberOfPhases() + " phases on tray"); } + + if (changeTo2Phase) { + thermoSystem2.setMultiPhaseCheck(true); + } } /** diff --git a/src/main/java/neqsim/thermodynamicoperations/flashops/TPflash.java b/src/main/java/neqsim/thermodynamicoperations/flashops/TPflash.java index 8a206e3a71..3db87f7875 100644 --- a/src/main/java/neqsim/thermodynamicoperations/flashops/TPflash.java +++ b/src/main/java/neqsim/thermodynamicoperations/flashops/TPflash.java @@ -348,7 +348,7 @@ public void run() { if (system.checkStability() && stabilityCheck()) { if (system.doMultiPhaseCheck()) { // logger.info("one phase flash is stable - checking multiphase flash...."); - TPmultiflash operation = new TPmultiflash(system, true); + TPmultiflash operation = new TPmultiflash(system, system.doSolidPhaseCheck()); operation.run(); } if (solidCheck) {