Skip to content

Commit

Permalink
refact: reorder code
Browse files Browse the repository at this point in the history
  • Loading branch information
asmfstatoil committed Feb 23, 2024
1 parent 2689d9a commit 6e6263c
Showing 1 changed file with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,24 +131,6 @@ public double getRateFactor(PhaseInterface phase) {
return 2.576e9 * Math.exp(-6024.0 / phase.getTemperature()) / 1000.0;
}

/**
* <p>
* getK.
* </p>
*
* @param phase a {@link neqsim.thermo.phase.PhaseInterface} object
* @return a double
*/
public double getK(PhaseInterface phase) {
double temperature = phase.getTemperature();
lnK = K[0] + K[1] / (temperature) + K[2] * Math.log(temperature) + K[3] * temperature;
if (shiftSignK) {
lnK = -lnK;
}
// System.out.println("K " + Math.exp(lnK));
return Math.exp(lnK);
}

/**
* <p>
* Getter for the field <code>stocCoefs</code>.
Expand Down Expand Up @@ -468,6 +450,24 @@ public double[] getK() {
return this.K;
}

/**
* <p>
* getK.
* </p>
*
* @param phase a {@link neqsim.thermo.phase.PhaseInterface} object
* @return a double
*/
public double getK(PhaseInterface phase) {
double temperature = phase.getTemperature();
lnK = K[0] + K[1] / (temperature) + K[2] * Math.log(temperature) + K[3] * temperature;
if (shiftSignK) {
lnK = -lnK;
}
// System.out.println("K " + Math.exp(lnK));
return Math.exp(lnK);
}

/**
* Setter for property k.
*
Expand Down

0 comments on commit 6e6263c

Please sign in to comment.