diff --git a/src/main/java/neqsim/thermo/characterization/LumpingModel.java b/src/main/java/neqsim/thermo/characterization/LumpingModel.java index 73f6e0d21..6d2cb4644 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 cc4fc0980..4446f7e12 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 3d533969b..d1a93df2c 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 744b87844..acf55c266 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 4177e7a5d..6a5e8cdc3 100644 --- a/src/main/java/neqsim/thermo/mixingrule/CPAMixingRules.java +++ b/src/main/java/neqsim/thermo/mixingrule/CPAMixingRules.java @@ -76,56 +76,56 @@ public double calcXi(int siteNumber, int compnumb, PhaseInterface phase, double return 1.0; } - /** {@inheritdoc} */ + /** {@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} */ + /** {@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} */ + /** {@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} */ + /** {@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} */ + /** {@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} */ + /** {@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} */ + /** {@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} */ + /** {@inheritDoc} */ @Override public double calcDeltadTdV(int siteNumber1, int siteNumber2, int compnumb1, int compnumb2, PhaseInterface phase, double temperature, double pressure, int numbcomp) { @@ -137,7 +137,7 @@ public class CPA_Radoch extends CPA_Radoch_base { /** Serialization version UID. */ private static final long serialVersionUID = 1000; - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public String getName() { return mixingRuleName; @@ -171,7 +171,7 @@ public double getCrossAssociationVolume(int compnumb1, int compnumb2, PhaseInter * phase.getComponent(compnumb2).getAssociationVolume()); } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcDelta(int siteNumber1, int siteNumber2, int compnumb1, int compnumb2, PhaseInterface phase, double temperature, double pressure, int numbcomp) { @@ -248,7 +248,7 @@ public double calcDelta(int compnumb1, int compnumb2, PhaseInterface phase, doub * ((PhaseCPAInterface) phase).getGcpa(); } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcDeltaNog(int siteNumber1, int siteNumber2, int compnumb1, int compnumb2, PhaseInterface phase, double temperature, double pressure, int numbcomp) { @@ -285,7 +285,7 @@ public double calcDeltaNog(int siteNumber1, int siteNumber2, int compnumb1, int * getCrossAssociationVolume(compnumb1, compnumb2, phase, temperature, pressure, numbcomp); } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcDeltadN(int derivativeComp, int siteNumber1, int siteNumber2, int compnumb1, int compnumb2, PhaseInterface phase, double temperature, double pressure, int numbcomp) { @@ -295,7 +295,7 @@ public double calcDeltadN(int derivativeComp, int siteNumber1, int siteNumber2, * ((ComponentSrkCPA) phase.getComponent(derivativeComp)).calc_lngi(phase); } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcDeltadT(int siteNumber1, int siteNumber2, int compnumb1, int compnumb2, PhaseInterface phase, double temperature, double pressure, int numbcomp) { @@ -358,7 +358,7 @@ public double calcDeltadT(int siteNumber1, int siteNumber2, int compnumb1, int c * ((PhaseCPAInterface) phase).getGcpa(); } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcDeltadV(int siteNumber1, int siteNumber2, int compnumb1, int compnumb2, PhaseInterface phase, double temperature, double pressure, int numbcomp) { @@ -368,7 +368,7 @@ public double calcDeltadV(int siteNumber1, int siteNumber2, int compnumb1, int c * ((PhaseCPAInterface) phase).getGcpav(); } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcDeltadTdV(int siteNumber1, int siteNumber2, int compnumb1, int compnumb2, PhaseInterface phase, double temperature, double pressure, int numbcomp) { @@ -403,7 +403,7 @@ public double calcDeltadTdV(int siteNumber1, int siteNumber2, int compnumb1, int * ((PhaseCPAInterface) phase).getGcpa() * ((PhaseCPAInterface) phase).getGcpav(); } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcDeltadTdT(int siteNumber1, int siteNumber2, int compnumb1, int compnumb2, PhaseInterface phase, double temperature, double pressure, int numbcomp) { @@ -585,7 +585,7 @@ public double getCrossAssociationVolume(int siteNumber1, int siteNumber2, int co * phase.getComponent(compnumb2).getAssociationVolumeSAFT()) * extrwterm; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcDelta(int siteNumber1, int siteNumber2, int compnumb1, int compnumb2, PhaseInterface phase, double temperature, double pressure, int numbcomp) { diff --git a/src/main/java/neqsim/thermo/mixingrule/EosMixingRules.java b/src/main/java/neqsim/thermo/mixingrule/EosMixingRules.java index 136a2d40a..1ea4f0cf7 100644 --- a/src/main/java/neqsim/thermo/mixingrule/EosMixingRules.java +++ b/src/main/java/neqsim/thermo/mixingrule/EosMixingRules.java @@ -112,25 +112,25 @@ public class ClassicVdW implements EosMixingRulesInterface { /** Serialization version UID. */ private static final long serialVersionUID = 1000; - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public String getName() { return mixingRuleName; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public PhaseInterface getGEPhase() { return null; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public void setMixingRuleGEModel(java.lang.String GEmodel) { mixingRuleGEModel = GEmodel; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double getBinaryInteractionParameter(int i, int j) { if (i == j) { @@ -139,7 +139,7 @@ public double getBinaryInteractionParameter(int i, int j) { return intparam[i][j]; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double[][] getBinaryInteractionParameters() { return intparam; @@ -147,7 +147,7 @@ public double[][] getBinaryInteractionParameters() { public void prettyPrintKij() {} - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double getBinaryInteractionParameterT1(int i, int j) { if (i == j) { @@ -192,7 +192,7 @@ public double getbij(ComponentEosInterface compi, ComponentEosInterface compj) { } } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public void setBinaryInteractionParameter(int i, int j, double value) { // System.out.println("intparam: " + intparam[i][j] + " value " + value); @@ -200,14 +200,14 @@ public void setBinaryInteractionParameter(int i, int j, double value) { intparam[j][i] = value; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public void setBinaryInteractionParameterij(int i, int j, double value) { intparamij[i][j] = value; intparamji[j][i] = value; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public void setBinaryInteractionParameterji(int i, int j, double value) { // System.out.println("intparam: " + intparam[i][j] + " value " + value); @@ -215,7 +215,7 @@ public void setBinaryInteractionParameterji(int i, int j, double value) { intparamij[j][i] = value; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public void setBinaryInteractionParameterT1(int i, int j, double value) { // System.out.println("intparam: " + intparam[i][j] + " value " + value); @@ -233,7 +233,7 @@ public void setCalcEOSInteractionParameters(boolean CalcEOSInteractionParameters calcEOSInteractionParameters = CalcEOSInteractionParameters2; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public void setnEOSkij(double n) { nEOSkij = n; @@ -247,7 +247,7 @@ public double getB() { return Btot; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcA(PhaseInterface phase, double temperature, double pressure, int numbcomp) { double aij = 0.0; @@ -265,7 +265,7 @@ public double calcA(PhaseInterface phase, double temperature, double pressure, i return A; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcB(PhaseInterface phase, double temperature, double pressure, int numbcomp) { B = 0.0; @@ -282,7 +282,7 @@ public double calcB(PhaseInterface phase, double temperature, double pressure, i return B; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcAi(int compNumb, PhaseInterface phase, double temperature, double pressure, int numbcomp) { @@ -298,7 +298,7 @@ public double calcAi(int compNumb, PhaseInterface phase, double temperature, dou return 2.0 * Ai; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcBi(int compNumb, PhaseInterface phase, double temperature, double pressure, int numbcomp) { @@ -332,7 +332,7 @@ public double calcBi2(int compNumb, PhaseInterface phase, double temperature, do return ans1 / (phase.getNumberOfMolesInPhase() * phase.getNumberOfMolesInPhase()); } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcBij(int compNumb, int compNumbj, PhaseInterface phase, double temperature, double pressure, int numbcomp) { @@ -344,7 +344,7 @@ public double calcBij(int compNumb, int compNumbj, PhaseInterface phase, double / phase.getNumberOfMolesInPhase(); } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcAiT(int compNumb, PhaseInterface phase, double temperature, double pressure, int numbcomp) { @@ -362,7 +362,7 @@ public double calcAiT(int compNumb, PhaseInterface phase, double temperature, do return 2.0 * A; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcAij(int compNumb, int compNumbj, PhaseInterface phase, double temperature, double pressure, int numbcomp) { @@ -374,7 +374,7 @@ public double calcAij(int compNumb, int compNumbj, PhaseInterface phase, double return 2.0 * aij; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcAT(PhaseInterface phase, double temperature, double pressure, int numbcomp) { double A = 0.0; @@ -388,7 +388,7 @@ public double calcAT(PhaseInterface phase, double temperature, double pressure, return 0.5 * A; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcATT(PhaseInterface phase, double temperature, double pressure, int numbcomp) { double aij = 0; @@ -413,7 +413,7 @@ public double calcATT(PhaseInterface phase, double temperature, double pressure, return A; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public ClassicVdW clone() { ClassicVdW clonedSystem = null; @@ -436,7 +436,7 @@ public double getkij(double temp, int i, int j) { return intparam[i][j]; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcA(PhaseInterface phase, double temperature, double pressure, int numbcomp) { double aij = 0; @@ -528,7 +528,7 @@ public double calcAiT(int compNumb, PhaseInterface phase, double temperature, do return 2.0 * A; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcAij(int compNumb, int compNumbj, PhaseInterface phase, double temperature, double pressure, int numbcomp) { @@ -539,7 +539,7 @@ public double calcAij(int compNumb, int compNumbj, PhaseInterface phase, double return 2.0 * aij; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcAT(PhaseInterface phase, double temperature, double pressure, int numbcomp) { double A = 0.0; @@ -554,7 +554,7 @@ public double calcAT(PhaseInterface phase, double temperature, double pressure, return 0.5 * A; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcATT(PhaseInterface phase, double temperature, double pressure, int numbcomp) { double aij = 0; @@ -591,7 +591,7 @@ public double calcATT(PhaseInterface phase, double temperature, double pressure, return A; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public ClassicSRK clone() { ClassicSRK clonedSystem = null; @@ -610,7 +610,7 @@ public class ClassicSRKT extends ClassicSRK { /** Serialization version UID. */ private static final long serialVersionUID = 1000; - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double getkij(double temperature, int i, int j) { return intparam[i][j] + intparamT[i][j] * (temperature / 273.15 - 1.0); @@ -626,7 +626,7 @@ public double getkijdTdT(double temperature, int i, int j) { return 0.0; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcAiT(int compNumb, PhaseInterface phase, double temperature, double pressure, int numbcomp) { @@ -668,7 +668,7 @@ public double calcAiTT(int compNumb, PhaseInterface phase, double temperature, d return 2.0 * A; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcATT(PhaseInterface phase, double temperature, double pressure, int numbcomp) { double aij = 0.0; @@ -709,7 +709,7 @@ public double calcATT(PhaseInterface phase, double temperature, double pressure, return A; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public ClassicSRKT clone() { ClassicSRKT clonedSystem = null; @@ -819,7 +819,7 @@ public double getkijdndn(int k, int l, PhaseInterface phase, double temperature, return temp; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcA(PhaseInterface phase, double temperature, double pressure, int numbcomp) { double aij = 0; @@ -847,7 +847,7 @@ public double calcA(PhaseInterface phase, double temperature, double pressure, i return A; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcAi(int compNumb, PhaseInterface phase, double temperature, double pressure, int numbcomp) { @@ -887,7 +887,7 @@ public double calcAi(int compNumb, PhaseInterface phase, double temperature, dou return 2.0 * A1 + A2; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcAij(int compNumb, int compNumbj, PhaseInterface phase, double temperature, double pressure, int numbcomp) { @@ -935,7 +935,7 @@ public double calcAij(int compNumb, int compNumbj, PhaseInterface phase, double return A1 + A2 + A4; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcAiT(int compNumb, PhaseInterface phase, double temperature, double pressure, int numbcomp) { @@ -988,7 +988,7 @@ public class ClassicSRKT2 extends ClassicSRKT { /** Serialization version UID. */ private static final long serialVersionUID = 1000; - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double getkij(double temperature, int i, int j) { if (intparamTType[i][j] == 0) { @@ -1000,7 +1000,7 @@ public double getkij(double temperature, int i, int j) { } } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double getkijdT(double temperature, int i, int j) { if (intparamTType[i][j] == 0) { @@ -1012,7 +1012,7 @@ public double getkijdT(double temperature, int i, int j) { } } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double getkijdTdT(double temperature, int i, int j) { if (intparamTType[i][j] == 0) { @@ -1024,7 +1024,7 @@ public double getkijdTdT(double temperature, int i, int j) { } } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public ClassicSRKT clone() { ClassicSRKT clonedSystem = null; @@ -1075,7 +1075,7 @@ public SRKHuronVidal(PhaseInterface phase, double[][] HValpha, double[][] HVDij, gePhase.setProperties(phase); } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public void setHVDijParameter(int i, int j, double value) { HVDij[i][j] = value; @@ -1084,13 +1084,13 @@ public void setHVDijParameter(int i, int j, double value) { gePhase.setDij(HVDij); } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double getHVDijParameter(int i, int j) { return HVDij[i][j]; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public void setHVDijTParameter(int i, int j, double value) { HVDijT[i][j] = value; @@ -1098,13 +1098,13 @@ public void setHVDijTParameter(int i, int j, double value) { gePhase.setDijT(HVDijT); } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double getHVDijTParameter(int i, int j) { return HVDijT[i][j]; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public void setHValphaParameter(int i, int j, double value) { HValpha[i][j] = value; @@ -1112,26 +1112,26 @@ public void setHValphaParameter(int i, int j, double value) { gePhase.setAlpha(HValpha); } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double getHValphaParameter(int i, int j) { return HValpha[i][j]; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double getKijWongSandler(int i, int j) { return WSintparam[i][j]; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public void setKijWongSandler(int i, int j, double value) { WSintparam[i][j] = value; WSintparam[j][i] = value; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcA(PhaseInterface phase, double temperature, double pressure, int numbcomp) { double A = 0.0; @@ -1151,7 +1151,7 @@ public double calcA(PhaseInterface phase, double temperature, double pressure, i return A; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcAi(int compNumb, PhaseInterface phase, double temperature, double pressure, int numbcomp) { @@ -1167,7 +1167,7 @@ public double calcAi(int compNumb, PhaseInterface phase, double temperature, dou return A; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcAiT(int compNumb, PhaseInterface phase, double temperature, double pressure, int numbcomp) { @@ -1191,7 +1191,7 @@ public double calcAiT(int compNumb, PhaseInterface phase, double temperature, do return A; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcAT(PhaseInterface phase, double temperature, double pressure, int numbcomp) { double A = 0; @@ -1213,7 +1213,7 @@ public double calcAT(PhaseInterface phase, double temperature, double pressure, return A; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcAij(int compNumb, int compNumbj, PhaseInterface phase, double temperature, double pressure, int numbcomp) { @@ -1448,39 +1448,39 @@ public void init(PhaseInterface phase, double temperature, double pressure, int } } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public PhaseInterface getGEPhase() { return gePhase; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public void setHVDijParameter(int i, int j, double value) { HVDij[i][j] = value; gePhase.setDij(HVDij); } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double getHVDijParameter(int i, int j) { return HVDij[i][j]; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public void setHVDijTParameter(int i, int j, double value) { HVDijT[i][j] = value; gePhase.setDijT(HVDijT); } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double getHVDijTParameter(int i, int j) { return HVDijT[i][j]; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public void setHValphaParameter(int i, int j, double value) { HValpha[i][j] = value; @@ -1488,26 +1488,26 @@ public void setHValphaParameter(int i, int j, double value) { gePhase.setAlpha(HValpha); } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double getHValphaParameter(int i, int j) { return HValpha[i][j]; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double getKijWongSandler(int i, int j) { return WSintparam[i][j]; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public void setKijWongSandler(int i, int j, double value) { WSintparam[i][j] = value; WSintparam[j][i] = value; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcA(PhaseInterface phase, double temperature, double pressure, int numbcomp) { double A = 0.0; @@ -1521,7 +1521,7 @@ public double calcA(PhaseInterface phase, double temperature, double pressure, i return A; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcAi(int compNumb, PhaseInterface phase, double temperature, double pressure, int numbcomp) { @@ -1540,7 +1540,7 @@ public double calcAi(int compNumb, PhaseInterface phase, double temperature, dou return A; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcAij(int compNumb, int compNumbj, PhaseInterface phase, double temperature, double pressure, int numbcomp) { @@ -1558,7 +1558,7 @@ public double calcAij(int compNumb, int compNumbj, PhaseInterface phase, double return A; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcAT(PhaseInterface phase, double temperature, double pressure, int numbcomp) { double A = 0.0; @@ -1571,7 +1571,7 @@ public double calcAT(PhaseInterface phase, double temperature, double pressure, return A; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcATT(PhaseInterface phase, double temperature, double pressure, int numbcomp) { double A = 0.0; @@ -1583,7 +1583,7 @@ public double calcATT(PhaseInterface phase, double temperature, double pressure, return A; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcAiT(int compNumb, PhaseInterface phase, double temperature, double pressure, int numbcomp) { @@ -1680,7 +1680,7 @@ public WongSandlerMixingRule(PhaseInterface phase, double[][] WSalpha, double[][ super(phase, WSalpha, WSDij, WSDijT, mixRule); } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public void init(PhaseInterface phase, double temperature, double pressure, int numbcomp) { ComponentEosInterface[] compArray = (ComponentEosInterface[]) phase.getcomponentArray(); @@ -1842,7 +1842,7 @@ public void init(PhaseInterface phase, double temperature, double pressure, int } } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcA(PhaseInterface phase, double temperature, double pressure, int numbcomp) { double A = 0; @@ -1854,7 +1854,7 @@ public double calcA(PhaseInterface phase, double temperature, double pressure, i return A; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcAi(int compNumb, PhaseInterface phase, double temperature, double pressure, int numbcomp) { @@ -1870,7 +1870,7 @@ public double calcAi(int compNumb, PhaseInterface phase, double temperature, dou return A; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcAT(PhaseInterface phase, double temperature, double pressure, int numbcomp) { double A = 0; @@ -1885,7 +1885,7 @@ public double calcAT(PhaseInterface phase, double temperature, double pressure, return A; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcATT(PhaseInterface phase, double temperature, double pressure, int numbcomp) { double A = 0; @@ -1903,7 +1903,7 @@ public double calcATT(PhaseInterface phase, double temperature, double pressure, return A; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcAiT(int compNumb, PhaseInterface phase, double temperature, double pressure, int numbcomp) { @@ -1923,7 +1923,7 @@ public double calcAiT(int compNumb, PhaseInterface phase, double temperature, do return A; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcAij(int compNumb, int compNumbj, PhaseInterface phase, double temperature, double pressure, int numbcomp) { @@ -1946,7 +1946,7 @@ public double calcAij(int compNumb, int compNumbj, PhaseInterface phase, double return A; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcB(PhaseInterface phase, double temperature, double pressure, int numbcomp) { double B = b_mix * phase.getNumberOfMolesInPhase(); @@ -1954,7 +1954,7 @@ public double calcB(PhaseInterface phase, double temperature, double pressure, i return B; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcBi(int compNumb, PhaseInterface phase, double temperature, double pressure, int numbcomp) { @@ -1977,7 +1977,7 @@ public double calcBiT(int compNumb, PhaseInterface phase, double temperature, do return bit; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcBij(int compNumb, int compNumbj, PhaseInterface phase, double temperature, double pressure, int numbcomp) { @@ -1990,7 +1990,7 @@ public class ElectrolyteMixRule implements ElectrolyteMixingRulesInterface { /** Serialization version UID. */ private static final long serialVersionUID = 1000; - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public String getName() { return mixingRuleName; @@ -2000,7 +2000,7 @@ public ElectrolyteMixRule(PhaseInterface phase) { calcWij(phase); } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public void calcWij(PhaseInterface phase) { ComponentEosInterface[] compArray = (ComponentEosInterface[]) phase.getcomponentArray(); @@ -2040,14 +2040,14 @@ public void calcWij(PhaseInterface phase) { } } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcWij(int compNumbi, int compNumj, PhaseInterface phase, double temperature, double pressure, int numbcomp) { return -2.0 * getWij(compNumbi, compNumj, temperature); // iwij[0][compNumbi][compNumj]; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public void setWijParameter(int i, int j, double value) { // System.out.println("intparam: " + value); @@ -2055,53 +2055,53 @@ public void setWijParameter(int i, int j, double value) { wij[0][j][i] = value; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double getWijParameter(int i, int j) { return wij[0][i][j]; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public void setWijT1Parameter(int i, int j, double value) { wij[1][i][j] = value; wij[1][j][i] = value; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double gettWijT1Parameter(int i, int j) { return wij[1][i][j]; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public void setWijT2Parameter(int i, int j, double value) { wij[2][i][j] = value; wij[2][j][i] = value; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double gettWijT2Parameter(int i, int j) { return wij[2][i][j]; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double getWij(int i, int j, double temperature) { return wij[0][i][j] + wij[1][i][j] * (1.0 / temperature - 1.0 / 298.15) + wij[2][i][j] * ((298.15 - temperature) / temperature + Math.log(temperature / 298.15)); } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double getWijT(int i, int j, double temperature) { return (-wij[1][i][j] / (temperature * temperature) - wij[2][i][j] * (298.15 - temperature) / (temperature * temperature)); } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double getWijTT(int i, int j, double temperature) { return (2.0 * wij[1][i][j] / (temperature * temperature * temperature) @@ -2109,7 +2109,7 @@ public double getWijTT(int i, int j, double temperature) { / (temperature * temperature * temperature)); } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcW(PhaseInterface phase, double temperature, double pressure, int numbcomp) { ComponentEosInterface[] compArray = (ComponentEosInterface[]) phase.getcomponentArray(); @@ -2123,7 +2123,7 @@ public double calcW(PhaseInterface phase, double temperature, double pressure, i return -W; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcWi(int compNumb, PhaseInterface phase, double temperature, double pressure, int numbcomp) { @@ -2136,7 +2136,7 @@ public double calcWi(int compNumb, PhaseInterface phase, double temperature, dou return -2.0 * Wi; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcWiT(int compNumb, PhaseInterface phase, double temperature, double pressure, int numbcomp) { @@ -2148,7 +2148,7 @@ public double calcWiT(int compNumb, PhaseInterface phase, double temperature, do return -2.0 * WiT; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcWT(PhaseInterface phase, double temperature, double pressure, int numbcomp) { ComponentEosInterface[] compArray = (ComponentEosInterface[]) phase.getcomponentArray(); @@ -2163,7 +2163,7 @@ public double calcWT(PhaseInterface phase, double temperature, double pressure, return -WT; } - /** {@inheritdoc} */ + /** {@inheritDoc} */ @Override public double calcWTT(PhaseInterface phase, double temperature, double pressure, int numbcomp) { ComponentEosInterface[] compArray = (ComponentEosInterface[]) phase.getcomponentArray(); diff --git a/src/test/java/neqsim/thermo/system/SystemThermoNameTagTest.java b/src/test/java/neqsim/thermo/system/SystemThermoNameTagTest.java new file mode 100644 index 000000000..c0e94fddd --- /dev/null +++ b/src/test/java/neqsim/thermo/system/SystemThermoNameTagTest.java @@ -0,0 +1,47 @@ +package neqsim.thermo.system; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import neqsim.thermodynamicoperations.ThermodynamicOperations; + +public class SystemThermoNameTagTest { + static neqsim.thermo.system.SystemInterface testSystem = null; + + /** + *

+ * setUp. + *

+ */ + @BeforeAll + public static void setUp() { + testSystem = new neqsim.thermo.system.SystemPrEos(298.0, 10.0); + testSystem.addComponent("nitrogen", 0.01); + testSystem.addComponent("CO2", 0.01); + testSystem.addComponent("methane", 0.68); + testSystem.setMixingRule("classic"); + ThermodynamicOperations testOps = new ThermodynamicOperations(testSystem); + testOps.TPflash(); + testSystem.initProperties(); + } + + @Test + public void SetNameTag() { + String[] a = testSystem.getCompNames(); + String[] b = testSystem.getComponentNames(); + assertArrayEquals(a, b); + + SystemInterface tmpSystem = testSystem.clone(); + tmpSystem.setFluidName(null); + String[] c = tmpSystem.getCompNames(); + assertArrayEquals(a, c); + + String suffix = "test"; + tmpSystem.setComponentNameTag(suffix); + String[] c2 = tmpSystem.getCompNames(); + for (String str : c2) { + assertTrue(str.endsWith(suffix)); + } + } +} diff --git a/src/test/java/neqsim/thermodynamicoperations/ThermodynamicOperationsTest.java b/src/test/java/neqsim/thermodynamicoperations/ThermodynamicOperationsTest.java index 6b31360aa..6731eaf40 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 Sp1 = Arrays.asList(new Double[] { 22.1, 23.2, 24.23, 25.98, 25.23, 26.1, 27.3, 28.7, 23.5, 22.7 }); + double[] fractions = new double[] {98.0, 2.0}; + List Sp1 = + Arrays.asList(new Double[] {22.1, 23.2, 24.23, 25.98, 25.23, 26.1, 27.3, 28.7, 23.5, 22.7}); List Sp2 = Arrays.asList( - new Double[] { 288.1, 290.1, 295.1, 301.2, 299.3, 310.2, 315.3, 310.0, 305.2, 312.7 }); - List components = Arrays.asList(new String[] { "O2", "N2" }); + new Double[] {288.1, 290.1, 295.1, 301.2, 299.3, 310.2, 315.3, 310.0, 305.2, 312.7}); + List components = Arrays.asList(new String[] {"O2", "N2"}); List> onlineFractions = new ArrayList>(); for (double d : fractions) { @@ -135,9 +136,10 @@ void testNeqSimPython() { thermoSystem.addComponent("ethane", 0.3); thermoSystem.init(0); - ThermodynamicOperations thermoOps = new neqsim.thermodynamicoperations.ThermodynamicOperations(thermoSystem); - List jP = Arrays.asList(new Double[] { 10.0 }); - List jT = Arrays.asList(new Double[] { 280.0 }); + ThermodynamicOperations thermoOps = + new neqsim.thermodynamicoperations.ThermodynamicOperations(thermoSystem); + List jP = Arrays.asList(new Double[] {10.0}); + List jT = Arrays.asList(new Double[] {280.0}); CalculationResult res = thermoOps.propertyFlash(jP, jT, 1, null, null); // Verify some basic properties @@ -158,29 +160,32 @@ void testNeqSimPython() { Assertions.assertEquals(res2.hashCode(), res2.hashCode()); Assertions.assertFalse(res2 == res); - CalculationResult res2_copy = new CalculationResult(res2.fluidProperties, res2.calculationError); + CalculationResult res2_copy = + new CalculationResult(res2.fluidProperties, res2.calculationError); Assertions.assertEquals(res2, res2_copy); } @Test void testNeqSimPython2() { - String[] components = new String[] { "H2O", "N2", "CO2", "C1", "C2", "C3", "iC4", "nC4", "iC5", "nC5", "C6" }; - double[] fractions = new double[] { 0.0003, 1.299, 0.419, 94.990, 2.399, 0.355, 0.172, 0.088, - 0.076, 0.036, 0.1656 }; + String[] components = + new String[] {"H2O", "N2", "CO2", "C1", "C2", "C3", "iC4", "nC4", "iC5", "nC5", "C6"}; + double[] fractions = new double[] {0.0003, 1.299, 0.419, 94.990, 2.399, 0.355, 0.172, 0.088, + 0.076, 0.036, 0.1656}; - double[] fractions2 = new double[] { 0.0003, 2.299, 0.419, 93.990, 2.399, 0.355, 0.172, 0.088, - 0.076, 0.036, 0.1656 }; + double[] fractions2 = new double[] {0.0003, 2.299, 0.419, 93.990, 2.399, 0.355, 0.172, 0.088, + 0.076, 0.036, 0.1656}; SystemInterface thermoSystem = new neqsim.thermo.system.SystemSrkEos(100 + 273.15, 60.0); thermoSystem.addComponents(components, fractions); thermoSystem.init(0); - ThermodynamicOperations thermoOps = new neqsim.thermodynamicoperations.ThermodynamicOperations(thermoSystem); + ThermodynamicOperations thermoOps = + new neqsim.thermodynamicoperations.ThermodynamicOperations(thermoSystem); double temp = 373.15; double press = 60.0 + ThermodynamicConstantsInterface.referencePressure; - List jP = Arrays.asList(new Double[] { press }); - List jT = Arrays.asList(new Double[] { temp }); + List jP = Arrays.asList(new Double[] {press}); + List jT = Arrays.asList(new Double[] {temp}); CalculationResult res = thermoOps.propertyFlash(jP, jT, 1, null, null); // Assert no calculation failed for (String errorMessage : res.calculationError) { @@ -207,13 +212,15 @@ void testNeqSimPython2() { Assertions.assertArrayEquals(res.fluidProperties[0], res1.fluidProperties[0]); int numFrac = 3; - List> onlineFractions2 = createDummyRequest(thermoSystem.getMolarComposition(), numFrac); + List> onlineFractions2 = + createDummyRequest(thermoSystem.getMolarComposition(), numFrac); - List jP2 = Arrays.asList(new Double[] { press, press }); - List jT2 = Arrays.asList(new Double[] { temp, temp }); + List jP2 = Arrays.asList(new Double[] {press, press}); + List jT2 = Arrays.asList(new Double[] {temp, temp}); SystemInterface thermoSystem2 = new neqsim.thermo.system.SystemSrkEos(273.15, 0.0); thermoSystem2.addComponents(components, fractions2); - ThermodynamicOperations thermoOps2 = new neqsim.thermodynamicoperations.ThermodynamicOperations(thermoSystem2); + ThermodynamicOperations thermoOps2 = + new neqsim.thermodynamicoperations.ThermodynamicOperations(thermoSystem2); CalculationResult res2 = thermoOps2.propertyFlash(jP2, jT2, 1, null, onlineFractions2); // Assert no calculation failed for (String errorMessage : res.calculationError) { @@ -264,10 +271,10 @@ void testComponentNames() { void testPropertyFlash() { SystemInterface fluid = new SystemSrkEos(273.15 + 45.0, 22.0); - List Sp1 = Arrays.asList(new Double[] { 100000.0, 1000000.0, 10000000.0, 20000000.0, - 100000.0, 1000000.0, 10000000.0, 20000000.0, 100000.0, 1000000.0, 10000000.0, 20000000.0 }); - List Sp2 = Arrays.asList(new Double[] { 288.15, 288.15, 288.15, 288.15, 303.15, 303.15, - 303.15, 303.15, 423.15, 423.15, 423.15, 423.15 }); + List Sp1 = Arrays.asList(new Double[] {100000.0, 1000000.0, 10000000.0, 20000000.0, + 100000.0, 1000000.0, 10000000.0, 20000000.0, 100000.0, 1000000.0, 10000000.0, 20000000.0}); + List Sp2 = Arrays.asList(new Double[] {288.15, 288.15, 288.15, 288.15, 303.15, 303.15, + 303.15, 303.15, 423.15, 423.15, 423.15, 423.15}); fluid.addComponent("water", 0.01); fluid.addComponent("nitrogen", 0.02); @@ -281,7 +288,7 @@ void testPropertyFlash() { fluid.addComponent("n-pentane", 0.01); fluid.addComponent("n-hexane", 0.01); fluid.setMolarComposition( - new double[] { 0.054, 0.454, 1.514, 89.92, 5.324, 1.535, 0.232, 0.329, 0.094, 0.107, 0.437 }); + new double[] {0.054, 0.454, 1.514, 89.92, 5.324, 1.535, 0.232, 0.329, 0.094, 0.107, 0.437}); ThermodynamicOperations ops = new ThermodynamicOperations(fluid); CalculationResult s = ops.propertyFlash(Sp1, Sp2, 1, null, null); @@ -297,8 +304,8 @@ void testPropertyFlash() { @Test void testpropertyFlashOnline() { - String[] components = { "nitrogen", "oxygen" }; - double[] fractions = { 0.79, 0.21 }; + String[] components = {"nitrogen", "oxygen"}; + double[] fractions = {0.79, 0.21}; int len = 10; List> onlineFractions = createDummyRequest(fractions, len); @@ -308,8 +315,8 @@ void testpropertyFlashOnline() { // fluid.setTotalFlowRate(1, "mole/sec"); // fluid.init(0); - Double[] pressure = { 1.0, 1.5, 2.0, 2.5, 3.0, 4.0, 4.0, 3.5, 3.0, 2.5 }; - Double[] temperature = { 301.0, 301.5, 302.0, 302.5, 303.0, 304.0, 304.0, 303.5, 303.0, 302.5 }; + Double[] pressure = {1.0, 1.5, 2.0, 2.5, 3.0, 4.0, 4.0, 3.5, 3.0, 2.5}; + Double[] temperature = {301.0, 301.5, 302.0, 302.5, 303.0, 304.0, 304.0, 303.5, 303.0, 302.5}; ThermodynamicOperations ops = new ThermodynamicOperations(fluid); CalculationResult s = ops.propertyFlash(Arrays.asList(pressure), Arrays.asList(temperature), 1, @@ -319,8 +326,8 @@ void testpropertyFlashOnline() { @Test void testpropertyFlashOnlineSingle() { - String[] components = { "nitrogen" }; - double[] fractions = { 0.98 }; + String[] components = {"nitrogen"}; + double[] fractions = {0.98}; int len = 10; List> onlineFractions = createDummyRequest(fractions, len); @@ -328,8 +335,10 @@ void testpropertyFlashOnlineSingle() { fluid.addComponents(components); fluid.addComponent("oxygen"); - Double[] pressure = new Double[] { 22.1, 23.2, 24.23, 25.98, 25.23, 26.1, 27.3, 28.7, 23.5, 22.7 }; - Double[] temperature = new Double[] { 288.1, 290.1, 295.1, 301.2, 299.3, 310.2, 315.3, 310.0, 305.2, 312.7 }; + Double[] pressure = + new Double[] {22.1, 23.2, 24.23, 25.98, 25.23, 26.1, 27.3, 28.7, 23.5, 22.7}; + Double[] temperature = + new Double[] {288.1, 290.1, 295.1, 301.2, 299.3, 310.2, 315.3, 310.0, 305.2, 312.7}; ThermodynamicOperations ops = new ThermodynamicOperations(fluid); CalculationResult s = ops.propertyFlash(Arrays.asList(pressure), Arrays.asList(temperature), 1, @@ -339,13 +348,13 @@ void testpropertyFlashOnlineSingle() { @Test void testpropertyFlashOnlineTooFewInputComponents() { - String[] components = { "nitrogen", "oxygen" }; - double[] fractions = { 0.79, 0.21 }; + String[] components = {"nitrogen", "oxygen"}; + double[] fractions = {0.79, 0.21}; int len = 10; List> onlineFractions = createDummyRequest(fractions, len); - Double[] pressure = { 1.0, 1.5, 2.0, 2.5, 3.0, 4.0, 4.0, 3.5, 3.0, 2.5 }; - Double[] temperature = { 301.0, 301.5, 302.0, 302.5, 303.0, 304.0, 304.0, 303.5, 303.0, 302.5 }; + Double[] pressure = {1.0, 1.5, 2.0, 2.5, 3.0, 4.0, 4.0, 3.5, 3.0, 2.5}; + Double[] temperature = {301.0, 301.5, 302.0, 302.5, 303.0, 304.0, 304.0, 303.5, 303.0, 302.5}; SystemInterface fluid = new SystemSrkEos(298, 1.0); // Add extra component C1 @@ -364,17 +373,17 @@ void testpropertyFlashOnlineTooFewInputComponents() { @Test void testPropertyFlashTooManyInputComponents() { int len = 10; - String[] components_too_many = { "nitrogen", "oxygen", "water" }; - double[] fractions_to_many = { 0.79, 0.21, 0.01 }; + String[] components_too_many = {"nitrogen", "oxygen", "water"}; + double[] fractions_to_many = {0.79, 0.21, 0.01}; - Double[] pressure = { 1.0, 1.5, 2.0, 2.5, 3.0, 4.0, 4.0, 3.5, 3.0, 2.5 }; - Double[] temperature = { 301.0, 301.5, 302.0, 302.5, 303.0, 304.0, 304.0, 303.5, 303.0, 302.5 }; + Double[] pressure = {1.0, 1.5, 2.0, 2.5, 3.0, 4.0, 4.0, 3.5, 3.0, 2.5}; + Double[] temperature = {301.0, 301.5, 302.0, 302.5, 303.0, 304.0, 304.0, 303.5, 303.0, 302.5}; List> onlineFractions_too_many = createDummyRequest(fractions_to_many, len); SystemInterface fluid = new SystemSrkEos(298, 1.0); // Add only two components to fluid - String[] components = { "nitrogen", "oxygen" }; + String[] components = {"nitrogen", "oxygen"}; fluid.addComponents(components); ThermodynamicOperations ops = new ThermodynamicOperations(fluid); CalculationResult s = ops.propertyFlash(Arrays.asList(pressure), Arrays.asList(temperature), 1, @@ -405,8 +414,7 @@ void testpropertyFlashRegressions() throws IOException { if (compNames == null) { // System.out.println("Skips test " + test.toString()); /* - * for (int k = 0; k < fractions.size(); k++) { fluid.addComponent(k, - * fractions.get(k)); } + * for (int k = 0; k < fractions.size(); k++) { fluid.addComponent(k, fractions.get(k)); } */ continue; } else { @@ -469,7 +477,8 @@ private List> createDummyRequest(double[] fractions, int len) { private Collection getTestData() throws IOException { ClassLoader classLoader = getClass().getClassLoader(); - File folder = new File(classLoader.getResource("neqsim/thermodynamicoperations/testcases").getFile()); + File folder = + new File(classLoader.getResource("neqsim/thermodynamicoperations/testcases").getFile()); HashMap testData = new HashMap<>(); @@ -518,8 +527,7 @@ public void setOutputFile(String outputFile) { private void setInput(String inputFile) throws IOException { String fileContents = new String(Files.readAllBytes(Paths.get(inputFile))); Gson gson = new Gson(); - Type type = new TypeToken>() { - }.getType(); + Type type = new TypeToken>() {}.getType(); input = gson.fromJson(fileContents, type); @@ -543,11 +551,11 @@ private HashMap getInput() { public CalculationResult getOutput() throws IOException { String fileContents = new String(Files.readAllBytes(Paths.get(this.getOutputFile()))); Gson gson = new Gson(); - Type type = new TypeToken>() { - }.getType(); + Type type = new TypeToken>() {}.getType(); HashMap outputData = gson.fromJson(fileContents, type); - ArrayList> calcresult = (ArrayList>) outputData.get("calcresult"); + ArrayList> calcresult = + (ArrayList>) outputData.get("calcresult"); Double[][] calcResult = new Double[calcresult.size()][]; for (int kSample = 0; kSample < calcresult.size(); kSample++) { @@ -566,6 +574,7 @@ public CalculationResult getOutput() throws IOException { return new CalculationResult(calcResult, calcerrors.toArray(new String[0])); } + /** {@inheritDoc} */ @Override public String toString() { return "TestData{" + "name=" + name + ", input=" + inputFile + ", output=" + outputFile + '}';