@@ -76,7 +76,8 @@ public int findLowestGibbsEnergyPhase() {
76
76
} else {
77
77
lowestGibbsEnergyPhase = 1 ;
78
78
}
79
- // logger.info("Lowest Gibbs energy phase determined: Phase {}", lowestGibbsEnergyPhase);
79
+ // logger.info("Lowest Gibbs energy phase determined: Phase {}",
80
+ // lowestGibbsEnergyPhase);
80
81
81
82
findLowestGibbsPhaseIsChecked = true ;
82
83
}
@@ -88,7 +89,7 @@ public int findLowestGibbsEnergyPhase() {
88
89
* stabilityAnalysis.
89
90
* </p>
90
91
*
91
- * @throws neqsim.util.exception.IsNaNException if any.
92
+ * @throws neqsim.util.exception.IsNaNException if any.
92
93
* @throws neqsim.util.exception.TooManyIterationsException if any.
93
94
*/
94
95
public void stabilityAnalysis () throws neqsim .util .exception .IsNaNException ,
@@ -211,8 +212,7 @@ public void stabilityAnalysis() throws neqsim.util.exception.IsNaNException,
211
212
} else {
212
213
// succsessive substitution
213
214
for (int i = 0 ; i < clonedSystem .getPhases ()[0 ].getNumberOfComponents (); i ++) {
214
- logWi [i ] =
215
- d [i ] - clonedSystem .getPhase (j ).getComponent (i ).getLogFugacityCoefficient ();
215
+ logWi [i ] = d [i ] - clonedSystem .getPhase (j ).getComponent (i ).getLogFugacityCoefficient ();
216
216
error [j ] += Math .abs ((logWi [i ] - oldlogw [i ]) / oldlogw [i ]);
217
217
Wi [j ][i ] = Math .exp (logWi [i ]);
218
218
}
@@ -262,9 +262,10 @@ public void stabilityAnalysis() throws neqsim.util.exception.IsNaNException,
262
262
deltalogWi [i ] = logWi [i ] - oldlogw [i ];
263
263
clonedSystem .getPhase (j ).getComponent (i ).setx (Wi [j ][i ] / sumw [j ]);
264
264
}
265
- // logger.info("fnorm " + f.norm1() + " err " + error[j] + " iterations " + iterations
265
+ // logger.info("fnorm " + f.norm1() + " err " + error[j] + " iterations " +
266
+ // iterations
266
267
// + " phase " + j);
267
- } while ((f .norm1 () > 1e-6 && iterations < maxiterations || error [j ] > 1e-6 )
268
+ } while ((f .norm1 () > 1e-6 && error [j ] > 1e-9 && iterations < maxiterations )
268
269
|| (iterations % 7 ) == 0 || iterations < 3 );
269
270
// (error[j]<oldErr && oldErr<oldOldErr) &&
270
271
// logger.info("err " + error[j]);
@@ -414,9 +415,8 @@ public void solidPhaseFlash() {
414
415
if (system .getPhase (0 ).getComponent (k ).doSolidCheck ()) {
415
416
tempVar [k ] = system .getPhase (0 ).getComponent (k ).getz ();
416
417
for (int i = 0 ; i < system .getNumberOfPhases () - 1 ; i ++) {
417
- tempVar [k ] -=
418
- system .getBeta (i ) * system .getPhases ()[3 ].getComponent (k ).getFugacityCoefficient ()
419
- / system .getPhase (i ).getComponent (k ).getFugacityCoefficient ();
418
+ tempVar [k ] -= system .getBeta (i ) * system .getPhases ()[3 ].getComponent (k ).getFugacityCoefficient ()
419
+ / system .getPhase (i ).getComponent (k ).getFugacityCoefficient ();
420
420
}
421
421
422
422
if (tempVar [k ] > 0.0 && tempVar [k ] > frac ) {
@@ -485,7 +485,8 @@ public void solidPhaseFlash() {
485
485
486
486
/** {@inheritDoc} */
487
487
@ Override
488
- public void printToFile (String name ) {}
488
+ public void printToFile (String name ) {
489
+ }
489
490
490
491
/** {@inheritDoc} */
491
492
@ Override
@@ -501,5 +502,6 @@ public String[][] getResultTable() {
501
502
502
503
/** {@inheritDoc} */
503
504
@ Override
504
- public void addData (String name , double [][] data ) {}
505
+ public void addData (String name , double [][] data ) {
506
+ }
505
507
}
0 commit comments