From d39c594cfef353370a0a3407e12e3abe65f73278 Mon Sep 17 00:00:00 2001 From: Even Solbraa <41290109+EvenSol@users.noreply.github.com> Date: Sun, 26 Nov 2023 21:36:42 +0000 Subject: [PATCH] fix error flash --- .../thermodynamicOperations/flashOps/TPmultiflash.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/neqsim/thermodynamicOperations/flashOps/TPmultiflash.java b/src/main/java/neqsim/thermodynamicOperations/flashOps/TPmultiflash.java index 2153c84d9b..fcdc729b9a 100644 --- a/src/main/java/neqsim/thermodynamicOperations/flashOps/TPmultiflash.java +++ b/src/main/java/neqsim/thermodynamicOperations/flashOps/TPmultiflash.java @@ -1190,9 +1190,9 @@ public void stabilityAnalysis2() { } } } while ((Math.abs(err) > 1e-9 || err > errOld) && iter < 200); - if (iter > maxiter-2) { - // System.out.println("too many iterations....." + err + " temperature " - // + system.getTemperature("C") + " C " + system.getPressure("bara") + " bara"); + if (iter > 198) { + // System.out.println("too many iterations....." + err + " temperature " + // + system.getTemperature("C") + " C " + system.getPressure("bara") + " bara"); new Exception("to many iterations "); } // logger.info("err: " + err + " ITER " + iter); @@ -1211,7 +1211,7 @@ public void stabilityAnalysis2() { xTrivialCheck0 += Math.abs(x[j][i] - system.getPhase(0).getComponent(i).getx()); xTrivialCheck1 += Math.abs(x[j][i] - system.getPhase(1).getComponent(i).getx()); } - if (iter >= maxiter-1) { + if (iter >= 199) { logger.info("iter > maxiter multiphase stability "); logger.info("error " + Math.abs(err)); logger.info("tm: " + tm[j]);