Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
EvenSol committed Nov 26, 2023
1 parent af10b76 commit f4f3ac9
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -371,12 +371,14 @@ public void stabilityAnalysis() {
int iter = 0;
double errOld = 1.0e100;
boolean useaccsubst = true;
int maxsucssubiter = 50;
int maxiter = 100;
do {
errOld = err;
iter++;
err = 0;

if (iter <= 150 || !system.isImplementedCompositionDeriativesofFugacity()) {
if (iter <= maxsucssubiter || !system.isImplementedCompositionDeriativesofFugacity()) {
if (iter % 7 == 0 && useaccsubst) {
double vec1 = 0.0;

Expand Down Expand Up @@ -513,7 +515,7 @@ public void stabilityAnalysis() {
clonedSystem.get(0).getPhase(1).getComponents()[i].setx(1e-50);
}
}
} while ((Math.abs(err) > 1e-9 || err > errOld) && iter < 600);
} while ((Math.abs(err) > 1e-9 || err > errOld) && iter < maxiter);
// logger.info("err: " + err + " ITER " + iter);
double xTrivialCheck0 = 0.0;
double xTrivialCheck1 = 0.0;
Expand All @@ -530,7 +532,7 @@ public void stabilityAnalysis() {
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 >= 599) {
if (iter >= maxiter) {
// logger.info("iter > maxiter multiphase stability ");
// logger.info("error " + Math.abs(err));
// logger.info("tm: " + tm[j]);
Expand Down Expand Up @@ -716,12 +718,14 @@ public void stabilityAnalysis3() {
int iter = 0;
double errOld = 1.0e100;
boolean useaccsubst = true;
int maxsucssubiter = 50;
int maxiter = 100;
do {
errOld = err;
iter++;
err = 0;

if (iter <= 150 || !system.isImplementedCompositionDeriativesofFugacity()) {
if (iter <= maxsucssubiter || !system.isImplementedCompositionDeriativesofFugacity()) {
if (iter % 7 == 0 && useaccsubst) {
double vec1 = 0.0;

Expand Down Expand Up @@ -858,7 +862,7 @@ public void stabilityAnalysis3() {
clonedSystem.get(0).getPhase(1).getComponents()[i].setx(1e-50);
}
}
} while ((Math.abs(err) > 1e-9 || err > errOld) && iter < 600);
} while ((Math.abs(err) > 1e-9 || err > errOld) && iter < maxiter);
// logger.info("err: " + err + " ITER " + iter);
double xTrivialCheck0 = 0.0;
double xTrivialCheck1 = 0.0;
Expand All @@ -875,7 +879,7 @@ public void stabilityAnalysis3() {
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 >= 599) {
if (iter >= maxiter - 1) {
// logger.info("iter > maxiter multiphase stability ");
// logger.info("error " + Math.abs(err));
// logger.info("tm: " + tm[j]);
Expand Down

0 comments on commit f4f3ac9

Please sign in to comment.