Skip to content

Commit

Permalink
fix Eclipse update (#1003)
Browse files Browse the repository at this point in the history
  • Loading branch information
EvenSol authored May 8, 2024
1 parent 9142bf1 commit 6c44fa4
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,22 @@ public AttractiveTermPr1978(ComponentEosInterface component) {
}
}

/** {@inheritDoc} */
@Override
public void setm(double val) {
this.m = val;
neqsim.MathLib.nonLinearSolver.newtonRhapson solve =
new neqsim.MathLib.nonLinearSolver.newtonRhapson();
solve.setOrder(2);
double[] acentricConstants = {-0.26992, 1.54226, (0.37464 - this.m)};
if (this.m > 0.49) {
solve.setOrder(3);
acentricConstants = new double[] {0.01666, -0.164423, 1.48503, (0.379642 - this.m)};
}
solve.setConstants(acentricConstants);
getComponent().setAcentricFactor(solve.solve(0.2));
}

/** {@inheritDoc} */
@Override
public AttractiveTermPr1978 clone() {
Expand Down
31 changes: 3 additions & 28 deletions src/main/java/neqsim/thermo/system/SystemPrEos1978.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
package neqsim.thermo.system;

import neqsim.thermo.phase.PhaseHydrate;
import neqsim.thermo.phase.PhasePrEos;
import neqsim.thermo.phase.PhasePureComponentSolid;

/**
* This class defines a thermodynamic system using the Peng Robinson v. 1978 equation of state
*
* @author Even Solbraa
* @version $Id: $Id
*/
public class SystemPrEos1978 extends SystemEos {
public class SystemPrEos1978 extends SystemPrEos {
private static final long serialVersionUID = 1000;

/**
Expand Down Expand Up @@ -45,29 +41,8 @@ public SystemPrEos1978(double T, double P) {
*/
public SystemPrEos1978(double T, double P, boolean checkForSolids) {
super(T, P, checkForSolids);
attractiveTermNumber = 13;
modelName = "PR1978-EOS";

for (int i = 0; i < numberOfPhases; i++) {
phaseArray[i] = new PhasePrEos();
phaseArray[i].setTemperature(T);
phaseArray[i].setPressure(P);
}

if (solidPhaseCheck) {
setNumberOfPhases(5);
phaseArray[numberOfPhases - 1] = new PhasePureComponentSolid();
phaseArray[numberOfPhases - 1].setTemperature(T);
phaseArray[numberOfPhases - 1].setPressure(P);
phaseArray[numberOfPhases - 1].setRefPhase(phaseArray[1].getRefPhase());
}

if (hydrateCheck) {
phaseArray[numberOfPhases - 1] = new PhaseHydrate();
phaseArray[numberOfPhases - 1].setTemperature(T);
phaseArray[numberOfPhases - 1].setPressure(P);
phaseArray[numberOfPhases - 1].setRefPhase(phaseArray[1].getRefPhase());
}
attractiveTermNumber = 6;
modelName = "PR78-EoS";
}

/** {@inheritDoc} */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,17 @@ public static SystemInterface read(String inputFile) {
fluid = new neqsim.thermo.system.SystemSrkEos(288.15,
ThermodynamicConstantsInterface.referencePressure);
} else if (EOS.contains("PR")) {
String corr = br.readLine().replace("/", "");
if (corr.equals("PRCORR")) {
fluid = new neqsim.thermo.system.SystemPrEos1978(288.15,
ThermodynamicConstantsInterface.referencePressure);
} else {
fluid = new neqsim.thermo.system.SystemPrEos(288.15,
ThermodynamicConstantsInterface.referencePressure);
}
} else {
fluid = new neqsim.thermo.system.SystemPrEos(288.15,
ThermodynamicConstantsInterface.referencePressure);
} else if (EOS.contains("PR78")) {
fluid = new neqsim.thermo.system.SystemPrEos1978(288.15,
ThermodynamicConstantsInterface.referencePressure);
}
}
if (st.equals("CNAMES")) {
Expand Down

0 comments on commit 6c44fa4

Please sign in to comment.