From 4dd8e6a6f21c2c43d437697baa01196282f87062 Mon Sep 17 00:00:00 2001 From: Even Solbraa <41290109+EvenSol@users.noreply.github.com> Date: Mon, 9 Dec 2024 17:34:33 +0000 Subject: [PATCH] update --- src/main/java/log4j2.properties | 2 +- .../flashops/Flash.java | 24 ++++++++++--------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/main/java/log4j2.properties b/src/main/java/log4j2.properties index d81ec3aae7..d3e118c3f5 100644 --- a/src/main/java/log4j2.properties +++ b/src/main/java/log4j2.properties @@ -12,5 +12,5 @@ appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n #appender.console.filter.threshold.level = DEBUG # Root Logger -rootLogger.level = DEBUG +rootLogger.level = OFF rootLogger.appenderRef.stdout.ref = STDOUT \ No newline at end of file diff --git a/src/main/java/neqsim/thermodynamicoperations/flashops/Flash.java b/src/main/java/neqsim/thermodynamicoperations/flashops/Flash.java index 6247430251..7350aac2d9 100644 --- a/src/main/java/neqsim/thermodynamicoperations/flashops/Flash.java +++ b/src/main/java/neqsim/thermodynamicoperations/flashops/Flash.java @@ -76,7 +76,8 @@ public int findLowestGibbsEnergyPhase() { } else { lowestGibbsEnergyPhase = 1; } - // logger.info("Lowest Gibbs energy phase determined: Phase {}", lowestGibbsEnergyPhase); + // logger.info("Lowest Gibbs energy phase determined: Phase {}", + // lowestGibbsEnergyPhase); findLowestGibbsPhaseIsChecked = true; } @@ -88,7 +89,7 @@ public int findLowestGibbsEnergyPhase() { * stabilityAnalysis. *
* - * @throws neqsim.util.exception.IsNaNException if any. + * @throws neqsim.util.exception.IsNaNException if any. * @throws neqsim.util.exception.TooManyIterationsException if any. */ public void stabilityAnalysis() throws neqsim.util.exception.IsNaNException, @@ -211,8 +212,7 @@ public void stabilityAnalysis() throws neqsim.util.exception.IsNaNException, } else { // succsessive substitution for (int i = 0; i < clonedSystem.getPhases()[0].getNumberOfComponents(); i++) { - logWi[i] = - d[i] - clonedSystem.getPhase(j).getComponent(i).getLogFugacityCoefficient(); + logWi[i] = d[i] - clonedSystem.getPhase(j).getComponent(i).getLogFugacityCoefficient(); error[j] += Math.abs((logWi[i] - oldlogw[i]) / oldlogw[i]); Wi[j][i] = Math.exp(logWi[i]); } @@ -262,9 +262,10 @@ public void stabilityAnalysis() throws neqsim.util.exception.IsNaNException, deltalogWi[i] = logWi[i] - oldlogw[i]; clonedSystem.getPhase(j).getComponent(i).setx(Wi[j][i] / sumw[j]); } - // logger.info("fnorm " + f.norm1() + " err " + error[j] + " iterations " + iterations + // logger.info("fnorm " + f.norm1() + " err " + error[j] + " iterations " + + // iterations // + " phase " + j); - } while ((f.norm1() > 1e-6 && iterations < maxiterations || error[j] > 1e-6) + } while ((f.norm1() > 1e-6 && error[j] > 1e-9 && iterations < maxiterations) || (iterations % 7) == 0 || iterations < 3); // (error[j]