Skip to content

Commit

Permalink
update (#1206)
Browse files Browse the repository at this point in the history
  • Loading branch information
EvenSol authored Dec 9, 2024
1 parent d21106b commit 9aab2e6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/main/java/log4j2.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
24 changes: 13 additions & 11 deletions src/main/java/neqsim/thermodynamicoperations/flashops/Flash.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -88,7 +89,7 @@ public int findLowestGibbsEnergyPhase() {
* stabilityAnalysis.
* </p>
*
* @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,
Expand Down Expand Up @@ -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]);
}
Expand Down Expand Up @@ -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]<oldErr && oldErr<oldOldErr) &&
// logger.info("err " + error[j]);
Expand Down Expand Up @@ -414,9 +415,8 @@ public void solidPhaseFlash() {
if (system.getPhase(0).getComponent(k).doSolidCheck()) {
tempVar[k] = system.getPhase(0).getComponent(k).getz();
for (int i = 0; i < system.getNumberOfPhases() - 1; i++) {
tempVar[k] -=
system.getBeta(i) * system.getPhases()[3].getComponent(k).getFugacityCoefficient()
/ system.getPhase(i).getComponent(k).getFugacityCoefficient();
tempVar[k] -= system.getBeta(i) * system.getPhases()[3].getComponent(k).getFugacityCoefficient()
/ system.getPhase(i).getComponent(k).getFugacityCoefficient();
}

if (tempVar[k] > 0.0 && tempVar[k] > frac) {
Expand Down Expand Up @@ -485,7 +485,8 @@ public void solidPhaseFlash() {

/** {@inheritDoc} */
@Override
public void printToFile(String name) {}
public void printToFile(String name) {
}

/** {@inheritDoc} */
@Override
Expand All @@ -501,5 +502,6 @@ public String[][] getResultTable() {

/** {@inheritDoc} */
@Override
public void addData(String name, double[][] data) {}
public void addData(String name, double[][] data) {
}
}

0 comments on commit 9aab2e6

Please sign in to comment.