Skip to content

Commit

Permalink
ref: reorder math
Browse files Browse the repository at this point in the history
  • Loading branch information
asmfstatoil committed Jan 11, 2025
1 parent 204108a commit deb6b27
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -287,16 +287,16 @@ public void run() {
// This solves some problems when we have high volumes of water and heavy
// hydrocarbons returning only one liquid phase (and this phase desolves all
// gas)
if (system.getBeta() > (1.0 - phaseFractionMinimumLimit * 1.1)
|| system.getBeta() < (phaseFractionMinimumLimit * 1.1)) {
if (system.getBeta() > (1.0 - 1.1 * phaseFractionMinimumLimit)
|| system.getBeta() < (1.1 * phaseFractionMinimumLimit)) {
system.setBeta(0.5);
sucsSubs();
}

// Performs three iterations of successive substitution
for (int k = 0; k < 3; k++) {
if (system.getBeta() < (1.0 - phaseFractionMinimumLimit * 1.1)
&& system.getBeta() > (phaseFractionMinimumLimit * 1.1)) {
if (system.getBeta() < (1.0 - 1.1 * phaseFractionMinimumLimit)
&& system.getBeta() > (1.1 * phaseFractionMinimumLimit)) {
sucsSubs();
if ((system.getGibbsEnergy() - minimumGibbsEnergy)
/ Math.abs(minimumGibbsEnergy) < -1e-12) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1348,7 +1348,7 @@ public void run() {

boolean hasRemovedPhase = false;
for (int i = 0; i < system.getNumberOfPhases(); i++) {
if (system.getBeta(i) < phaseFractionMinimumLimit * 1.1) {
if (system.getBeta(i) < 1.1 * phaseFractionMinimumLimit) {
system.removePhaseKeepTotalComposition(i);
doStabilityAnalysis = false;
hasRemovedPhase = true;
Expand Down

0 comments on commit deb6b27

Please sign in to comment.