From 58c04dd0d7218156935d25a55767cd339bd09174 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=85smund=20V=C3=A5ge=20Fannemel?= <34712686+asmfstatoil@users.noreply.github.com> Date: Thu, 9 Jan 2025 22:02:47 +0100 Subject: [PATCH] refact: replace numeric mixingrule with enum type (#1248) * feat: introduce MixingRulesInterface* refact: get eosmixingruletype * refact: use eosmixingruletype * fix: add CLASSIC_HV * doc: remove wrong doc * doc: fix variable name , getName() --- .../equipment/stream/StreamInterface.java | 2 - .../thermo/characterization/LumpingModel.java | 13 ++ .../characterization/PlusFractionModel.java | 22 +++ .../characterization/TBPfractionModel.java | 26 ++++ .../characterization/WaxCharacterise.java | 9 ++ .../thermo/mixingrule/CPAMixingRules.java | 45 +++++- .../mixingrule/CPAMixingRulesInterface.java | 2 +- .../ElectrolyteMixingRulesInterface.java | 2 +- .../thermo/mixingrule/EosMixingRuleType.java | 10 +- .../thermo/mixingrule/EosMixingRules.java | 139 +++++++++++++++--- .../mixingrule/EosMixingRulesInterface.java | 11 +- .../mixingrule/MixingRulesInterface.java | 14 ++ src/main/java/neqsim/thermo/phase/Phase.java | 23 +-- .../java/neqsim/thermo/phase/PhaseEos.java | 2 +- .../thermo/phase/PhaseEosInterface.java | 2 +- .../neqsim/thermo/phase/PhaseInterface.java | 9 +- .../neqsim/thermo/system/SystemInterface.java | 15 +- .../neqsim/thermo/system/SystemThermo.java | 45 ++---- .../HydrocarbonDewPointAnalyserTest.java | 2 - .../SalesGasAndStableOilTest.java | 30 ++-- .../thermo/system/SystemThermoTest.java | 4 +- .../system/SystemUMRPRUMCEosNewTest.java | 3 +- .../thermo/util/example/BubbleFlash.java | 2 - .../thermo/util/example/DewPointCurve.java | 2 - .../thermo/util/example/PS_PH_flash.java | 2 - .../thermo/util/example/PhaseEnvelope.java | 2 - .../thermo/util/example/TPMultiFlash.java | 2 - .../thermo/util/example/TPflashMembrane.java | 2 - .../thermo/util/example/TestGERGwater.java | 2 - .../neqsim/thermo/util/example/TestPSRK.java | 2 +- .../ThermodynamicOperationsTest.java | 109 +++++++------- .../util/example/TVflash.java | 2 - .../util/example/VLSolidTPFLash.java | 2 - 33 files changed, 364 insertions(+), 195 deletions(-) create mode 100644 src/main/java/neqsim/thermo/mixingrule/MixingRulesInterface.java diff --git a/src/main/java/neqsim/process/equipment/stream/StreamInterface.java b/src/main/java/neqsim/process/equipment/stream/StreamInterface.java index 65c1a79f40..61d4c85dc8 100644 --- a/src/main/java/neqsim/process/equipment/stream/StreamInterface.java +++ b/src/main/java/neqsim/process/equipment/stream/StreamInterface.java @@ -154,7 +154,6 @@ public default double getFlowRate(String unit) { */ public double getRVP(double referenceTemperature, String unit, String returnUnit); - /** * Calculates the Reid Vapor Pressure (RVP) of the stream. * @@ -321,7 +320,6 @@ public double getRVP(double referenceTemperature, String unit, String returnUnit @Override public int hashCode(); - /** * Calculates the hydrocarbon dew point of the stream. * diff --git a/src/main/java/neqsim/thermo/characterization/LumpingModel.java b/src/main/java/neqsim/thermo/characterization/LumpingModel.java index 73f6e0d216..6d2cb46446 100644 --- a/src/main/java/neqsim/thermo/characterization/LumpingModel.java +++ b/src/main/java/neqsim/thermo/characterization/LumpingModel.java @@ -50,41 +50,49 @@ public class StandardLumpingModel public StandardLumpingModel() {} + /** {@inheritDoc} */ @Override public void setNumberOfLumpedComponents(int lumpedNumb) { numberOfLumpedComponents = lumpedNumb; } + /** {@inheritDoc} */ @Override public int getNumberOfLumpedComponents() { return numberOfLumpedComponents; } + /** {@inheritDoc} */ @Override public void setNumberOfPseudoComponents(int lumpedNumb) { numberOfPseudocomponents = lumpedNumb; } + /** {@inheritDoc} */ @Override public int getNumberOfPseudoComponents() { return numberOfPseudocomponents; } + /** {@inheritDoc} */ @Override public String getName() { return name; } + /** {@inheritDoc} */ @Override public String getLumpedComponentName(int i) { return lumpedComponentNames[i]; } + /** {@inheritDoc} */ @Override public String[] getLumpedComponentNames() { return lumpedComponentNames; } + /** {@inheritDoc} */ @Override public void generateLumpedComposition(Characterise charac) { numberOfLumpedComponents = numberOfPseudocomponents; @@ -196,6 +204,7 @@ public void generateLumpedComposition(Characterise charac) { } } + /** {@inheritDoc} */ @Override public double getFractionOfHeavyEnd(int i) { if (fractionOfHeavyEnd == null) { @@ -220,6 +229,7 @@ public class PVTLumpingModel extends StandardLumpingModel { public PVTLumpingModel() {} + /** {@inheritDoc} */ @Override public void generateLumpedComposition(Characterise charac) { double weightFrac = 0.0; @@ -311,6 +321,7 @@ public void generateLumpedComposition(Characterise charac) { system.init(0); } + /** {@inheritDoc} */ @Override public double getFractionOfHeavyEnd(int i) { if (fractionOfHeavyEnd == null) { @@ -334,6 +345,7 @@ public class NoLumpingModel extends StandardLumpingModel { public NoLumpingModel() {} + /** {@inheritDoc} */ @Override public void generateLumpedComposition(Characterise charac) { numberOfPseudocomponents = charac.getPlusFractionModel().getLastPlusFractionNumber(); @@ -414,6 +426,7 @@ public void generateLumpedComposition(Characterise charac) { system.init(0); } + /** {@inheritDoc} */ @Override public double getFractionOfHeavyEnd(int i) { if (fractionOfHeavyEnd == null) { diff --git a/src/main/java/neqsim/thermo/characterization/PlusFractionModel.java b/src/main/java/neqsim/thermo/characterization/PlusFractionModel.java index cc4fc09807..4446f7e120 100644 --- a/src/main/java/neqsim/thermo/characterization/PlusFractionModel.java +++ b/src/main/java/neqsim/thermo/characterization/PlusFractionModel.java @@ -101,11 +101,13 @@ public String getName() { return name; } + /** {@inheritDoc} */ @Override public double getMPlus() { return MPlus; } + /** {@inheritDoc} */ @Override public double getZPlus() { return zPlus; @@ -119,36 +121,43 @@ public double getMaxPlusMolarMass() { return maxPlusMolarMass; } + /** {@inheritDoc} */ @Override public double getNumberOfPlusPseudocomponents() { return numberOfPlusPseudocomponents; } + /** {@inheritDoc} */ @Override public double[] getZ() { return z; } + /** {@inheritDoc} */ @Override public double[] getM() { return M; } + /** {@inheritDoc} */ @Override public double[] getDens() { return dens; } + /** {@inheritDoc} */ @Override public double getDensPlus() { return densPlus; } + /** {@inheritDoc} */ @Override public int getFirstPlusFractionNumber() { return firstPlusFractionNumber; } + /** {@inheritDoc} */ @Override public int getFirstTBPFractionNumber() { int firstTBPNumber = 0; @@ -174,16 +183,19 @@ public int getFirstTBPFractionNumber() { return firstTBPNumber; } + /** {@inheritDoc} */ @Override public int getPlusComponentNumber() { return plusComponentNumber; } + /** {@inheritDoc} */ @Override public int getLastPlusFractionNumber() { return lastPlusFractionNumber; } + /** {@inheritDoc} */ @Override public boolean hasPlusFraction() { for (int i = 0; i < system.getPhase(0).getNumberOfComponents(); i++) { @@ -198,6 +210,7 @@ public boolean hasPlusFraction() { return false; } + /** {@inheritDoc} */ @Override public boolean characterizePlusFraction(TBPModelInterface TBPModel) { system.init(0); @@ -242,11 +255,13 @@ public boolean characterizePlusFraction(TBPModelInterface TBPModel) { return true; } + /** {@inheritDoc} */ @Override public double[] getCoefs() { return this.coefs; } + /** {@inheritDoc} */ @Override public double getCoef(int i) { return this.coefs[i]; @@ -298,6 +313,7 @@ public void setCoefs(double coef, int i) { this.coefs[i] = coef; } + /** {@inheritDoc} */ @Override public void setLastPlusFractionNumber(int fract) { lastPlusFractionNumber = fract + 1; @@ -392,6 +408,7 @@ public void densityUOP() { } } + /** {@inheritDoc} */ @Override public boolean characterizePlusFraction(TBPModelInterface TBPModel) { system.init(0); @@ -451,11 +468,13 @@ public double[] getGammaParameters() { return new double[] {this.alfa, this.eta}; } + /** {@inheritDoc} */ @Override public double[] getCoefs() { return new double[] {alfa, eta}; } + /** {@inheritDoc} */ @Override public double getCoef(int i) { if (i == 0) @@ -465,16 +484,19 @@ public double getCoef(int i) { return 0; } + /** {@inheritDoc} */ @Override public double[] getZ() { return zValues; } + /** {@inheritDoc} */ @Override public double[] getM() { return molarMasses; } + /** {@inheritDoc} */ @Override public double[] getDens() { return densities; diff --git a/src/main/java/neqsim/thermo/characterization/TBPfractionModel.java b/src/main/java/neqsim/thermo/characterization/TBPfractionModel.java index 3d533969b2..d1a93df2ca 100644 --- a/src/main/java/neqsim/thermo/characterization/TBPfractionModel.java +++ b/src/main/java/neqsim/thermo/characterization/TBPfractionModel.java @@ -37,22 +37,26 @@ public abstract class TBPBaseModel implements TBPModelInterface, Cloneable, java protected boolean calcm = true; + /** {@inheritDoc} */ @Override public String getName() { return name; } + /** {@inheritDoc} */ @Override public double calcTB(double molarMass, double density) { return Math.pow((molarMass / 5.805e-5 * Math.pow(density, 0.9371)), 1.0 / 2.3776); } + /** {@inheritDoc} */ @Override public double calcWatsonCharacterizationFactor(double molarMass, double density) { // System.out.println("boiling point " + calcTB(molarMass, density)); return Math.pow(1.8 * calcTB(molarMass, density), 1.0 / 3.0) / density; } + /** {@inheritDoc} */ @Override public double calcAcentricFactorKeslerLee(double molarMass, double density) { double TC = calcTC(molarMass, density); @@ -71,6 +75,7 @@ public double calcAcentricFactorKeslerLee(double molarMass, double density) { } } + /** {@inheritDoc} */ @Override public double calcAcentricFactor(double molarMass, double density) { double TC = calcTC(molarMass, density); @@ -80,6 +85,7 @@ public double calcAcentricFactor(double molarMass, double density) { / (TC / TB - 1.0) - 1.0; } + /** {@inheritDoc} */ @Override public double calcCriticalVolume(double molarMass, double density) { double TC = calcTC(molarMass, density); @@ -94,11 +100,13 @@ public double calcCriticalVolume(double molarMass, double density) { return criticaVol; } + /** {@inheritDoc} */ @Override public double calcParachorParameter(double molarMass, double density) { return 59.3 + 2.34 * molarMass * 1000.0; } + /** {@inheritDoc} */ @Override public double calcCriticalViscosity(double molarMass, double density) { double TC = calcTC(molarMass, density); @@ -107,17 +115,20 @@ public double calcCriticalViscosity(double molarMass, double density) { * 1e-7; } + /** {@inheritDoc} */ @Override public double calcRacketZ(SystemInterface thermoSystem, double molarMass, double density) { throw new RuntimeException( new neqsim.util.exception.NotImplementedException(this, "calcRacketZ")); } + /** {@inheritDoc} */ @Override public double calcm(double molarMass, double density) { throw new RuntimeException(new neqsim.util.exception.NotImplementedException(this, "calcm")); } + /** {@inheritDoc} */ @Override public boolean isCalcm() { return calcm; @@ -139,6 +150,7 @@ public class PedersenTBPModelSRK extends TBPBaseModel { double[] TPBracketcoefs = {0.29441, 0.40768}; double[][] TBPfractionCoefs = null; + /** {@inheritDoc} */ @Override public double calcTC(double molarMass, double density) { // System.out.println("TC ccc " + TBPfractionCoefs[0][0]); @@ -152,6 +164,7 @@ public double calcTC(double molarMass, double density) { + TBPfractionCoefs[0][2] * molarMass + TBPfractionCoefs[0][3] / molarMass; } + /** {@inheritDoc} */ @Override public double calcPC(double molarMass, double density) { if (molarMass < 1120) { @@ -165,6 +178,7 @@ public double calcPC(double molarMass, double density) { + TBPfractionCoefs[1][2] / molarMass + TBPfractionCoefs[1][3] / Math.pow(molarMass, 2.0)); } + /** {@inheritDoc} */ @Override public double calcm(double molarMass, double density) { if (molarMass < 1120) { @@ -176,6 +190,7 @@ public double calcm(double molarMass, double density) { + TBPfractionCoefs[2][2] * density + TBPfractionCoefs[2][3] * Math.pow(molarMass, 2.0); } + /** {@inheritDoc} */ @Override public double calcTB(double molarMass, double density) { if (molarMass < 540) { @@ -186,6 +201,7 @@ public double calcTB(double molarMass, double density) { } } + /** {@inheritDoc} */ @Override public double calcRacketZ(SystemInterface thermoSystem, double molarMass, double density) { double penelouxC = (thermoSystem.getPhase(0).getMolarVolume() - molarMass / (density * 10.0)); @@ -256,6 +272,7 @@ public RiaziDaubert() { calcm = false; } + /** {@inheritDoc} */ @Override public double calcTC(double molarMass, double density) { // molarMass=molarMass*1e3; @@ -268,6 +285,7 @@ public double calcTC(double molarMass, double density) { // Math.pow(sig2, c); } + /** {@inheritDoc} */ @Override public double calcPC(double molarMass, double density) { if (molarMass > 300) { @@ -288,6 +306,7 @@ public double calcAcentricFactor2(double molarMass, double density) { / (TC / TB - 1.0) - 1.0; } + /** {@inheritDoc} */ @Override public double calcTB(double molarMass, double density) { // Soreide method (Whitson book) @@ -296,6 +315,7 @@ public double calcTB(double molarMass, double density) { * Math.exp(-4.922e-3 * molarMass - 4.7685 * density + 3.462e-3 * molarMass * density)); // 97.58*Math.pow(molarMass,0.3323)*Math.pow(density,0.04609); } + /** {@inheritDoc} */ @Override public double calcAcentricFactor(double molarMass, double density) { double TC = calcTC(molarMass, density); @@ -326,6 +346,7 @@ public LeeKesler() { calcm = false; } + /** {@inheritDoc} */ @Override public double calcTC(double molarMass, double density) { double sg = density; @@ -335,6 +356,7 @@ public double calcTC(double molarMass, double density) { return TC; } + /** {@inheritDoc} */ @Override public double calcPC(double molarMass, double density) { double sg = density; @@ -347,6 +369,7 @@ public double calcPC(double molarMass, double density) { return PC; } + /** {@inheritDoc} */ @Override public double calcAcentricFactor(double molarMass, double density) { return super.calcAcentricFactorKeslerLee(molarMass, density); @@ -364,6 +387,7 @@ public TwuModel() { calcm = false; } + /** {@inheritDoc} */ @Override public double calcTC(double molarMass, double density) { double sg = density; @@ -417,6 +441,7 @@ public double solveMW(double TB) { return MW_alkane; } + /** {@inheritDoc} */ @Override public double calcPC(double molarMass, double density) { double sg = density; @@ -447,6 +472,7 @@ public double calcPC(double molarMass, double density) { return PC * 10.0; // * 10 due to conversion MPa to bar } + /** {@inheritDoc} */ @Override public double calcCriticalVolume(double molarMass, double density) { double sg = density; diff --git a/src/main/java/neqsim/thermo/characterization/WaxCharacterise.java b/src/main/java/neqsim/thermo/characterization/WaxCharacterise.java index 744b878448..acf55c2664 100644 --- a/src/main/java/neqsim/thermo/characterization/WaxCharacterise.java +++ b/src/main/java/neqsim/thermo/characterization/WaxCharacterise.java @@ -54,6 +54,7 @@ public abstract class WaxBaseModel implements WaxModelInterface { double[] parameterWaxHeatOfFusion = new double[1]; double[] parameterWaxTriplePointTemperature = new double[1]; + /** {@inheritDoc} */ @Override public WaxBaseModel clone() { WaxBaseModel clonedSystem = null; @@ -65,29 +66,35 @@ public WaxBaseModel clone() { return clonedSystem; } + /** {@inheritDoc} */ @Override public void addTBPWax() {} + /** {@inheritDoc} */ @Override public void setWaxParameters(double[] parameters) { parameterWax = parameters; } + /** {@inheritDoc} */ @Override public void setWaxParameter(int i, double parameters) { parameterWax[i] = parameters; } + /** {@inheritDoc} */ @Override public void setParameterWaxHeatOfFusion(int i, double parameters) { parameterWaxHeatOfFusion[i] = parameters; } + /** {@inheritDoc} */ @Override public void setParameterWaxTriplePointTemperature(int i, double parameters) { parameterWaxTriplePointTemperature[i] = parameters; } + /** {@inheritDoc} */ @Override public double[] getWaxParameters() { return parameterWax; @@ -164,6 +171,7 @@ public double calcPCwax(int componentNumber, String normalComponent) { 3.46); } + /** {@inheritDoc} */ @Override public void addTBPWax() { int numberOfCOmponents = thermoSystem.getPhase(0).getNumberOfComponents(); @@ -239,6 +247,7 @@ public void addTBPWax() { } } + /** {@inheritDoc} */ @Override public void removeWax() { for (int i = 0; i < thermoSystem.getPhase(0).getNumberOfComponents(); i++) { diff --git a/src/main/java/neqsim/thermo/mixingrule/CPAMixingRules.java b/src/main/java/neqsim/thermo/mixingrule/CPAMixingRules.java index 3dc4e7d362..6a5e8cdc30 100644 --- a/src/main/java/neqsim/thermo/mixingrule/CPAMixingRules.java +++ b/src/main/java/neqsim/thermo/mixingrule/CPAMixingRules.java @@ -29,6 +29,9 @@ public class CPAMixingRules implements Cloneable, ThermodynamicConstantsInterfac /** Logger object for class. */ static Logger logger = LogManager.getLogger(CPAMixingRules.class); + /** Name of mixing rule. */ + private String mixingRuleName = "CPA_Radoch"; + int[][] assosSchemeType = null; // 0- ER - 1 - CR1 double[][] cpaBetaCross = null; double[][] cpaEpsCross = null; @@ -73,48 +76,56 @@ public double calcXi(int siteNumber, int compnumb, PhaseInterface phase, double return 1.0; } + /** {@inheritDoc} */ @Override public double calcXi(int[][][] assosScheme, int[][][][] assosScheme2, int siteNumber, int compnumb, PhaseInterface phase, double temperature, double pressure, int numbcomp) { return 1.0; } + /** {@inheritDoc} */ @Override public double calcDelta(int siteNumber1, int siteNumber2, int compnumb1, int compnumb2, PhaseInterface phase, double temperature, double pressure, int numbcomp) { return 1.0; } + /** {@inheritDoc} */ @Override public double calcDeltaNog(int siteNumber1, int siteNumber2, int compnumb1, int compnumb2, PhaseInterface phase, double temperature, double pressure, int numbcomp) { return 1.0; } + /** {@inheritDoc} */ @Override public double calcDeltadN(int derivativeComp, int siteNumber1, int siteNumber2, int compnumb1, int compnumb2, PhaseInterface phase, double temperature, double pressure, int numbcomp) { return 1.0; } + /** {@inheritDoc} */ @Override public double calcDeltadT(int siteNumber1, int siteNumber2, int compnumb1, int compnumb2, PhaseInterface phase, double temperature, double pressure, int numbcomp) { return 1.0; } + /** {@inheritDoc} */ @Override public double calcDeltadV(int siteNumber1, int siteNumber2, int compnumb1, int compnumb2, PhaseInterface phase, double temperature, double pressure, int numbcomp) { return 1.0; } + /** {@inheritDoc} */ @Override public double calcDeltadTdT(int siteNumber1, int siteNumber2, int compnumb1, int compnumb2, PhaseInterface phase, double temperature, double pressure, int numbcomp) { return 1.0; } + /** {@inheritDoc} */ @Override public double calcDeltadTdV(int siteNumber1, int siteNumber2, int compnumb1, int compnumb2, PhaseInterface phase, double temperature, double pressure, int numbcomp) { @@ -126,6 +137,12 @@ public class CPA_Radoch extends CPA_Radoch_base { /** Serialization version UID. */ private static final long serialVersionUID = 1000; + /** {@inheritDoc} */ + @Override + public String getName() { + return mixingRuleName; + } + public double getCrossAssociationEnergy(int compnumb1, int compnumb2, PhaseInterface phase, double temperature, double pressure, int numbcomp) { if (Math.abs(cpaEpsCross[compnumb1][compnumb2]) > 1e-10) { @@ -154,6 +171,7 @@ public double getCrossAssociationVolume(int compnumb1, int compnumb2, PhaseInter * phase.getComponent(compnumb2).getAssociationVolume()); } + /** {@inheritDoc} */ @Override public double calcDelta(int siteNumber1, int siteNumber2, int compnumb1, int compnumb2, PhaseInterface phase, double temperature, double pressure, int numbcomp) { @@ -230,6 +248,7 @@ public double calcDelta(int compnumb1, int compnumb2, PhaseInterface phase, doub * ((PhaseCPAInterface) phase).getGcpa(); } + /** {@inheritDoc} */ @Override public double calcDeltaNog(int siteNumber1, int siteNumber2, int compnumb1, int compnumb2, PhaseInterface phase, double temperature, double pressure, int numbcomp) { @@ -266,6 +285,7 @@ public double calcDeltaNog(int siteNumber1, int siteNumber2, int compnumb1, int * getCrossAssociationVolume(compnumb1, compnumb2, phase, temperature, pressure, numbcomp); } + /** {@inheritDoc} */ @Override public double calcDeltadN(int derivativeComp, int siteNumber1, int siteNumber2, int compnumb1, int compnumb2, PhaseInterface phase, double temperature, double pressure, int numbcomp) { @@ -275,6 +295,7 @@ public double calcDeltadN(int derivativeComp, int siteNumber1, int siteNumber2, * ((ComponentSrkCPA) phase.getComponent(derivativeComp)).calc_lngi(phase); } + /** {@inheritDoc} */ @Override public double calcDeltadT(int siteNumber1, int siteNumber2, int compnumb1, int compnumb2, PhaseInterface phase, double temperature, double pressure, int numbcomp) { @@ -337,6 +358,7 @@ public double calcDeltadT(int siteNumber1, int siteNumber2, int compnumb1, int c * ((PhaseCPAInterface) phase).getGcpa(); } + /** {@inheritDoc} */ @Override public double calcDeltadV(int siteNumber1, int siteNumber2, int compnumb1, int compnumb2, PhaseInterface phase, double temperature, double pressure, int numbcomp) { @@ -346,6 +368,7 @@ public double calcDeltadV(int siteNumber1, int siteNumber2, int compnumb1, int c * ((PhaseCPAInterface) phase).getGcpav(); } + /** {@inheritDoc} */ @Override public double calcDeltadTdV(int siteNumber1, int siteNumber2, int compnumb1, int compnumb2, PhaseInterface phase, double temperature, double pressure, int numbcomp) { @@ -380,6 +403,7 @@ public double calcDeltadTdV(int siteNumber1, int siteNumber2, int compnumb1, int * ((PhaseCPAInterface) phase).getGcpa() * ((PhaseCPAInterface) phase).getGcpav(); } + /** {@inheritDoc} */ @Override public double calcDeltadTdT(int siteNumber1, int siteNumber2, int compnumb1, int compnumb2, PhaseInterface phase, double temperature, double pressure, int numbcomp) { @@ -561,6 +585,7 @@ public double getCrossAssociationVolume(int siteNumber1, int siteNumber2, int co * phase.getComponent(compnumb2).getAssociationVolumeSAFT()) * extrwterm; } + /** {@inheritDoc} */ @Override public double calcDelta(int siteNumber1, int siteNumber2, int compnumb1, int compnumb2, PhaseInterface phase, double temperature, double pressure, int numbcomp) { @@ -585,17 +610,21 @@ public double calcDelta(int siteNumber1, int siteNumber2, int compnumb1, int com * getMixingRule. *
* - * @param i a int + * @param mr a int * @return a {@link neqsim.thermo.mixingrule.CPAMixingRulesInterface} object */ - public CPAMixingRulesInterface getMixingRule(int i) { - if (i == 1) { + public CPAMixingRulesInterface getMixingRule(int mr) { + if (mr == 1) { + mixingRuleName = "CPA_Radoch"; return new CPA_Radoch(); - } else if (i == 2) { + } else if (mr == 2) { + mixingRuleName = "CPA_Radoch"; return new CPA_Radoch(); - } else if (i == 3) { + } else if (mr == 3) { + mixingRuleName = "PCSAFTa_Radoch"; return new PCSAFTa_Radoch(); } else { + mixingRuleName = "CPA_Radoch"; return new CPA_Radoch(); } } @@ -605,11 +634,11 @@ public CPAMixingRulesInterface getMixingRule(int i) { * getMixingRule. * * - * @param i a int + * @param mr a int * @param phase a {@link neqsim.thermo.phase.PhaseInterface} object * @return a {@link neqsim.thermo.mixingrule.CPAMixingRulesInterface} object */ - public CPAMixingRulesInterface getMixingRule(int i, PhaseInterface phase) { + public CPAMixingRulesInterface getMixingRule(int mr, PhaseInterface phase) { assosSchemeType = new int[phase.getNumberOfComponents()][phase.getNumberOfComponents()]; cpaBetaCross = new double[phase.getNumberOfComponents()][phase.getNumberOfComponents()]; cpaEpsCross = new double[phase.getNumberOfComponents()][phase.getNumberOfComponents()]; @@ -656,7 +685,7 @@ public CPAMixingRulesInterface getMixingRule(int i, PhaseInterface phase) { } } - return getMixingRule(i); + return getMixingRule(mr); } /** diff --git a/src/main/java/neqsim/thermo/mixingrule/CPAMixingRulesInterface.java b/src/main/java/neqsim/thermo/mixingrule/CPAMixingRulesInterface.java index c2a903e146..52004f02ed 100644 --- a/src/main/java/neqsim/thermo/mixingrule/CPAMixingRulesInterface.java +++ b/src/main/java/neqsim/thermo/mixingrule/CPAMixingRulesInterface.java @@ -16,7 +16,7 @@ * @author Even Solbraa * @version $Id: $Id */ -public interface CPAMixingRulesInterface extends java.io.Serializable { +public interface CPAMixingRulesInterface extends MixingRulesInterface { // public double calcXi(int siteNumber, int compnumb, PhaseInterface phase, // double temperature, double pressure, int numbcomp); diff --git a/src/main/java/neqsim/thermo/mixingrule/ElectrolyteMixingRulesInterface.java b/src/main/java/neqsim/thermo/mixingrule/ElectrolyteMixingRulesInterface.java index 3c784feee1..8f5af7b9c0 100644 --- a/src/main/java/neqsim/thermo/mixingrule/ElectrolyteMixingRulesInterface.java +++ b/src/main/java/neqsim/thermo/mixingrule/ElectrolyteMixingRulesInterface.java @@ -16,7 +16,7 @@ * @author Even Solbraa * @version $Id: $Id */ -public interface ElectrolyteMixingRulesInterface extends java.io.Serializable { +public interface ElectrolyteMixingRulesInterface extends MixingRulesInterface { /** ** calcWij. diff --git a/src/main/java/neqsim/thermo/mixingrule/EosMixingRuleType.java b/src/main/java/neqsim/thermo/mixingrule/EosMixingRuleType.java index 2dca6514e4..59b2ca56c9 100644 --- a/src/main/java/neqsim/thermo/mixingrule/EosMixingRuleType.java +++ b/src/main/java/neqsim/thermo/mixingrule/EosMixingRuleType.java @@ -6,10 +6,11 @@ * Types of EosMixingRule, relating to different kind of mixing rules relevant for EOS type phases. * Available types are: *
* calcA. @@ -219,15 +219,6 @@ public double calcAiT(int compNumb, PhaseInterface phase, double temperature, do */ public void setnEOSkij(double n); - /** - *
- * getMixingRuleName. - *
- * - * @return a {@link java.lang.String} object - */ - public java.lang.String getMixingRuleName(); - /** ** setMixingRuleGEModel. diff --git a/src/main/java/neqsim/thermo/mixingrule/MixingRulesInterface.java b/src/main/java/neqsim/thermo/mixingrule/MixingRulesInterface.java new file mode 100644 index 0000000000..01ddb712ef --- /dev/null +++ b/src/main/java/neqsim/thermo/mixingrule/MixingRulesInterface.java @@ -0,0 +1,14 @@ +package neqsim.thermo.mixingrule; + +import java.io.Serializable; + +public interface MixingRulesInterface extends Serializable, Cloneable { + /** + *
+ * Get name of mixing rule. + *
+ * + * @return a {@link java.lang.String} object + */ + public java.lang.String getName(); +} diff --git a/src/main/java/neqsim/thermo/phase/Phase.java b/src/main/java/neqsim/thermo/phase/Phase.java index e1509396b3..67ae64293c 100644 --- a/src/main/java/neqsim/thermo/phase/Phase.java +++ b/src/main/java/neqsim/thermo/phase/Phase.java @@ -16,6 +16,7 @@ import neqsim.thermo.ThermodynamicConstantsInterface; import neqsim.thermo.ThermodynamicModelSettings; import neqsim.thermo.component.ComponentInterface; +import neqsim.thermo.mixingrule.EosMixingRuleType; import neqsim.thermo.system.SystemInterface; import neqsim.util.exception.InvalidInputException; @@ -44,7 +45,6 @@ public abstract class Phase implements PhaseInterface { public int numberOfComponents = 0; public ComponentInterface[] componentArray; - public boolean mixingRuleDefined = false; public boolean calcMolarVolume = true; @@ -76,7 +76,8 @@ public abstract class Phase implements PhaseInterface { public double numberOfMolesInPhase = 0; private int initType = 0; - int mixingRuleNumber = 0; + public boolean mixingRuleDefined = false; + private EosMixingRuleType mixingRuleType = EosMixingRuleType.NO; /** Temperature of phase. */ double temperature = 0; @@ -1327,7 +1328,7 @@ public void initRefPhases(boolean onlyPure, String name) { refPhase[i].addComponent(getComponent(i).getComponentName(), 10.0, 10.0, 0); } refPhase[i].setAttractiveTerm(this.getComponent(i).getAttractiveTermNumber()); - refPhase[i].setMixingRule(this.getMixingRuleNumber()); + refPhase[i].setMixingRule(this.getEosMixingRuleType().getValue()); refPhase[i].setType(this.getType()); refPhase[i].init(refPhase[i].getNumberOfMolesInPhase(), 1, 0, this.getType(), 1.0); } else { @@ -1345,7 +1346,7 @@ public void initRefPhases(boolean onlyPure, String name) { } refPhase[i].addComponent(name, 10.0, 10.0, 1); refPhase[i].setAttractiveTerm(this.getComponent(i).getAttractiveTermNumber()); - refPhase[i].setMixingRule(this.getMixingRuleNumber()); + refPhase[i].setMixingRule(this.getEosMixingRuleType().getValue()); refPhase[i].init(refPhase[i].getNumberOfMolesInPhase(), 2, 0, this.getType(), 1.0); } } @@ -1723,10 +1724,16 @@ public double getdrhodN() { throw new UnsupportedOperationException("Unimplemented method 'getdrhodN'"); } + /** {@inheritDoc} */ + @Override + public EosMixingRuleType getEosMixingRuleType() { + return mixingRuleType; + } + /** {@inheritDoc} */ @Override public void setMixingRule(int type) { - mixingRuleNumber = type; + mixingRuleType = EosMixingRuleType.byValue(type); } /** @@ -1901,12 +1908,6 @@ public boolean hasComponent(String name, boolean normalized) { return false; } - /** {@inheritDoc} */ - @Override - public final int getMixingRuleNumber() { - return mixingRuleNumber; - } - /** {@inheritDoc} */ @Override public neqsim.thermo.phase.PhaseInterface getRefPhase(int index) { diff --git a/src/main/java/neqsim/thermo/phase/PhaseEos.java b/src/main/java/neqsim/thermo/phase/PhaseEos.java index 76c0f6ca8f..4373e2d90f 100644 --- a/src/main/java/neqsim/thermo/phase/PhaseEos.java +++ b/src/main/java/neqsim/thermo/phase/PhaseEos.java @@ -411,7 +411,7 @@ public double getPressureAttractive() { /** {@inheritDoc} */ @Override public String getMixingRuleName() { - return mixRule.getMixingRuleName(); + return mixRule.getName(); } /** {@inheritDoc} */ diff --git a/src/main/java/neqsim/thermo/phase/PhaseEosInterface.java b/src/main/java/neqsim/thermo/phase/PhaseEosInterface.java index 7695cbe1e4..2353f2be52 100644 --- a/src/main/java/neqsim/thermo/phase/PhaseEosInterface.java +++ b/src/main/java/neqsim/thermo/phase/PhaseEosInterface.java @@ -24,7 +24,7 @@ public interface PhaseEosInterface extends PhaseInterface { /** *- * getMixingRule. + * getEosMixingRule. *
* * @return a {@link neqsim.thermo.mixingrule.EosMixingRulesInterface} object diff --git a/src/main/java/neqsim/thermo/phase/PhaseInterface.java b/src/main/java/neqsim/thermo/phase/PhaseInterface.java index cd0423b2e6..78f5e9019b 100644 --- a/src/main/java/neqsim/thermo/phase/PhaseInterface.java +++ b/src/main/java/neqsim/thermo/phase/PhaseInterface.java @@ -11,6 +11,7 @@ import neqsim.physicalproperties.system.PhysicalPropertyModel; import neqsim.thermo.ThermodynamicConstantsInterface; import neqsim.thermo.component.ComponentInterface; +import neqsim.thermo.mixingrule.EosMixingRuleType; import neqsim.thermo.system.SystemInterface; /** @@ -1804,13 +1805,11 @@ public default void setPhysicalProperties() { public double getLogInfiniteDiluteFugacity(int k); /** - *- * Getter for property mixingRuleNumber. - *
+ * Get EOS mixing rule type. * - * @return a int + * @return a EosMixingRuleType */ - public int getMixingRuleNumber(); + public EosMixingRuleType getEosMixingRuleType(); /** *diff --git a/src/main/java/neqsim/thermo/system/SystemInterface.java b/src/main/java/neqsim/thermo/system/SystemInterface.java index a5a728e088..0236373240 100644 --- a/src/main/java/neqsim/thermo/system/SystemInterface.java +++ b/src/main/java/neqsim/thermo/system/SystemInterface.java @@ -2259,15 +2259,12 @@ public void setImplementedTemperatureDeriativesofFugacity( */ public void setMaxNumberOfPhases(int maxNumberOfPhases); - /** * method to set mixing rule used for the fluid. * - * @param mr EosMixingRuleTypes enum + * @param emrt EosMixingRuleTypes enum */ - public default void setMixingRule(EosMixingRuleType mr) { - setMixingRule(mr.getValue()); - } + public void setMixingRule(EosMixingRuleType emrt); /** * method to set mixing rule used for the fluid. @@ -2280,14 +2277,18 @@ public default void setMixingRule(EosMixingRuleType mr) { * 10-classic mixing rule with temperature and composition dependent kij of CPA from NeqSim * database */ - public void setMixingRule(int type); + public default void setMixingRule(int type) { + setMixingRule(EosMixingRuleType.byValue(type)); + } /** * method to set the mixing rule for the fluid. * * @param typename a {@link java.lang.String} object */ - public void setMixingRule(String typename); + public default void setMixingRule(String typename) { + setMixingRule(EosMixingRuleType.byName(typename.replace("-", "_"))); + } /** *
diff --git a/src/main/java/neqsim/thermo/system/SystemThermo.java b/src/main/java/neqsim/thermo/system/SystemThermo.java index 44b49dde65..000c58cee1 100644 --- a/src/main/java/neqsim/thermo/system/SystemThermo.java +++ b/src/main/java/neqsim/thermo/system/SystemThermo.java @@ -20,6 +20,7 @@ import neqsim.thermo.characterization.WaxCharacterise; import neqsim.thermo.characterization.WaxModelInterface; import neqsim.thermo.component.ComponentInterface; +import neqsim.thermo.mixingrule.EosMixingRuleType; import neqsim.thermo.phase.PhaseEosInterface; import neqsim.thermo.phase.PhaseHydrate; import neqsim.thermo.phase.PhaseInterface; @@ -108,8 +109,10 @@ public abstract class SystemThermo implements SystemInterface { /** Maximum allowed number of phases. */ public int maxNumberOfPhases = 2; - private int mixingRule = 1; + + private EosMixingRuleType eosMixingRuleType = EosMixingRuleType.byValue(1); protected String modelName = "Default"; + protected boolean multiPhaseCheck = false; private boolean multiphaseWaxCheck = false; @@ -2432,13 +2435,13 @@ public int getMaxNumberOfPhases() { /** {@inheritDoc} */ @Override public int getMixingRule() { - return mixingRule; + return eosMixingRuleType.getValue(); } /** {@inheritDoc} */ @Override public String getMixingRuleName() { - return ((PhaseEosInterface) getPhase(0)).getEosMixingRule().getMixingRuleName(); + return ((PhaseEosInterface) getPhase(0)).getEosMixingRule().getName(); } /** {@inheritDoc} */ @@ -4417,47 +4420,19 @@ public void setMaxNumberOfPhases(int maxNumberOfPhases) { /** {@inheritDoc} */ @Override - public final void setMixingRule(int type) { - mixingRule = type; + public final void setMixingRule(EosMixingRuleType emrt) { + eosMixingRuleType = emrt; if (numberOfPhases < 4) { resetPhysicalProperties(); } for (int i = 0; i < maxNumberOfPhases; i++) { if (isPhase(i)) { - getPhase(i).setMixingRule(type); + getPhase(i).setMixingRule(emrt.getValue()); getPhase(i).initPhysicalProperties(); } } } - /** {@inheritDoc} */ - @Override - public void setMixingRule(String typename) { - int var = 0; - if (typename.equalsIgnoreCase("no")) { - var = 1; - } else if (typename.equalsIgnoreCase("classic")) { - var = 2; - } else if (typename.equalsIgnoreCase("HV")) { - var = 4; - } else if (typename.equalsIgnoreCase("WS")) { - var = 5; - } else if (typename.equalsIgnoreCase("CPA-Mix") || typename.equalsIgnoreCase("CPA_Mix")) { - var = 7; - } else if (typename.equalsIgnoreCase("classic-T") || typename.equalsIgnoreCase("classic_T")) { - var = 8; - } else if (typename.equalsIgnoreCase("classic-T-cpa") - || typename.equalsIgnoreCase("classic_t_cpa")) { - var = 9; - } else if (typename.equalsIgnoreCase("classic-Tx-cpa") - || typename.equalsIgnoreCase("classic_tx_cpa")) { - var = 10; - } else { - var = 1; - } - this.setMixingRule(var); - } - /** {@inheritDoc} */ @Override public void setMixingRule(String typename, String GEmodel) { @@ -4682,7 +4657,7 @@ public void setMultiPhaseCheck(boolean multiPhaseCheck) { setMaxNumberOfPhases(3); if (phaseArray[1] != null) { phaseArray[2] = phaseArray[1].clone(); - phaseArray[2].resetMixingRule(phaseArray[0].getMixingRuleNumber()); + phaseArray[2].resetMixingRule(phaseArray[0].getEosMixingRuleType().getValue()); phaseArray[2].resetPhysicalProperties(); phaseArray[2].initPhysicalProperties(); } diff --git a/src/test/java/neqsim/process/measurementdevice/HydrocarbonDewPointAnalyserTest.java b/src/test/java/neqsim/process/measurementdevice/HydrocarbonDewPointAnalyserTest.java index 05c069d8c9..6e279efd59 100644 --- a/src/test/java/neqsim/process/measurementdevice/HydrocarbonDewPointAnalyserTest.java +++ b/src/test/java/neqsim/process/measurementdevice/HydrocarbonDewPointAnalyserTest.java @@ -33,7 +33,5 @@ void testHCdewPoint() { Assertions.assertEquals(-14.0173918, hc_analyser.getMeasuredValue("C"), 1e-5); Assertions.assertEquals(-14.0173918, stream1.getHydrocarbonDewPoint("C", 40.0, "bara"), 1e-5); - - } } diff --git a/src/test/java/neqsim/process/processmodel/SalesGasAndStableOilTest.java b/src/test/java/neqsim/process/processmodel/SalesGasAndStableOilTest.java index fa51434c9b..5f1afb3b6b 100644 --- a/src/test/java/neqsim/process/processmodel/SalesGasAndStableOilTest.java +++ b/src/test/java/neqsim/process/processmodel/SalesGasAndStableOilTest.java @@ -102,7 +102,7 @@ public void testProcess2() { ThreePhaseSeparator secondStageSeparator = new neqsim.process.equipment.separator.ThreePhaseSeparator("2nd stage separator", - oilHeaterFromFirstStage.getOutStream()); + oilHeaterFromFirstStage.getOutletStream()); secondStageSeparator.addStream(LPwellStream); secondStageSeparator.run(); @@ -149,7 +149,7 @@ public void testProcess2() { ThreePhaseSeparator fourthStageSeparator = new neqsim.process.equipment.separator.ThreePhaseSeparator("4th stage separator", - oilThirdStageMixer.getOutStream()); + oilThirdStageMixer.getOutletStream()); fourthStageSeparator.run(); Cooler firstStageCooler = new neqsim.process.equipment.heatexchanger.Cooler("1st stage cooler", @@ -158,7 +158,7 @@ public void testProcess2() { firstStageCooler.run(); Separator firstStageScrubber = new neqsim.process.equipment.separator.Separator( - "1st stage scrubber", firstStageCooler.getOutStream()); + "1st stage scrubber", firstStageCooler.getOutletStream()); firstStageScrubber.run(); Pump firststagescrubberpump = new neqsim.process.equipment.pump.Pump("1st stage scrubber pump", @@ -184,7 +184,7 @@ public void testProcess2() { firstStageCooler2.run(); Separator firstStageScrubber2 = new neqsim.process.equipment.separator.Separator( - "1st stage scrubber2", firstStageCooler2.getOutStream()); + "1st stage scrubber2", firstStageCooler2.getOutletStream()); firstStageScrubber2.run(); Compressor firstStageCompressor2 = new neqsim.process.equipment.compressor.Compressor( @@ -200,7 +200,7 @@ public void testProcess2() { secondstagegasmixer.run(); Cooler secondStageCooler = new neqsim.process.equipment.heatexchanger.Cooler("2nd stage cooler", - secondstagegasmixer.getOutStream()); + secondstagegasmixer.getOutletStream()); secondStageCooler.setOutTemperature(29.0, "C"); secondStageCooler.run(); @@ -217,19 +217,19 @@ public void testProcess2() { Mixer richGasMixer = new neqsim.process.equipment.mixer.Mixer("fourth Stage mixer"); richGasMixer.addStream(firstStageSeparator.getGasOutStream()); - richGasMixer.addStream(secondStageCompressor.getOutStream()); + richGasMixer.addStream(secondStageCompressor.getOutletStream()); richGasMixer.run(); Cooler dewPointControlCooler = new neqsim.process.equipment.heatexchanger.Cooler( - "dew point cooler", richGasMixer.getOutStream()); + "dew point cooler", richGasMixer.getOutletStream()); dewPointControlCooler.setOutTemperature(29.0, "C"); dewPointControlCooler.run(); // dewPointControlCooler.getOutStream().getFluid().prettyPrint(); Assertions.assertEquals(0.9964199113579, - dewPointControlCooler.getOutStream().getFluid().getBeta(), 1e-6); + dewPointControlCooler.getOutletStream().getFluid().getBeta(), 1e-6); Separator dewPointScrubber = new neqsim.process.equipment.separator.Separator( - "dew point scrubber", dewPointControlCooler.getOutStream()); + "dew point scrubber", dewPointControlCooler.getOutletStream()); dewPointScrubber.run(); Cooler dewPointControlCooler2 = new neqsim.process.equipment.heatexchanger.Cooler( @@ -238,9 +238,9 @@ public void testProcess2() { dewPointControlCooler2.setOutPressure(59.5, "bara"); dewPointControlCooler2.run(); Assertions.assertEquals(0.96737504327, - dewPointControlCooler2.getOutStream().getFluid().getBeta(), 1e-6); + dewPointControlCooler2.getOutletStream().getFluid().getBeta(), 1e-6); Separator dewPointScrubber2 = new neqsim.process.equipment.separator.Separator( - "dew point scrubber 2", dewPointControlCooler2.getOutStream()); + "dew point scrubber 2", dewPointControlCooler2.getOutletStream()); dewPointScrubber2.run(); // dewPointScrubber2.getFluid().prettyPrint(); @@ -259,19 +259,19 @@ public void testProcess2() { lpLiqmixer.run(); Recycle hpResycle = new neqsim.process.equipment.util.Recycle("HP liq resycle"); - hpResycle.addStream(hpLiqmixer.getOutStream()); + hpResycle.addStream(hpLiqmixer.getOutletStream()); hpResycle.setOutletStream(oilFirstStage); hpResycle.setTolerance(1e-2); hpResycle.run(); Recycle mpResycle = new neqsim.process.equipment.util.Recycle("MP liq resycle"); - mpResycle.addStream(mpLiqmixer.getOutStream()); + mpResycle.addStream(mpLiqmixer.getOutletStream()); mpResycle.setOutletStream(oilSeccondStage); mpResycle.setTolerance(1e-2); mpResycle.run(); Recycle lpResycle = new neqsim.process.equipment.util.Recycle("LP liq resycle"); - lpResycle.addStream(lpLiqmixer.getOutStream()); + lpResycle.addStream(lpLiqmixer.getOutletStream()); lpResycle.setOutletStream(oilThirdStage); lpResycle.setTolerance(1e-2); lpResycle.run(); @@ -284,7 +284,7 @@ public void testProcess2() { // turboexpander.getFluid().prettyPrint(); Separator DPCUScrubber = new neqsim.process.equipment.separator.Separator("TEX LT scrubber", - turboexpander.getOutStream()); + turboexpander.getOutletStream()); DPCUScrubber.run(); // DPCUScrubber.getFluid().prettyPrint(); diff --git a/src/test/java/neqsim/thermo/system/SystemThermoTest.java b/src/test/java/neqsim/thermo/system/SystemThermoTest.java index bdc06ab4dd..ff131185c0 100644 --- a/src/test/java/neqsim/thermo/system/SystemThermoTest.java +++ b/src/test/java/neqsim/thermo/system/SystemThermoTest.java @@ -37,7 +37,8 @@ public static void setUp() { */ @Test public void testCp() { - neqsim.thermo.system.SystemPrEos testSystem = new neqsim.thermo.system.SystemPrEos(273.15 + 40.0, 1.0); + neqsim.thermo.system.SystemPrEos testSystem = + new neqsim.thermo.system.SystemPrEos(273.15 + 40.0, 1.0); testSystem.addComponent("methane", 10.01); testSystem.addTBPfraction("C20", 10.68, 0.3, 0.85); testSystem.setMixingRule("classic"); @@ -145,6 +146,7 @@ void TESTsetForceSinglePhase() { assertEquals(density, testSystem.getDensity("kg/m3"), 1e-4); } + @SuppressWarnings("deprecation") @Test void TestMixingRuleTypes() { EosMixingRuleType[] mrNum = EosMixingRuleType.values(); diff --git a/src/test/java/neqsim/thermo/system/SystemUMRPRUMCEosNewTest.java b/src/test/java/neqsim/thermo/system/SystemUMRPRUMCEosNewTest.java index d9fc540792..84c392a9d5 100644 --- a/src/test/java/neqsim/thermo/system/SystemUMRPRUMCEosNewTest.java +++ b/src/test/java/neqsim/thermo/system/SystemUMRPRUMCEosNewTest.java @@ -77,6 +77,7 @@ public void testFugasities() { * testCompressibility. *
*/ + @Disabled("No assertions") @Test @DisplayName("test compressibility of gas phase") public void testCompressibility() { @@ -90,7 +91,7 @@ public void testCompressibility() { testSystem.addComponent("ethane", 0.3); // testSystem.addComponent("n-heptane", 0.2); // testSystem.setMixingRule("HV", "UNIFAC_UMRPRU"); - testSystem.setMixingRule(0); + testSystem.setMixingRule(1); testSystem.init(0); // testSystem.init(1); testSystem.init(3); diff --git a/src/test/java/neqsim/thermo/util/example/BubbleFlash.java b/src/test/java/neqsim/thermo/util/example/BubbleFlash.java index 24378d71f1..86f066c2c2 100644 --- a/src/test/java/neqsim/thermo/util/example/BubbleFlash.java +++ b/src/test/java/neqsim/thermo/util/example/BubbleFlash.java @@ -39,8 +39,6 @@ public static void main(String args[]) { // testSystem.addComponent("MEG", 30); testSystem.createDatabase(true); - // 1- orginal no interaction 2- classic w interaction - // 3- Huron-Vidal 4- Wong-Sandler testSystem.setMixingRule(10); // testSystem.setMixingRule("HV", "UNIFAC_PSRK"); try { diff --git a/src/test/java/neqsim/thermo/util/example/DewPointCurve.java b/src/test/java/neqsim/thermo/util/example/DewPointCurve.java index f1dc3c1f61..73ab89ebde 100644 --- a/src/test/java/neqsim/thermo/util/example/DewPointCurve.java +++ b/src/test/java/neqsim/thermo/util/example/DewPointCurve.java @@ -60,8 +60,6 @@ public static void main(String args[]) { // testSystem.addComponent("n-heptane", 0.1757); testSystem.createDatabase(true); - // 1- orginal no interaction 2- classic w interaction - // 3- Huron-Vidal 4- Wong-Sandler testSystem.setMixingRule(2); // testSystem.setMixingRule("HV", "UNIFAC_PSRK"); testSystem.init(0); diff --git a/src/test/java/neqsim/thermo/util/example/PS_PH_flash.java b/src/test/java/neqsim/thermo/util/example/PS_PH_flash.java index d72248e6ec..7cc5a86855 100644 --- a/src/test/java/neqsim/thermo/util/example/PS_PH_flash.java +++ b/src/test/java/neqsim/thermo/util/example/PS_PH_flash.java @@ -54,8 +54,6 @@ public static void main(String args[]) { * testSystem.addComponent("n-butane", 3.53465e-1); // testSystem.addComponent("propane", 50); * //testSystem.addComponent("CO2", 50); //testSystem.addComponent("water", 20); */ - // 1- orginal no interaction 2- classic w interaction - // 3- Huron-Vidal 4- Wong-Sandler testSystem.createDatabase(true); testSystem.setMixingRule(2); testSystem.setMultiPhaseCheck(true); diff --git a/src/test/java/neqsim/thermo/util/example/PhaseEnvelope.java b/src/test/java/neqsim/thermo/util/example/PhaseEnvelope.java index 7e3636ac0c..0698eb57f4 100644 --- a/src/test/java/neqsim/thermo/util/example/PhaseEnvelope.java +++ b/src/test/java/neqsim/thermo/util/example/PhaseEnvelope.java @@ -96,8 +96,6 @@ public static void main(String args[]) { testSystem.setMixingRule("HV", "UNIFAC_UMRPRU"); // testSystem.setMultiPhaseCheck(true); - // 1- orginal no interaction 2- classic w interaction - // 3- Huron-Vidal 4- Wong-Sandler // testSystem.setMixingRule(2); //"UNIFAC_UMRPRU"); // testSystem.setHydrateCheck(true); // testSystem.setBmixType(0); diff --git a/src/test/java/neqsim/thermo/util/example/TPMultiFlash.java b/src/test/java/neqsim/thermo/util/example/TPMultiFlash.java index be6388b382..8d2ebe5101 100644 --- a/src/test/java/neqsim/thermo/util/example/TPMultiFlash.java +++ b/src/test/java/neqsim/thermo/util/example/TPMultiFlash.java @@ -78,8 +78,6 @@ public static void main(String[] args) { // System.out.println("activity water " + // testSystem.getPhase(1).getActivityCoefficient(2)); - // 1- orginal no interaction 2- classic w interaction - // 3- Huron-Vidal 4- Wong-Sandler // testSystem.setMixingRule(1); try { diff --git a/src/test/java/neqsim/thermo/util/example/TPflashMembrane.java b/src/test/java/neqsim/thermo/util/example/TPflashMembrane.java index de72895b52..d25bdef748 100644 --- a/src/test/java/neqsim/thermo/util/example/TPflashMembrane.java +++ b/src/test/java/neqsim/thermo/util/example/TPflashMembrane.java @@ -44,8 +44,6 @@ public static void main(String args[]) { testSystem.addComponent("propane", 100.0, 1); testSystem.createDatabase(true); - // 1- orginal no interaction 2- classic w interaction - // 3- Huron-Vidal 4- Wong-Sandler testSystem.setMixingRule(2); testSystem.init_x_y(); diff --git a/src/test/java/neqsim/thermo/util/example/TestGERGwater.java b/src/test/java/neqsim/thermo/util/example/TestGERGwater.java index 61c049f57d..97f5cf8678 100644 --- a/src/test/java/neqsim/thermo/util/example/TestGERGwater.java +++ b/src/test/java/neqsim/thermo/util/example/TestGERGwater.java @@ -44,8 +44,6 @@ public static void main(String args[]) { testSystem.addComponent("water", 178.3e-4); testSystem.createDatabase(true); - // 1- orginal no interaction 2- classic w interaction - // 3- Huron-Vidal 4- Wong-Sandler testSystem.setMixingRule(7); // testSystem.setMixingRule("HV", "UNIFAC_PSRK"); testSystem.init(0); diff --git a/src/test/java/neqsim/thermo/util/example/TestPSRK.java b/src/test/java/neqsim/thermo/util/example/TestPSRK.java index f0d65f443b..b250adcc86 100644 --- a/src/test/java/neqsim/thermo/util/example/TestPSRK.java +++ b/src/test/java/neqsim/thermo/util/example/TestPSRK.java @@ -54,7 +54,7 @@ public static void main(String args[]) { // testSystem.setMixingRule(1); // testSystem.set testSystem.setMixingRule("HV", "UNIFAC_PSRK"); - // testSystem.setMixingRule("WS","UNIFAC_PSRK"); + // testSystem.setMixingRule("WS", "UNIFAC_PSRK"); testSystem.init(0); testSystem.init(2); diff --git a/src/test/java/neqsim/thermodynamicoperations/ThermodynamicOperationsTest.java b/src/test/java/neqsim/thermodynamicoperations/ThermodynamicOperationsTest.java index 6b31360aad..6731eaf406 100644 --- a/src/test/java/neqsim/thermodynamicoperations/ThermodynamicOperationsTest.java +++ b/src/test/java/neqsim/thermodynamicoperations/ThermodynamicOperationsTest.java @@ -56,11 +56,12 @@ void testFlash() { @Test void testFluidDefined() { - double[] fractions = new double[] { 98.0, 2.0 }; - List