From 021bd096e99a10d18fd05aca2ce5590ef4f6aeb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=85smund=20V=C3=A5ge=20Fannemel?= <34712686+asmfstatoil@users.noreply.github.com> Date: Sun, 18 Jun 2023 09:10:37 +0200 Subject: [PATCH 1/8] bugfix: systemthermo addcomponent could add moles multiple times --- .../neqsim/thermo/system/SystemThermo.java | 34 +++++++++++++++++-- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/src/main/java/neqsim/thermo/system/SystemThermo.java b/src/main/java/neqsim/thermo/system/SystemThermo.java index d1039b836..59527b268 100644 --- a/src/main/java/neqsim/thermo/system/SystemThermo.java +++ b/src/main/java/neqsim/thermo/system/SystemThermo.java @@ -1311,10 +1311,16 @@ public void addComponent(int index, double moles) { return; } - for (PhaseInterface tmpPhase : phaseArray) { - // TODO: adding moles to all phases, not just the active ones. + if (!this.isBetaValid()) { + logger.error("Beta array contains invalid values"); + return; + } + + for (int phaseNum = 0; phaseNum < getNumberOfPhases(); phaseNum++) { + PhaseInterface tmpPhase = getPhase(phaseNum); if (tmpPhase != null) { - tmpPhase.addMolesChemReac(index, moles, moles); + double currBeta = this.beta[getPhaseIndex(tmpPhase)]; + tmpPhase.addMolesChemReac(index, currBeta * moles, currBeta * moles); } } setTotalNumberOfMoles(getTotalNumberOfMoles() + moles); @@ -2366,7 +2372,10 @@ public final int getPhaseIndex(int index) { /** {@inheritDoc} */ @Override public int getPhaseIndex(String phaseTypeName) { +<<<<<<< HEAD // TODO: returning first if not found, not same as the others. +======= +>>>>>>> c4107698 (bugfix: systemthermo addcomponent could add moles multiple times) for (int i = 0; i < numberOfPhases; i++) { if (getPhase(i).getPhaseTypeName().equals(phaseTypeName)) { return phaseIndex[i]; @@ -3059,6 +3068,25 @@ public final double getSumBeta() { return sum; } + <<<<<< 1.0) { + return false; + } + } + + return getSumBeta() == 1; + } + + >>>>>>> + + c4107698 (bugfix: systemthermo addcomponent could add moles multiple times) + /** {@inheritDoc} */ @Override public void setAttractiveTerm(int i) { From 8c19b56b88f0d8d53eb528d90eb86db1f8878094 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=85smund=20V=C3=A5ge=20Fannemel?= <34712686+asmfstatoil@users.noreply.github.com> Date: Mon, 19 Jun 2023 00:00:25 +0200 Subject: [PATCH 2/8] more info --- src/main/java/neqsim/thermo/system/SystemThermo.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/neqsim/thermo/system/SystemThermo.java b/src/main/java/neqsim/thermo/system/SystemThermo.java index 59527b268..e1f0bf2e6 100644 --- a/src/main/java/neqsim/thermo/system/SystemThermo.java +++ b/src/main/java/neqsim/thermo/system/SystemThermo.java @@ -1646,6 +1646,9 @@ public final void initBeta() { || this.getSumBeta() > 1.0 + ThermodynamicModelSettings.phaseFractionMinimumLimit) { logger.warn("SystemThermo:initBeta - Sum of beta does not equal 1.0"); } + if (this.getSumBeta() != 1.0) { + logger.warn("SystemThermo:initBeta - Sum of beta does not equal 1.0"); + } } /** {@inheritDoc} */ @@ -3080,7 +3083,9 @@ public final boolean isBetaValid() { } } - return getSumBeta() == 1; + double betaSum = getSumBeta(); + + return betaSum == 1; } >>>>>>> From e8194fcf441e3d46ed352c5fe9a32e44b8c100d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=85smund=20V=C3=A5ge=20Fannemel?= <34712686+asmfstatoil@users.noreply.github.com> Date: Mon, 19 Jun 2023 16:54:30 +0200 Subject: [PATCH 3/8] git # This is a combination of 3 commits. wip --- .../PVTsimulation/simulation/SlimTubeSim.java | 90 +++++++++---------- .../pipeline/AdiabaticTwoPhasePipe.java | 1 + .../neqsim/thermo/system/SystemThermo.java | 18 ++-- 3 files changed, 53 insertions(+), 56 deletions(-) diff --git a/src/main/java/neqsim/PVTsimulation/simulation/SlimTubeSim.java b/src/main/java/neqsim/PVTsimulation/simulation/SlimTubeSim.java index c8c9b0d85..0e737b90f 100644 --- a/src/main/java/neqsim/PVTsimulation/simulation/SlimTubeSim.java +++ b/src/main/java/neqsim/PVTsimulation/simulation/SlimTubeSim.java @@ -43,6 +43,7 @@ public void run() { getThermoSystem().setTemperature(288.15); thermoOps.TPflash(); + /* * double totalReferenceNodeVolumeAtStadardConditions; if (getThermoSystem().getNumberOfPhases() * > 1) { totalReferenceNodeVolumeAtStadardConditions = @@ -97,28 +98,30 @@ public void run() { if (liquidExcessVolume < 0) { liquidExcessVolume = 0.0; } + double gasExcessVolume = totalVolume - standardNodeVolume - liquidExcessVolume; + double liquidVolume = slimTubeNodeSystem[i].getPhase(liquidPhaseNumber).getVolume(); - int numComp = slimTubeNodeSystem[0].getPhase(0).getNumberOfComponents(); - double[] removeMoles = new double[numComp]; + double gasfactor = gasExcessVolume / excessVolume; + if (gasExcessVolume < excessVolume) { + gasfactor = 1.0; + } - if (slimTubeNodeSystem[i].getNumberOfPhases() > 1) { - double gasExcessVolume = totalVolume - standardNodeVolume - liquidExcessVolume; - double gasfactor = gasExcessVolume / excessVolume; - if (gasExcessVolume < excessVolume) { - gasfactor = 1.0; - } + double[] removeMoles = + new double[slimTubeNodeSystem[0].getPhase(0).getNumberOfComponents()]; - for (int k = 0; k < numComp; k++) { + if (slimTubeNodeSystem[i].getNumberOfPhases() > 1) { + for (int k = 0; k < slimTubeNodeSystem[i].getPhase(liquidPhaseNumber) + .getNumberOfComponents(); k++) { double moles = slimTubeNodeSystem[i].getPhase(0).getComponent(k).getNumberOfMolesInPhase(); removeMoles[k] += gasfactor * moles; } } + double liqfactor = liquidExcessVolume / liquidVolume; if (liquidExcessVolume > 0) { - double liquidVolume = slimTubeNodeSystem[i].getPhase(liquidPhaseNumber).getVolume(); - double liqfactor = liquidExcessVolume / liquidVolume; - for (int k = 0; k < numComp; k++) { + for (int k = 0; k < slimTubeNodeSystem[i].getPhase(liquidPhaseNumber) + .getNumberOfComponents(); k++) { double moles = slimTubeNodeSystem[i].getPhase(liquidPhaseNumber).getComponent(k) .getNumberOfMolesInPhase(); removeMoles[k] += moles * liqfactor; @@ -131,17 +134,11 @@ public void run() { * += removeMoles[comp]; } */ - for (int k = 0; k < numComp; k++) { + for (int k = 0; k < slimTubeNodeSystem[i].getPhase(liquidPhaseNumber) + .getNumberOfComponents(); k++) { try { - if (removeMoles[k] <= slimTubeNodeSystem[i].getComponent(k).getNumberOfmoles()) { - slimTubeNodeSystem[i].addComponent(k, -removeMoles[k]); - slimTubeNodeSystem[i + 1].addComponent(k, removeMoles[k]); - } else { - slimTubeNodeSystem[i + 1].addComponent(k, - slimTubeNodeSystem[i].getComponent(k).getNumberOfmoles()); - slimTubeNodeSystem[i].addComponent(k, - -slimTubeNodeSystem[i].getComponent(k).getNumberOfmoles()); - } + slimTubeNodeSystem[i + 1].addComponent(k, removeMoles[k]); + slimTubeNodeSystem[i].addComponent(k, -removeMoles[k]); } catch (Exception e) { logger.warn(e.getMessage()); } @@ -167,14 +164,13 @@ public void run() { .setPressure(ThermodynamicConstantsInterface.referencePressure); slimOps1.TPflash(); - /* - * double totalAccumulatedVolumeAtStadardConditions = - * slimTubeNodeSystem[numberOfSlimTubeNodes].getPhase(0).getVolume(); - * - * if (slimTubeNodeSystem[numberOfSlimTubeNodes].getNumberOfPhases() > 1) { - * totalAccumulatedVolumeAtStadardConditions = - * slimTubeNodeSystem[numberOfSlimTubeNodes].getPhase(1).getVolume(); } - */ + double totalAccumulatedVolumeAtStadardConditions = + slimTubeNodeSystem[numberOfSlimTubeNodes].getPhase(0).getVolume(); + + if (slimTubeNodeSystem[numberOfSlimTubeNodes].getNumberOfPhases() > 1) { + totalAccumulatedVolumeAtStadardConditions = + slimTubeNodeSystem[numberOfSlimTubeNodes].getPhase(1).getVolume(); + } /* * System.out.println("accumulated VOlume " + totalAccumulatedVolumeAtStadardConditions + @@ -189,22 +185,24 @@ public void run() { .setPressure(ThermodynamicConstantsInterface.referencePressure); slimOps1.TPflash(); - /* - * double totalAccumulatedVolumeAtStadardConditions = - * slimTubeNodeSystem[numberOfSlimTubeNodes].getPhase(0).getVolume(); - * - * if (slimTubeNodeSystem[numberOfSlimTubeNodes].getNumberOfPhases() > 1) { - * totalAccumulatedVolumeAtStadardConditions = - * slimTubeNodeSystem[numberOfSlimTubeNodes].getPhase(1).getVolume(); } - * - * System.out.println("accumulated VOlume " + totalAccumulatedVolumeAtStadardConditions + - * " total reference volume " + totalReferenceNodeVolumeAtStadardConditions); - * System.out.println("oil recovery ratio" + totalAccumulatedVolumeAtStadardConditions / - * totalReferenceNodeVolumeAtStadardConditions); - */ - /* - * for (int i = 0; i < numberOfSlimTubeNodes; i++) { slimTubeNodeSystem[i].display(); } - */ + double totalAccumulatedVolumeAtStadardConditions = + slimTubeNodeSystem[numberOfSlimTubeNodes].getPhase(0).getVolume(); + + if (slimTubeNodeSystem[numberOfSlimTubeNodes].getNumberOfPhases() > 1) { + totalAccumulatedVolumeAtStadardConditions = + slimTubeNodeSystem[numberOfSlimTubeNodes].getPhase(1).getVolume(); + } + + // System.out.println("accumulated VOlume " + + // totalAccumulatedVolumeAtStadardConditions + // + " total reference volume " + totalReferenceNodeVolumeAtStadardConditions); + // System.out.println("oil recovery ratio" + // + totalAccumulatedVolumeAtStadardConditions / + // totalReferenceNodeVolumeAtStadardConditions); + + for (int i = 0; i < numberOfSlimTubeNodes; i++) { + // slimTubeNodeSystem[i].display(); + } } /** diff --git a/src/main/java/neqsim/processSimulation/processEquipment/pipeline/AdiabaticTwoPhasePipe.java b/src/main/java/neqsim/processSimulation/processEquipment/pipeline/AdiabaticTwoPhasePipe.java index 4a74e3eb3..987a1d909 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/pipeline/AdiabaticTwoPhasePipe.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/pipeline/AdiabaticTwoPhasePipe.java @@ -284,6 +284,7 @@ public void run(UUID id) { system.setTotalFlowRate(flowLimit, maxflowunit); system.init(1); } + // SetTotalFlowRate resets beta factors, but they are fixed in run below inStream.getThermoSystem().setTotalFlowRate(system.getFlowRate(maxflowunit), maxflowunit); inStream.run(id); } else { diff --git a/src/main/java/neqsim/thermo/system/SystemThermo.java b/src/main/java/neqsim/thermo/system/SystemThermo.java index e1f0bf2e6..016f44484 100644 --- a/src/main/java/neqsim/thermo/system/SystemThermo.java +++ b/src/main/java/neqsim/thermo/system/SystemThermo.java @@ -2375,10 +2375,7 @@ public final int getPhaseIndex(int index) { /** {@inheritDoc} */ @Override public int getPhaseIndex(String phaseTypeName) { -<<<<<<< HEAD // TODO: returning first if not found, not same as the others. -======= ->>>>>>> c4107698 (bugfix: systemthermo addcomponent could add moles multiple times) for (int i = 0; i < numberOfPhases; i++) { if (getPhase(i).getPhaseTypeName().equals(phaseTypeName)) { return phaseIndex[i]; @@ -3071,8 +3068,11 @@ public final double getSumBeta() { return sum; } - <<<<<< 1 - ThermodynamicModelSettings.phaseFractionMinimumLimit + && betaSum < 1 + ThermodynamicModelSettings.phaseFractionMinimumLimit; - return betaSum == 1; + return valid; } - >>>>>>> - - c4107698 (bugfix: systemthermo addcomponent could add moles multiple times) - /** {@inheritDoc} */ @Override public void setAttractiveTerm(int i) { From 2ab4fa12acdb9348d65cbdfadd5215212fdb31e9 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, 14 Mar 2024 14:37:53 +0100 Subject: [PATCH 4/8] loosen up --- src/main/java/neqsim/thermo/system/SystemThermo.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/neqsim/thermo/system/SystemThermo.java b/src/main/java/neqsim/thermo/system/SystemThermo.java index 016f44484..5888d3650 100644 --- a/src/main/java/neqsim/thermo/system/SystemThermo.java +++ b/src/main/java/neqsim/thermo/system/SystemThermo.java @@ -1312,8 +1312,8 @@ public void addComponent(int index, double moles) { } if (!this.isBetaValid()) { - logger.error("Beta array contains invalid values"); - return; + logger.warn("Beta array contains invalid values"); + // return; } for (int phaseNum = 0; phaseNum < getNumberOfPhases(); phaseNum++) { From 6826cd567d2c49dfc101bf020c5278456d8297c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=85smund=20V=C3=A5ge=20Fannemel?= <34712686+asmfstatoil@users.noreply.github.com> Date: Fri, 15 Mar 2024 12:40:31 +0100 Subject: [PATCH 5/8] style: whitespace fixes --- .../simulation/SaturationPressure.java | 2 +- .../simulation/SaturationTemperature.java | 2 +- .../ChemicalEquilibrium.java | 12 +- .../LinearProgrammingChemicalEquilibrium.java | 59 +- .../chemicalReaction/ChemicalReaction.java | 2 +- .../waxNode/WaxDepositionFlowNode.java | 9 +- .../TwoPhaseTrayTowerFlowNode.java | 2 +- .../TwoPhaseFixedStaggeredGridSolver.java | 4 +- .../PipeFlowVisualization.java | 4 +- .../TwoPhasePipeFlowVisualization.java | 2 +- .../surfaceTension/GTSurfaceTension.java | 4 +- .../PFCTConductivityMethodMod86.java | 2 +- .../viscosity/Viscosity.java | 1 + .../conductivity/Conductivity.java | 1 + .../viscosity/Viscosity.java | 3 +- .../pipeline/PipelineMechanicalDesign.java | 2 +- .../ProcessEquipmentInterface.java | 2 +- .../CompressorChartAlternativeMapLookup.java | 2 +- .../processEquipment/expander/Expander.java | 1 - .../heatExchanger/HeatExchanger.java | 13 +- .../processEquipment/manifold/Manifold.java | 2 +- .../pipeline/PipeBeggsAndBrills.java | 16 +- .../reservoir/SimpleReservoir.java | 4 +- .../processEquipment/separator/Separator.java | 2 +- .../subsea/SimpleFlowLine.java | 14 +- .../processEquipment/subsea/SubseaWell.java | 12 +- .../processEquipment/util/FlowSetter.java | 18 +- .../processEquipment/util/PressureDrop.java | 4 +- .../processEquipment/util/Recycle.java | 4 +- .../processSystem/ProcessModule.java | 2 - .../processSystem/ProcessSystem.java | 10 +- .../processModules/DPCUModule.java | 32 +- .../GlycolDehydrationlModule.java | 7 +- .../gasQuality/GasChromotograpyhBase.java | 1 - .../LevenbergMarquardt.java | 4 +- .../neqsim/thermo/ThermodynamicModelTest.java | 1 + .../thermo/atomElement/UNIFACgroup.java | 4 +- .../thermo/characterization/Characterise.java | 7 +- .../neqsim/thermo/component/ComponentEos.java | 3 +- .../neqsim/thermo/component/ComponentGE.java | 1 + .../component/ComponentGENRTLmodifiedWS.java | 2 +- .../thermo/component/ComponentGEUnifac.java | 6 +- .../thermo/component/ComponentGEUniquac.java | 37 +- .../ComponentGEUniquacmodifiedHV.java | 3 +- .../thermo/component/ComponentGeDuanSun.java | 8 +- .../thermo/component/ComponentGeNRTL.java | 4 +- .../thermo/component/ComponentHydrateGF.java | 2 +- .../thermo/component/ComponentPrCPA.java | 3 +- .../java/neqsim/thermo/phase/PhaseEos.java | 1 + .../phase/PhaseGEUniquacmodifiedHV.java | 2 +- .../neqsim/thermo/phase/PhaseInterface.java | 6 +- .../thermo/phase/PhasePCSAFTRahmat.java | 17 +- .../java/neqsim/thermo/phase/PhaseSrkCPA.java | 2 +- .../java/neqsim/thermo/phase/PhaseUMRCPA.java | 2 +- .../neqsim/thermo/system/SystemInterface.java | 2 +- .../neqsim/thermo/system/SystemThermo.java | 6 +- .../java/neqsim/thermo/util/GERG/DETAIL.java | 3018 ++++++++--------- .../neqsim/thermo/util/GERG/GERG2008.java | 6 +- .../ThermodynamicOperations.java | 10 +- .../flashOps/PHflashSingleComp.java | 4 +- .../flashOps/TPmultiflash.java | 8 +- .../waterDewPointTemperatureFlash.java | 2 +- .../CricondenBarFlash.java | 10 +- .../CricondenThermFlash.java | 12 +- .../pTphaseEnvelope.java | 8 +- .../pTphaseEnvelope1.java | 2 +- .../pTphaseEnvelopeMay.java | 2 +- .../pTphaseEnvelopeNew.java | 2 +- .../OLGApropertyTableGeneratorWaterEven.java | 4 +- ...GApropertyTableGeneratorWaterStudents.java | 4 +- ...propertyTableGeneratorWaterStudentsPH.java | 4 +- .../util/database/NeqSimContractDataBase.java | 2 +- .../neqsim/util/database/NeqSimDataBase.java | 6 +- .../database/NeqSimProcessDesignDataBase.java | 2 +- .../java/neqsim/util/unit/LengthUnit.java | 2 +- src/main/java/neqsim/util/unit/TimeUnit.java | 2 +- .../simulation/SaturationTemperatureTest.java | 2 +- .../absorber/SimpleAbsorberTest.java | 4 +- .../adsorber/SimpleAdsorberTest.java | 6 +- .../compressor/CompressorChartTest.java | 2 +- .../distillation/DistillationColumnTest.java | 6 +- .../reservoir/WellFlowTest.java | 2 +- .../processSystem/GlycolRigTest.java | 35 +- .../processSystem/waterDegasserTest.java | 12 +- .../util/example/OffshoreProcess3.java | 19 +- ...TEGdehydrationProcessDistillationAaHa.java | 35 +- .../TEGdehydrationProcessDistillationGFA.java | 25 +- .../util/example/TestNeqsim.java | 18 +- .../util/example/TestTransientFlow.java | 4 +- .../util/example/destillation1.java | 102 +- .../util/example/shtokman.java | 4 +- .../gasQuality/Standard_ISO6976Test.java | 7 +- .../Standard_ISO6976_2016_Test.java | 2 +- .../thermo/system/SystemUMRCPAEoStest.java | 2 +- .../system/SystemUMRPRUMCEosNewTest.java | 4 +- .../thermo/util/example/BubbleFlashCPA.java | 6 +- .../neqsim/thermo/util/example/LNGFlash.java | 2 - .../thermo/util/example/PS_PH_flash.java | 4 +- .../thermo/util/example/PhaseEnvelope.java | 4 +- .../thermo/util/example/ReadFluidData2.java | 2 +- .../neqsim/thermo/util/example/TPflash.java | 2 +- .../thermo/util/example/TPflashDehyd.java | 34 +- .../example/TPflashMethanolWaterPropane.java | 2 +- .../TestCharacterizationCondensate.java | 2 +- .../readwrite/EclipseFluidReadWriteTest.java | 2 +- .../flashOps/Degasser.java | 2 +- .../util/example/PhaseEnvelope.java | 6 +- 107 files changed, 1899 insertions(+), 1950 deletions(-) diff --git a/src/main/java/neqsim/PVTsimulation/simulation/SaturationPressure.java b/src/main/java/neqsim/PVTsimulation/simulation/SaturationPressure.java index b82cbcf3d..2b22f83c9 100644 --- a/src/main/java/neqsim/PVTsimulation/simulation/SaturationPressure.java +++ b/src/main/java/neqsim/PVTsimulation/simulation/SaturationPressure.java @@ -117,7 +117,7 @@ public static void main(String[] args) { // satPresSim.getThermoSystem().display(); /* * double saturationPressure = 350.0; double saturationTemperature = 273.15 + 80; - * + * * TuningInterface tuning = new TuneToSaturation(satPresSim); * tuning.setSaturationConditions(saturationTemperature, saturationPressure); tuning.run(); * tuning.getSimulation().getThermoSystem().display(); diff --git a/src/main/java/neqsim/PVTsimulation/simulation/SaturationTemperature.java b/src/main/java/neqsim/PVTsimulation/simulation/SaturationTemperature.java index 7cd176106..ab1780819 100644 --- a/src/main/java/neqsim/PVTsimulation/simulation/SaturationTemperature.java +++ b/src/main/java/neqsim/PVTsimulation/simulation/SaturationTemperature.java @@ -108,7 +108,7 @@ public static void main(String[] args) { // satPresSim.getThermoSystem().display(); /* * double saturationPressure = 350.0; double saturationTemperature = 273.15 + 80; - * + * * TuningInterface tuning = new TuneToSaturation(satPresSim); * tuning.setSaturationConditions(saturationTemperature, saturationPressure); tuning.run(); * tuning.getSimulation().getThermoSystem().display(); diff --git a/src/main/java/neqsim/chemicalReactions/chemicalEquilibriaum/ChemicalEquilibrium.java b/src/main/java/neqsim/chemicalReactions/chemicalEquilibriaum/ChemicalEquilibrium.java index ab3115c7c..2db46cae9 100644 --- a/src/main/java/neqsim/chemicalReactions/chemicalEquilibriaum/ChemicalEquilibrium.java +++ b/src/main/java/neqsim/chemicalReactions/chemicalEquilibriaum/ChemicalEquilibrium.java @@ -517,9 +517,9 @@ public double innerStep(int i, double[] n_omega, int check, double step, boolean * public double step(){ double step=1.0; int i, check=0; double[] F = new double[NSPEC]; double[] * F_omega = new double[NSPEC]; double[] chem_pot = new double[NSPEC]; double[] n_omega = new * double[NSPEC]; - * + * * Matrix F_matrix, F_omega_matrix, fs_matrix, f_matrix, f_omega_matrix; double fs,f,f_omega; - * + * * for(i = 0;i 0.5) step = 0.5; return step; } diff --git a/src/main/java/neqsim/chemicalReactions/chemicalEquilibriaum/LinearProgrammingChemicalEquilibrium.java b/src/main/java/neqsim/chemicalReactions/chemicalEquilibriaum/LinearProgrammingChemicalEquilibrium.java index 2cb1fce75..b05380e48 100644 --- a/src/main/java/neqsim/chemicalReactions/chemicalEquilibriaum/LinearProgrammingChemicalEquilibrium.java +++ b/src/main/java/neqsim/chemicalReactions/chemicalEquilibriaum/LinearProgrammingChemicalEquilibrium.java @@ -202,50 +202,41 @@ public void changePrimaryComponents() { * //System.out.println("Ans"); //Ans.print(10,8); //Print statements added by Neeraj * System.out.println("lagranges: "); lagrangeTemp.print(10,2); System.out.println("refpot: "); * mutemp.print(10,2); System.out.println("A: "); atemp.print(10,2); - * - * + * * Matrix rTemp = new Matrix(atemp.getRowDimension(),1); rTemp.set(0,0,inertMoles/bVector[0]); * for(int i=1;i1e-10); - * + * * double temp=1.0; for(int i=1;i 1 && (i % * 1) == 0) { k++; test.display("length " + length); test.getBulkSystem().display("length " + @@ -169,13 +169,12 @@ public static void main(String[] args) { * //test.getFluidBoundary().display("length " + length); test.setLengthOfNode(0.000005 + * test.getLengthOfNode() / 2.0); temperatures2[0][k] = length; temperatures2[1][k] = * test.getGeometry().getTemperature(); test.getFluidBoundary().display("test"); } - * + * * //test.getBulkSystem().display(); test.update(); test.getFluidBoundary().display("length " + * length); test.getInterphaseSystem().display("length " + length); - * - * + * * //test.getFluidBoundary().display("test"); } - * + * * for (int i = 0; i < k; i++) { System.out.println("len temp " + temperatures2[0][i] + " " + * temperatures2[1][i]); } */ diff --git a/src/main/java/neqsim/fluidMechanics/flowNode/twoPhaseNode/twoPhaseReactorFlowNode/TwoPhaseTrayTowerFlowNode.java b/src/main/java/neqsim/fluidMechanics/flowNode/twoPhaseNode/twoPhaseReactorFlowNode/TwoPhaseTrayTowerFlowNode.java index e3203b917..1afffbb19 100644 --- a/src/main/java/neqsim/fluidMechanics/flowNode/twoPhaseNode/twoPhaseReactorFlowNode/TwoPhaseTrayTowerFlowNode.java +++ b/src/main/java/neqsim/fluidMechanics/flowNode/twoPhaseNode/twoPhaseReactorFlowNode/TwoPhaseTrayTowerFlowNode.java @@ -132,7 +132,7 @@ public static void main(String[] args) { * System.out.println("Starter....."); SystemSrkEos testSystem = new SystemSrkEos(275.3, * ThermodynamicConstantsInterface.referencePressure); ThermodynamicOperations testOps = new * ThermodynamicOperations(testSystem); PipeData pipe1 = new PipeData(10.0, 0.025); - * + * * testSystem.addComponent("methane", 0.011152181, 0); testSystem.addComponent("ethane", * 0.00011152181, 0); testSystem.addComponent("water", 0.00462204876, 1); * testSystem.addComponent("methane", 0.061152181, 0); testSystem.addComponent("water", diff --git a/src/main/java/neqsim/fluidMechanics/flowSolver/twoPhaseFlowSolver/twoPhasePipeFlowSolver/TwoPhaseFixedStaggeredGridSolver.java b/src/main/java/neqsim/fluidMechanics/flowSolver/twoPhaseFlowSolver/twoPhasePipeFlowSolver/TwoPhaseFixedStaggeredGridSolver.java index d01c51afd..aeb927ae4 100644 --- a/src/main/java/neqsim/fluidMechanics/flowSolver/twoPhaseFlowSolver/twoPhasePipeFlowSolver/TwoPhaseFixedStaggeredGridSolver.java +++ b/src/main/java/neqsim/fluidMechanics/flowSolver/twoPhaseFlowSolver/twoPhasePipeFlowSolver/TwoPhaseFixedStaggeredGridSolver.java @@ -155,7 +155,7 @@ public void initProfiles() { /* * do{ err=0; pipe.getNode(0).init(); for(int i = 0;i 1) { System.out.println("3D plot "); plot = new * neqsim.dataPresentation.visAD.visAd3D.visAd3DPlot("title[0]", "title[1]", "title[2]"); * ((neqsim.dataPresentation.visAD.visAd3D.visAd3DPlot) plot).setXYvals(150, 160, @@ -138,7 +138,7 @@ public void displayResult(String name) { } /* * try { System.out.println("points: " + points.length); - * + * * if (pressurePoint.length > 1) { System.out.println("3D plot "); plot = new * neqsim.dataPresentation.visAD.visAd3D.visAd3DPlot("title[0]", "title[1]", "title[2]"); * ((neqsim.dataPresentation.visAD.visAd3D.visAd3DPlot) plot).setXYvals(150, 160, diff --git a/src/main/java/neqsim/fluidMechanics/util/fluidMechanicsVisualization/flowSystemVisualization/twoPhaseFlowVisualization/twoPhasePipeFlowVisualization/TwoPhasePipeFlowVisualization.java b/src/main/java/neqsim/fluidMechanics/util/fluidMechanicsVisualization/flowSystemVisualization/twoPhaseFlowVisualization/twoPhasePipeFlowVisualization/TwoPhasePipeFlowVisualization.java index e40849597..b902f8adb 100644 --- a/src/main/java/neqsim/fluidMechanics/util/fluidMechanicsVisualization/flowSystemVisualization/twoPhaseFlowVisualization/twoPhasePipeFlowVisualization/TwoPhasePipeFlowVisualization.java +++ b/src/main/java/neqsim/fluidMechanics/util/fluidMechanicsVisualization/flowSystemVisualization/twoPhaseFlowVisualization/twoPhasePipeFlowVisualization/TwoPhasePipeFlowVisualization.java @@ -175,7 +175,7 @@ public void displayResult(String name) { * file.setYvalues(interfaceTemperaturePoint[0][0], "gas interface temperature", "sec"); * file.setYvalues(interfaceTemperaturePoint[1][0], "liquid interface temperature", "sec"); * file.setYvalues(interphaseContactLength[0][0], "interphase contact length", "sec"); - * + * * for (int p = 0; p < flowNodes[0][0].getNumberOfComponents(); p++) { String comp = * "component molefraction " + p; file.setYvalues(bulkComposition[0][p][0], ("gas " + comp + p), * "sec"); file.setYvalues(bulkComposition[1][p][0], ("liquid " + comp + p), "sec"); diff --git a/src/main/java/neqsim/physicalProperties/interfaceProperties/surfaceTension/GTSurfaceTension.java b/src/main/java/neqsim/physicalProperties/interfaceProperties/surfaceTension/GTSurfaceTension.java index 13d862cec..fbc872f04 100644 --- a/src/main/java/neqsim/physicalProperties/interfaceProperties/surfaceTension/GTSurfaceTension.java +++ b/src/main/java/neqsim/physicalProperties/interfaceProperties/surfaceTension/GTSurfaceTension.java @@ -15,7 +15,6 @@ * method assumes the number of components to be two or more, and that the species set is equal and * in the same component order for both phases. * - * * Near a fluid-fluid interface, we consider the variation of densities of chemical species, * \f$\boldsymbol{n}(z)\f$, as function of position, \f$z\f$, where element \f$k\f$ of the vector * \f$\boldsymbol{n}(z)\f$ is the number density of chemical species \f$k\f$ in the mixture. The @@ -185,7 +184,7 @@ public static double solveWithRefcomp(SystemInterface system, int interface1, in * Tolerances for the odesystem.abstol and .reltol should be less than the integrator tolerances * for stability. Default Newton-Rhapson values are odesystem.normtol = 1e-10; odesystem.reltol * = 1e-8; - * + * */ odesystem.normtol = 1e-10; odesystem.reltol = 1e-8; @@ -216,7 +215,6 @@ public static double solveWithRefcomp(SystemInterface system, int interface1, in * results. The boundary conditions are the homogeneous densities of the two fluids in contact, as * calculated by a flash calculation. * - * * We approximate the solution on a equi-spaced grid with \f$2^N+1\f$ points where \f$N\f$ is an * integer. Using a Finite Difference approximation, the equation for \f$\delta\mu\f$ can then be * written as an equation system for the internal grid points, \f$i=2,3,...,2^N\f$: diff --git a/src/main/java/neqsim/physicalProperties/physicalPropertyMethods/commonPhasePhysicalProperties/conductivity/PFCTConductivityMethodMod86.java b/src/main/java/neqsim/physicalProperties/physicalPropertyMethods/commonPhasePhysicalProperties/conductivity/PFCTConductivityMethodMod86.java index b425eba7b..17bc0f799 100644 --- a/src/main/java/neqsim/physicalProperties/physicalPropertyMethods/commonPhasePhysicalProperties/conductivity/PFCTConductivityMethodMod86.java +++ b/src/main/java/neqsim/physicalProperties/physicalPropertyMethods/commonPhasePhysicalProperties/conductivity/PFCTConductivityMethodMod86.java @@ -318,7 +318,7 @@ public double calcMixLPViscosity() { * phase.getPhase().getComponent(i).getx() * * Math.pow(phase.getPhase().getComponent(i).getMolarMass(), 2.0); Mmtemp += * phase.getPhase().getComponent(i).getx() * phase.getPhase().getComponent(i).getMolarMass(); } - * + * * PCmix = 8.0 * tempPC1 / (tempPC2 * tempPC2); TCmix = tempTC1 / tempTC2; Mmix = (Mmtemp + * 1.304e-4 * (Math.pow(Mwtemp / Mmtemp, 2.303) - Math.pow(Mmtemp, 2.303))) * 1e3; * //phase.getPhase().getMolarMass(); diff --git a/src/main/java/neqsim/physicalProperties/physicalPropertyMethods/commonPhasePhysicalProperties/viscosity/Viscosity.java b/src/main/java/neqsim/physicalProperties/physicalPropertyMethods/commonPhasePhysicalProperties/viscosity/Viscosity.java index 812309a89..a79688931 100644 --- a/src/main/java/neqsim/physicalProperties/physicalPropertyMethods/commonPhasePhysicalProperties/viscosity/Viscosity.java +++ b/src/main/java/neqsim/physicalProperties/physicalPropertyMethods/commonPhasePhysicalProperties/viscosity/Viscosity.java @@ -4,6 +4,7 @@ import org.apache.logging.log4j.Logger; /** + * Abstract class for Viscosity property. * * @author Even Solbraa */ diff --git a/src/main/java/neqsim/physicalProperties/physicalPropertyMethods/gasPhysicalProperties/conductivity/Conductivity.java b/src/main/java/neqsim/physicalProperties/physicalPropertyMethods/gasPhysicalProperties/conductivity/Conductivity.java index 7113d8319..b6cc542e6 100644 --- a/src/main/java/neqsim/physicalProperties/physicalPropertyMethods/gasPhysicalProperties/conductivity/Conductivity.java +++ b/src/main/java/neqsim/physicalProperties/physicalPropertyMethods/gasPhysicalProperties/conductivity/Conductivity.java @@ -10,6 +10,7 @@ import org.apache.logging.log4j.Logger; /** + * Abstract class Conductivity. * * @author Even Solbraa */ diff --git a/src/main/java/neqsim/physicalProperties/physicalPropertyMethods/gasPhysicalProperties/viscosity/Viscosity.java b/src/main/java/neqsim/physicalProperties/physicalPropertyMethods/gasPhysicalProperties/viscosity/Viscosity.java index f8bddcaa2..7f90709fd 100644 --- a/src/main/java/neqsim/physicalProperties/physicalPropertyMethods/gasPhysicalProperties/viscosity/Viscosity.java +++ b/src/main/java/neqsim/physicalProperties/physicalPropertyMethods/gasPhysicalProperties/viscosity/Viscosity.java @@ -4,7 +4,8 @@ import org.apache.logging.log4j.Logger; /** - * + * * Abstract class for Viscosity property. + * * @author Even Solbraa */ abstract class Viscosity extends diff --git a/src/main/java/neqsim/processSimulation/mechanicalDesign/pipeline/PipelineMechanicalDesign.java b/src/main/java/neqsim/processSimulation/mechanicalDesign/pipeline/PipelineMechanicalDesign.java index e648a8ff0..2d0cb32b2 100644 --- a/src/main/java/neqsim/processSimulation/mechanicalDesign/pipeline/PipelineMechanicalDesign.java +++ b/src/main/java/neqsim/processSimulation/mechanicalDesign/pipeline/PipelineMechanicalDesign.java @@ -59,7 +59,7 @@ public void calcDesign() { /* * Pipeline pipeline = (Pipeline) getProcessEquipment(); double flow = ((AdiabaticPipe) * getProcessEquipment()).getOutStream().getThermoSystem().getVolume() / 1e5; - * + * * double innerArea = Math.PI * innerDiameter * innerDiameter / 4.0; double gasVelocity = flow / * innerArea; double wallThickness = 0.0; */ diff --git a/src/main/java/neqsim/processSimulation/processEquipment/ProcessEquipmentInterface.java b/src/main/java/neqsim/processSimulation/processEquipment/ProcessEquipmentInterface.java index a6262aedf..01ff9d980 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/ProcessEquipmentInterface.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/ProcessEquipmentInterface.java @@ -45,7 +45,7 @@ default void initMechanicalDesign() {} *

* * @return true or false - * + * */ public default boolean needRecalculation() { return true; diff --git a/src/main/java/neqsim/processSimulation/processEquipment/compressor/CompressorChartAlternativeMapLookup.java b/src/main/java/neqsim/processSimulation/processEquipment/compressor/CompressorChartAlternativeMapLookup.java index 7f6228d22..a1ded377f 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/compressor/CompressorChartAlternativeMapLookup.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/compressor/CompressorChartAlternativeMapLookup.java @@ -428,7 +428,7 @@ public static void main(String[] args) { * double[] surgeflow = new double[] { 453.2, 550.0, 700.0, 800.0 }; double[] surgehead = new * double[] { 6000.0, 7000.0, 8000.0, 10000.0 }; * comp1.getCompressorChart().getSurgeCurve().setCurve(chartConditions, surgeflow, surgehead); - * + * * double[] stoneWallflow = new double[] { 923.2, 950.0, 980.0, 1000.0 }; double[] stoneWallHead * = new double[] { 6000.0, 7000.0, 8000.0, 10000.0 }; * comp1.getCompressorChart().getStoneWallCurve().setCurve(chartConditions, stoneWallflow, diff --git a/src/main/java/neqsim/processSimulation/processEquipment/expander/Expander.java b/src/main/java/neqsim/processSimulation/processEquipment/expander/Expander.java index 70bda3599..5758ca5b4 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/expander/Expander.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/expander/Expander.java @@ -89,7 +89,6 @@ public void run(UUID id) { /* * HYSYS method double oldPolyt = 10.5; int iter = 0; do { * - * * iter++; double n = Math.log(thermoSystem.getPressure() / presinn) / * Math.log(thermoSystem.getDensity() / densInn); double k = * Math.log(thermoSystem.getPressure() / presinn) / Math.log(densOutIdeal / densInn); double diff --git a/src/main/java/neqsim/processSimulation/processEquipment/heatExchanger/HeatExchanger.java b/src/main/java/neqsim/processSimulation/processEquipment/heatExchanger/HeatExchanger.java index 42a2ed1fe..64bee1c17 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/heatExchanger/HeatExchanger.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/heatExchanger/HeatExchanger.java @@ -7,7 +7,6 @@ package neqsim.processSimulation.processEquipment.heatExchanger; import java.util.UUID; - import neqsim.processSimulation.conditionMonitor.ConditionMonitorSpecifications; import neqsim.processSimulation.processEquipment.ProcessEquipmentInterface; import neqsim.processSimulation.processEquipment.stream.Stream; @@ -359,12 +358,12 @@ public void run(UUID id) { /* * if (systemOut0.getTemperature() <= inTemp1 - dT) { systemOut0.setTemperature(inTemp1); * outStream[0].setThermoSystem(systemOut0); outStream[0].run(); //inStream[0].run(); - * + * * dEntalphy = outStream[0].getThermoSystem().getEnthalpy() - * inStream[0].getThermoSystem().getEnthalpy(); corrected_Entalphy = dEntalphy * * inStream[0].getThermoSystem().getNumberOfMoles() / * inStream[1].getThermoSystem().getNumberOfMoles(); - * + * * systemOut1 = inStream[1].getThermoSystem().clone(); System.out.println("dent " + * dEntalphy); testOps = new ThermodynamicOperations(systemOut1); * testOps.PHflash(systemOut1.getEnthalpy() - corrected_Entalphy, 0); @@ -551,7 +550,9 @@ public void setThermalEffectiveness(double thermalEffectiveness) { } /** - *

Getter for the field flowArrangement.

+ *

+ * Getter for the field flowArrangement. + *

* * @return String */ @@ -560,7 +561,9 @@ public String getFlowArrangement() { } /** - *

Setter for the field flowArrangement.

+ *

+ * Setter for the field flowArrangement. + *

* * @param flowArrangement name of flow arrangement */ diff --git a/src/main/java/neqsim/processSimulation/processEquipment/manifold/Manifold.java b/src/main/java/neqsim/processSimulation/processEquipment/manifold/Manifold.java index ec0a850a9..33d091545 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/manifold/Manifold.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/manifold/Manifold.java @@ -73,7 +73,7 @@ public StreamInterface getSplitStream(int i) { *

* getMixedStream. *

- * + * * @return a {@link neqsim.processSimulation.processEquipment.stream.StreamInterface} **/ public StreamInterface getMixedStream() { diff --git a/src/main/java/neqsim/processSimulation/processEquipment/pipeline/PipeBeggsAndBrills.java b/src/main/java/neqsim/processSimulation/processEquipment/pipeline/PipeBeggsAndBrills.java index 6f0b3aa78..6ecf6a7bd 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/pipeline/PipeBeggsAndBrills.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/pipeline/PipeBeggsAndBrills.java @@ -342,7 +342,7 @@ public void calculateMissingValue() { /** * Calculates the length based on the elevation and angle. - * + * * @return the calculated length. */ private double calculateLength() { @@ -350,9 +350,8 @@ private double calculateLength() { } /** - * * Calculates the elevation based on the length and angle. - * + * * @return the calculated elevation. */ private double calculateElevation() { @@ -360,9 +359,8 @@ private double calculateElevation() { } /** - * * Calculates the angle based on the length and elevation. - * + * * @return the calculated angle. */ private double calculateAngle() { @@ -370,7 +368,6 @@ private double calculateAngle() { } /** - * * /** *

* calcFlowRegime. @@ -878,9 +875,10 @@ public Double getSegmentPressure(int index) { } /** - * - * @return list of results - * + * Get Pressure + * + * @return ArrayList of pressure drop profile + * */ public List getPressureDropProfile() { return new ArrayList<>(pressureDropProfile); diff --git a/src/main/java/neqsim/processSimulation/processEquipment/reservoir/SimpleReservoir.java b/src/main/java/neqsim/processSimulation/processEquipment/reservoir/SimpleReservoir.java index cd6d0b259..621dc21c1 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/reservoir/SimpleReservoir.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/reservoir/SimpleReservoir.java @@ -84,9 +84,7 @@ public SystemInterface getReservoirFluid() { /* * public StreamInterface getGasOutStream() { return gasOutStream; } - * - * - * + * * public StreamInterface getOilOutStream() { return oilOutStream; } */ diff --git a/src/main/java/neqsim/processSimulation/processEquipment/separator/Separator.java b/src/main/java/neqsim/processSimulation/processEquipment/separator/Separator.java index 22fbabe9e..7dac7af75 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/separator/Separator.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/separator/Separator.java @@ -875,7 +875,7 @@ public boolean equals(Object obj) { /* * private class SeparatorReport extends Object{ public Double gasLoadFactor; SeparatorReport(){ * gasLoadFactor = getGasLoadFactor(); } } - * + * * public SeparatorReport getReport(){ return this.new SeparatorReport(); } */ } diff --git a/src/main/java/neqsim/processSimulation/processEquipment/subsea/SimpleFlowLine.java b/src/main/java/neqsim/processSimulation/processEquipment/subsea/SimpleFlowLine.java index 0915c85f7..46f09538b 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/subsea/SimpleFlowLine.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/subsea/SimpleFlowLine.java @@ -75,21 +75,21 @@ public void run(UUID id) { /* * System.out.println("stary P " ); - * + * * SystemInterface fluidIn = (inStream.getFluid()).clone(); fluidIn.initProperties(); - * + * * double density = fluidIn.getDensity("kg/m3"); - * + * * double deltaP = density*getHeight()*neqsim.thermo.ThermodynamicConstantsInterface.gravity/1. * 0e5; - * + * * System.out.println("density " +density + " delta P " + deltaP); - * + * * fluidIn.setPressure(fluidIn.getPressure("bara")-deltaP); * fluidIn.setTemperature(outletTemperature); - * + * * ThermodynamicOperations ops = new ThermodynamicOperations(fluidIn); ops.TPflash(); - * + * * getOutletStream().setFluid(fluidIn); */ setCalculationIdentifier(id); diff --git a/src/main/java/neqsim/processSimulation/processEquipment/subsea/SubseaWell.java b/src/main/java/neqsim/processSimulation/processEquipment/subsea/SubseaWell.java index 46d558174..980c7c9b6 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/subsea/SubseaWell.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/subsea/SubseaWell.java @@ -61,17 +61,17 @@ public void run(UUID id) { /* * System.out.println("stary P " ); SystemInterface fluidIn = (inStream.getFluid()).clone(); * fluidIn.initProperties(); - * + * * double density = fluidIn.getDensity("kg/m3"); - * + * * double deltaP = density*height*neqsim.thermo.ThermodynamicConstantsInterface.gravity/1.0e5; - * + * * System.out.println("density " +density + " delta P " + deltaP); - * + * * fluidIn.setPressure(fluidIn.getPressure("bara")-deltaP); - * + * * ThermodynamicOperations ops = new ThermodynamicOperations(fluidIn); ops.TPflash(); - * + * * getOutStream().setFluid(fluidIn); */ setCalculationIdentifier(id); diff --git a/src/main/java/neqsim/processSimulation/processEquipment/util/FlowSetter.java b/src/main/java/neqsim/processSimulation/processEquipment/util/FlowSetter.java index a54a2a356..8679f40bf 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/util/FlowSetter.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/util/FlowSetter.java @@ -93,10 +93,10 @@ public void setInletStream(StreamInterface inletStream) { *

* Get setGasFlowRate *

- * + * * @param flowRate flow rate * @param flowUnit Supported units are Sm3/sec, Sm3/hr, Sm3/day, MSm3/day - * + * */ public void setGasFlowRate(double flowRate, String flowUnit) { double conversionFactor = 1.0; @@ -123,7 +123,7 @@ public void setGasFlowRate(double flowRate, String flowUnit) { *

* Get getGasFlowRate *

- * + * * @param flowUnit Supported units are Sm3/sec, Sm3/hr, Sm3/day, MSm3/day * @return gas flow rate in unit sm3/sec */ @@ -152,10 +152,10 @@ public double getGasFlowRate(String flowUnit) { *

* Get setOilFlowRate *

- * + * * @param flowRate flow rate * @param flowUnit Supported units are m3/sec, m3/hr, m3/day - * + * */ public void setOilFlowRate(double flowRate, String flowUnit) { double conversionFactor = 1.0; @@ -179,7 +179,7 @@ public void setOilFlowRate(double flowRate, String flowUnit) { *

* Get getOilFlowRate *

- * + * * @param flowUnit Supported units are m3/sec, m3/hr, m3/day * @return oil flow rate in unit m3/sec */ @@ -205,10 +205,10 @@ public double getOilFlowRate(String flowUnit) { *

* Get setWaterFlowRate *

- * + * * @param flowRate flow rate * @param flowUnit Supported units are m3/sec, m3/hr, m3/day - * + * */ public void setWaterFlowRate(double flowRate, String flowUnit) { double conversionFactor = 1.0; @@ -232,7 +232,7 @@ public void setWaterFlowRate(double flowRate, String flowUnit) { *

* Get getWaterFlowRate *

- * + * * @param flowUnit Supported units are m3/sec, m3/hr, m3/day * @return water flow rate in unit m3/sec */ diff --git a/src/main/java/neqsim/processSimulation/processEquipment/util/PressureDrop.java b/src/main/java/neqsim/processSimulation/processEquipment/util/PressureDrop.java index fc8e19609..35e42bac1 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/util/PressureDrop.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/util/PressureDrop.java @@ -14,7 +14,7 @@ *

* The pressure drop unit is used to simulate pressure drops in process plant. The proessure drop is * simulated using a constant enthalpy flash. - * + * * @author esol * @version $Id: $Id */ @@ -29,7 +29,7 @@ public class PressureDrop extends ThrottlingValve { *

* Constructor for PressureDrop. *

- * + * * @param name the name of the pressure drop unit */ public PressureDrop(String name) { diff --git a/src/main/java/neqsim/processSimulation/processEquipment/util/Recycle.java b/src/main/java/neqsim/processSimulation/processEquipment/util/Recycle.java index 38a007c07..d1a2ade68 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/util/Recycle.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/util/Recycle.java @@ -294,9 +294,7 @@ public void setDownstreamProperties() { public void run(UUID id) { iterations++; /* - * if(firstTime || iterations>maxIterations) { firstTime=false; return; - * - * } + * if(firstTime || iterations>maxIterations) { firstTime=false; return; } */ double enthalpy = 0.0; diff --git a/src/main/java/neqsim/processSimulation/processSystem/ProcessModule.java b/src/main/java/neqsim/processSimulation/processSystem/ProcessModule.java index fcb410d63..ed528a1d2 100644 --- a/src/main/java/neqsim/processSimulation/processSystem/ProcessModule.java +++ b/src/main/java/neqsim/processSimulation/processSystem/ProcessModule.java @@ -16,9 +16,7 @@ * then run only once. * * @author [seros] - * * @version 1.0 - * */ public class ProcessModule extends SimulationBaseClass { private static final long serialVersionUID = 1000; diff --git a/src/main/java/neqsim/processSimulation/processSystem/ProcessSystem.java b/src/main/java/neqsim/processSimulation/processSystem/ProcessSystem.java index 00c7679bf..e68c17460 100644 --- a/src/main/java/neqsim/processSimulation/processSystem/ProcessSystem.java +++ b/src/main/java/neqsim/processSimulation/processSystem/ProcessSystem.java @@ -473,7 +473,7 @@ public void run(UUID id) { /* * signalDB = new String[1000][1 + 3 * measurementDevices.size()]; - * + * * signalDB[timeStepNumber] = new String[1 + 3 * measurementDevices.size()]; for (int i = 0; i * < measurementDevices.size(); i++) { signalDB[timeStepNumber][0] = Double.toString(time); * signalDB[timeStepNumber][3 * i + 1] = ((MeasurementDeviceInterface) @@ -481,7 +481,7 @@ public void run(UUID id) { * .toString(((MeasurementDeviceInterface) measurementDevices.get(i)).getMeasuredValue()); * signalDB[timeStepNumber][3 * i + 3] = ((MeasurementDeviceInterface) * measurementDevices.get(i)) .getUnit(); - * + * * } */ } while ((!isConverged || (iter < 2 && hasResycle)) && iter < 100); @@ -948,12 +948,12 @@ public boolean equals(Object obj) { /* * @XmlRootElement private class Report extends Object{ public Double name; public * ArrayList unitOperationsReports = new ArrayList(); - * + * * Report(){ name= getName(); - * + * * for (int i = 0; i < unitOperations.size(); i++) { * unitOperationsReports.add(unitOperations.getReport()); } } } - * + * * public Report getReport(){ return this.new Report(); } */ } diff --git a/src/main/java/neqsim/processSimulation/processSystem/processModules/DPCUModule.java b/src/main/java/neqsim/processSimulation/processSystem/processModules/DPCUModule.java index 667c23036..a79170100 100644 --- a/src/main/java/neqsim/processSimulation/processSystem/processModules/DPCUModule.java +++ b/src/main/java/neqsim/processSimulation/processSystem/processModules/DPCUModule.java @@ -47,7 +47,9 @@ public class DPCUModule extends ProcessModuleBaseClass { DistillationColumn distColumn; /** - *

Constructor for DPCUModule.

+ *

+ * Constructor for DPCUModule. + *

* * @param name a {@link java.lang.String} object */ @@ -150,55 +152,55 @@ public void initializeModule() { /* * Cooler inletCooler = new Cooler("inlet well stream cooler", feedStream); * inletCooler.setOutTemperature(inletSepTemperature + 273.15); - * + * * inletSeparator = new Separator("Inlet separator", inletCooler.getOutStream()); - * + * * Cooler gasCooler = new Cooler("separator gas cooler", inletSeparator.getGasOutStream()); * gasCooler.setOutTemperature(gasScrubberTemperature + 273.15); - * + * * oilPump = new Pump("liquid pump", inletSeparator.getLiquidOutStream()); * oilPump.setOutletPressure(liquidPumpPressure); - * + * * Separator gasScrubber = new Separator("HC dew point control scrubber", * gasCooler.getOutStream()); - * + * * Recycle HPliquidRecycle = new Recycle("Resycle"); double tolerance = 1e-2; * HPliquidRecycle.setTolerance(tolerance); * HPliquidRecycle.addStream(gasScrubber.getLiquidOutStream()); * inletSeparator.addStream(HPliquidRecycle.getOutStream()); - * + * * Compressor firstStageCompressor = new Compressor("1st stage compressor", * gasScrubber.getGasOutStream()); * firstStageCompressor.setOutletPressure(firstStageOutPressure); - * + * * glycolFeedStream.getThermoSystem().setPressure(firstStageOutPressure); - * + * * Mixer glycolMixer = new Mixer("glycol injection mixer"); * glycolMixer.addStream(firstStageCompressor.getOutStream()); * glycolMixer.addStream(glycolFeedStream); - * + * * Cooler mixerAfterCooler = new Cooler("glycol mixer after cooler", * glycolMixer.getOutStream()); mixerAfterCooler.setOutTemperature(glycolScrubberTemperature + * 273.15); - * + * * glycolScrubber = new Separator("Water dew point control scrubber", * mixerAfterCooler.getOutStream()); - * + * * secondStageCompressor = new Compressor("2nd stage compressor", * glycolScrubber.getGasOutStream()); * secondStageCompressor.setOutletPressure(secondStageOutPressure); - * + * * secondStageAfterCooler = new Cooler("second stage after cooler", * secondStageCompressor.getOutStream()); * secondStageAfterCooler.setOutTemperature(exportGasTemperature + 273.15); - * + * * getOperations().add(inletCooler); getOperations().add(inletSeparator); * getOperations().add(gasCooler); getOperations().add(oilPump); * getOperations().add(gasScrubber); getOperations().add(HPliquidRecycle); * getOperations().add(firstStageCompressor); getOperations().add(glycolMixer); * getOperations().add(mixerAfterCooler); getOperations().add(glycolScrubber); * getOperations().add(secondStageCompressor); getOperations().add(secondStageAfterCooler); - * + * */ } diff --git a/src/main/java/neqsim/processSimulation/processSystem/processModules/GlycolDehydrationlModule.java b/src/main/java/neqsim/processSimulation/processSystem/processModules/GlycolDehydrationlModule.java index cb369fd0b..7d630d93d 100644 --- a/src/main/java/neqsim/processSimulation/processSystem/processModules/GlycolDehydrationlModule.java +++ b/src/main/java/neqsim/processSimulation/processSystem/processModules/GlycolDehydrationlModule.java @@ -1,10 +1,8 @@ package neqsim.processSimulation.processSystem.processModules; import java.util.UUID; - import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; - import neqsim.processSimulation.processEquipment.ProcessEquipmentBaseClass; import neqsim.processSimulation.processEquipment.absorber.SimpleTEGAbsorber; import neqsim.processSimulation.processEquipment.heatExchanger.Cooler; @@ -63,7 +61,9 @@ public class GlycolDehydrationlModule extends ProcessModuleBaseClass { double regenerationPressure = 1.4; /** - *

Constructor for GlycolDehydrationlModule.

+ *

+ * Constructor for GlycolDehydrationlModule. + *

* * @param name a {@link java.lang.String} object */ @@ -203,7 +203,6 @@ public void initializeModule() { * stripperColumn.addFeedStream(valveMP.getOutStream(), 3); * stripperColumn.setCondenserTemperature(273.15 + 80.0); ((Reboiler) * stripperColumn.getReboiler()).setRefluxRatio(11.7); - * */ Heater reboiler = new Heater("reboiler", valveMP.getOutletStream()); diff --git a/src/main/java/neqsim/standards/gasQuality/GasChromotograpyhBase.java b/src/main/java/neqsim/standards/gasQuality/GasChromotograpyhBase.java index f0238c9e2..4d68315ab 100644 --- a/src/main/java/neqsim/standards/gasQuality/GasChromotograpyhBase.java +++ b/src/main/java/neqsim/standards/gasQuality/GasChromotograpyhBase.java @@ -20,7 +20,6 @@ public class GasChromotograpyhBase extends neqsim.standards.Standard { *

* * @param thermoSystem a {@link neqsim.thermo.system.SystemInterface} object - * */ public GasChromotograpyhBase(SystemInterface thermoSystem) { super("gas chromotography", "Gas composition", thermoSystem); diff --git a/src/main/java/neqsim/statistics/parameterFitting/nonLinearParameterFitting/LevenbergMarquardt.java b/src/main/java/neqsim/statistics/parameterFitting/nonLinearParameterFitting/LevenbergMarquardt.java index ab0682cd4..64dc6d3ca 100644 --- a/src/main/java/neqsim/statistics/parameterFitting/nonLinearParameterFitting/LevenbergMarquardt.java +++ b/src/main/java/neqsim/statistics/parameterFitting/nonLinearParameterFitting/LevenbergMarquardt.java @@ -124,12 +124,12 @@ public static void main(String[] args) { /* * LevenbergMarquardt optim = new LevenbergMarquardt(); TestFunction testFunction = new * TestFunction(); // optim.setFunction(testFunction); - * + * * SampleValue[] sample = new SampleValue[3]; double sample1[] = { 6 }; sample[0] = new * SampleValue(8.5,0.1,sample1); double sample2[] = { 4 }; sample[1] = new * SampleValue(5.5,0.1,sample2); double sample3[] = { 4 }; sample[2] = new * SampleValue(5.51,0.1,sample3); - * + * * SampleSet sampleSet = new SampleSet(sample); sampleSet = * sampleSet.createNewNormalDistributedSet(); optim.setSampleSet(sampleSet); optim.solve(); * optim.runMonteCarloSimulation(); diff --git a/src/main/java/neqsim/thermo/ThermodynamicModelTest.java b/src/main/java/neqsim/thermo/ThermodynamicModelTest.java index 9edbd34cb..668ef92a0 100644 --- a/src/main/java/neqsim/thermo/ThermodynamicModelTest.java +++ b/src/main/java/neqsim/thermo/ThermodynamicModelTest.java @@ -422,6 +422,7 @@ public boolean checkNumerically() { } /** + * Setter for property maxError. * * @param maxErr before test will report failed Set maximum allowed error in model check */ diff --git a/src/main/java/neqsim/thermo/atomElement/UNIFACgroup.java b/src/main/java/neqsim/thermo/atomElement/UNIFACgroup.java index 8587b6f34..df47c2495 100644 --- a/src/main/java/neqsim/thermo/atomElement/UNIFACgroup.java +++ b/src/main/java/neqsim/thermo/atomElement/UNIFACgroup.java @@ -284,7 +284,7 @@ public double calcXComp(ComponentGEUnifac component) { } /* * public double calcXMix(PhaseGEUnifac phase) { double temp = 0.0, temp2 = 0.0, tempVal = 0.0; - * + * * for (int j = 0; j < phase.getNumberOfComponents(); j++) { for (int i = 0; i < * ((ComponentGEUnifac) phase.getComponent(j)).getNumberOfUNIFACgroups(); i++) { tempVal = * phase.getComponent(j).getNumberOfMolesInPhase() * ((ComponentGEUnifac) @@ -409,7 +409,7 @@ public double getQMixdN(int comp) { } /* * public double getXMixdN(int comp) { return xMixdN[comp]; } - * + * * public void setXMixdN(double[] xMixdN) { this.xMixdN = xMixdN; } */ diff --git a/src/main/java/neqsim/thermo/characterization/Characterise.java b/src/main/java/neqsim/thermo/characterization/Characterise.java index 56c8dfb76..4f2c64a69 100644 --- a/src/main/java/neqsim/thermo/characterization/Characterise.java +++ b/src/main/java/neqsim/thermo/characterization/Characterise.java @@ -27,7 +27,9 @@ public class Characterise implements java.io.Serializable, Cloneable { protected TBPfractionModel TBPfractionModelSelector; /** - *

Constructor for Characterise.

+ *

+ * Constructor for Characterise. + *

*/ public Characterise() {} @@ -163,17 +165,14 @@ public void characterisePlusFraction() { } /* - * * public boolean addPlusFraction(int start, int end) { plusFractionModel = new * PlusCharacterize(system); if (TBPCharacterise.hasPlusFraction()) { * TBPCharacterise.groupTBPfractions(); TBPCharacterise.generateTBPFractions(); return true; } * else { System.out.println("not able to generate pluss fraction"); return false; } } * - * * public boolean characterize2() { if (TBPCharacterise.groupTBPfractions()) { * TBPCharacterise.solve(); return true; } else { System.out.println("not able to generate pluss * fraction"); return false; } } * - * */ } diff --git a/src/main/java/neqsim/thermo/component/ComponentEos.java b/src/main/java/neqsim/thermo/component/ComponentEos.java index 0ef2e5001..935d52ae0 100644 --- a/src/main/java/neqsim/thermo/component/ComponentEos.java +++ b/src/main/java/neqsim/thermo/component/ComponentEos.java @@ -106,7 +106,6 @@ public ComponentEos(String name, double moles, double molesInPhase, int compInde * @param M Molar mass * @param a Acentric factor * @param moles Number of moles - * */ public ComponentEos(int number, double TC, double PC, double M, double a, double moles) { super(number, TC, PC, M, a, moles); @@ -227,7 +226,7 @@ public AttractiveTermInterface getAttractiveTerm() { /** * Get reduced temperature. - * + * * @param temperature temperature of fluid * @return double reduced temperature T/TC */ diff --git a/src/main/java/neqsim/thermo/component/ComponentGE.java b/src/main/java/neqsim/thermo/component/ComponentGE.java index de8ced038..0260c74be 100644 --- a/src/main/java/neqsim/thermo/component/ComponentGE.java +++ b/src/main/java/neqsim/thermo/component/ComponentGE.java @@ -12,6 +12,7 @@ import neqsim.thermo.phase.PhaseInterface; /** + * Abstract class ComponentGE. * * @author Even Solbraa */ diff --git a/src/main/java/neqsim/thermo/component/ComponentGENRTLmodifiedWS.java b/src/main/java/neqsim/thermo/component/ComponentGENRTLmodifiedWS.java index 145fa1fc2..65b12537f 100644 --- a/src/main/java/neqsim/thermo/component/ComponentGENRTLmodifiedWS.java +++ b/src/main/java/neqsim/thermo/component/ComponentGENRTLmodifiedWS.java @@ -233,7 +233,7 @@ public double getGamma(PhaseInterface phase, int numberOfComponents, double temp - dA6dTetter); /* * if(w==0){ dlngammadtold = dlngammadt; temperature +=0.0001; } - * + * * if(w==1){ lngammaold = lngamma; temperature -=0.0002; } } */ // System.out.println("deriv: " + lngammaold + " " + lngamma + " " + diff --git a/src/main/java/neqsim/thermo/component/ComponentGEUnifac.java b/src/main/java/neqsim/thermo/component/ComponentGEUnifac.java index 96d42b9c3..642d9f6cc 100644 --- a/src/main/java/neqsim/thermo/component/ComponentGEUnifac.java +++ b/src/main/java/neqsim/thermo/component/ComponentGEUnifac.java @@ -262,15 +262,13 @@ public double fugcoefDiffTemp(PhaseInterface phase, int numberOfComponents, doub * numberOfComponents, temperature, pressure, pt)); return * NumericalDerivative.fugcoefDiffPres(this, phase, numberOfComponents, temperature, pressure, * pt); } - * + * * public double fugcoefDiffTemp(PhaseInterface phase, int numberOfComponents, double temperature, * double pressure, PhaseType pt){ NumericalDerivative deriv = new NumericalDerivative(); // * System.out.println("dfugdT : " + NumericalDerivative.fugcoefDiffTemp(this, phase, * numberOfComponents, temperature, pressure, pt)); return * NumericalDerivative.fugcoefDiffTemp(this, phase, numberOfComponents, temperature, pressure, - * pt); - * - * } + * pt); } */ /** diff --git a/src/main/java/neqsim/thermo/component/ComponentGEUniquac.java b/src/main/java/neqsim/thermo/component/ComponentGEUniquac.java index c56439751..cfb9592e6 100644 --- a/src/main/java/neqsim/thermo/component/ComponentGEUniquac.java +++ b/src/main/java/neqsim/thermo/component/ComponentGEUniquac.java @@ -111,47 +111,44 @@ public double getGamma(PhaseInterface phase, int numberOfComponents, double temp /* * double V = 0, F = 0, a, gammaC = 0, gammaR = 0, temp1 = 0, temp2 = 0, temp3=0, temp4 = 0, * temp5=0, gamma; int j, k; - * - * + * * ComponentGEInterface[] compArray = (ComponentGEInterface[]) phase.getcomponentArray(); - * - * + * * for (j=0;j< numberOfComponents;j++){ - * + * * temp1 = temp1 + compArray[j].getx()*((ComponentGEUniquac) compArray[j]).getr(); temp2 = temp2 * + (((ComponentGEUniquac) compArray[j]).getq() * compArray[j].getx()); } - * - * + * * V = V + this.getr() / temp1; //System.out.println("V: " + V); F = F + this.getq() / temp2; * //System.out.println("F: " + F); - * + * * gammaC = 1 - V + Math.log(V) - 5 * this.getq() * (1 - V/F + Math.log(V/F)); - * + * * // System.out.println("gammaC: " + gammaC); - * + * * temp1 = 0; temp2 = 0; temp3 = 0; - * + * * for (k=0;k< numberOfComponents;k++){ temp4 = 0; temp4 = * (intparam[compArray[k].getIndex()][this.getIndex()]/temperature); temp1 = temp1 + * compArray[k].getq() * compArray[k].getx() * * Math.exp(-intparam[compArray[k].getIndex()][this.getIndex()]/temperature); temp2 = temp2 + * compArray[k].getq() * compArray[k].getx(); } - * + * * for (k=0;k< numberOfComponents;k++){ temp5 = 0; for (j=0;j< numberOfComponents;j++){ temp5 = * temp5 + compArray[j].getq() * compArray[j].getx() * * Math.exp(-intparam[compArray[j].getIndex()][compArray[k].getIndex()]/ temperature); - * + * * } - * + * * temp3 = temp3 + (compArray[k].getq() * compArray[k].getx() * Math.exp(- * intparam[this.getIndex()][compArray[k].getIndex()]/temperature)) / temp5; } - * + * * gammaR = this.getq() * (1 - Math.log(temp1/temp2) - temp3); - * + * * //System.out.println("gammaR: " + gammaR); - * + * * gamma = Math.exp(gammaR + gammaC); - * + * * //System.out.println("comp: " + this.getIndex() + " gamma NRTL : " +gamma); * //System.out.println("gamma: " + gamma); */ @@ -202,14 +199,14 @@ public double fugcoefDiffTemp(PhaseInterface phase, int numberOfComponents, doub * numberOfComponents, temperature, pressure, pt)); return * NumericalDerivative.fugcoefDiffPres(this, phase, numberOfComponents, temperature, pressure, * pt); } - * + * * public double fugcoefDiffTemp(PhaseInterface phase, int numberOfComponents, double temperature, * double pressure, PhaseType pt){ NumericalDerivative deriv = new NumericalDerivative(); // * System.out.println("dfugdT : " + NumericalDerivative.fugcoefDiffTemp(this, phase, * numberOfComponents, temperature, pressure, pt)); return * NumericalDerivative.fugcoefDiffTemp(this, phase, numberOfComponents, temperature, pressure, * pt); - * + * * } */ diff --git a/src/main/java/neqsim/thermo/component/ComponentGEUniquacmodifiedHV.java b/src/main/java/neqsim/thermo/component/ComponentGEUniquacmodifiedHV.java index 6ade2c3b1..a0c16c996 100644 --- a/src/main/java/neqsim/thermo/component/ComponentGEUniquacmodifiedHV.java +++ b/src/main/java/neqsim/thermo/component/ComponentGEUniquacmodifiedHV.java @@ -10,7 +10,8 @@ import neqsim.thermo.phase.PhaseType; /** - * + * Abstract class ComponentGEUniquacmodifiedHV + * * @author Even Solbraa */ abstract class ComponentGEUniquacmodifiedHV extends ComponentGEUniquac { diff --git a/src/main/java/neqsim/thermo/component/ComponentGeDuanSun.java b/src/main/java/neqsim/thermo/component/ComponentGeDuanSun.java index eff4dd2b7..041723bfc 100644 --- a/src/main/java/neqsim/thermo/component/ComponentGeDuanSun.java +++ b/src/main/java/neqsim/thermo/component/ComponentGeDuanSun.java @@ -223,7 +223,7 @@ public double getGammaNRTL(PhaseInterface phase, int numberOfComponents, double - dA6dTetter); /* * if(w==0){ dlngammadtold = dlngammadt; temperature +=0.0001; } - * + * * if(w==1){ lngammaold = lngamma; temperature -=0.0002; } } */ // System.out.println("deriv: " + lngammaold + " " + lngamma + " " + @@ -292,9 +292,7 @@ public double getGammaNRTL(PhaseInterface phase, int numberOfComponents, double * public double getHenryCoef(double temperature) { // System.out.println("henry " + // * Math.exp(henryCoefParameter[0]+henryCoefParameter[1]/temperature+ * henryCoefParameter[2]*Math.log(temperature)+henryCoefParameter[3]*temperature )*100*0.01802); - * if (componentName.equals("CO2")) { // return } return super.getHenryCoef(temperature); - * - * } + * if (componentName.equals("CO2")) { // return } return super.getHenryCoef(temperature); } */ /** {@inheritDoc} */ @@ -522,7 +520,7 @@ public double getGammaPitzer(PhaseInterface phase, int numberOfComponents, doubl * double pressure, PhaseType pt){ dfugdp = (Math.log(fugcoef(phase, numberOfComponents, * temperature, pressure+0.01, pt))-Math.log(fugcoef(phase, numberOfComponents, temperature, * pressure-0.01, pt)))/0.02; return dfugdp; } - * + * * public double fugcoefDiffTemp(PhaseInterface phase, int numberOfComponents, double temperature, * double pressure, PhaseType pt){ dfugdt = (Math.log(fugcoef(phase, numberOfComponents, * temperature+0.01, pressure, pt))-Math.log(fugcoef(phase, numberOfComponents, temperature-0.01, diff --git a/src/main/java/neqsim/thermo/component/ComponentGeNRTL.java b/src/main/java/neqsim/thermo/component/ComponentGeNRTL.java index 0d060cce3..0e64f3926 100644 --- a/src/main/java/neqsim/thermo/component/ComponentGeNRTL.java +++ b/src/main/java/neqsim/thermo/component/ComponentGeNRTL.java @@ -190,7 +190,7 @@ public double getGamma(PhaseInterface phase, int numberOfComponents, double temp - dA6dTetter); /* * if(w==0){ dlngammadtold = dlngammadt; temperature +=0.0001; } - * + * * if(w==1){ lngammaold = lngamma; temperature -=0.0002; } } */ // System.out.println("deriv: " + lngammaold + " " + lngamma + " " + @@ -260,7 +260,7 @@ public double getGamma(PhaseInterface phase, int numberOfComponents, double temp * double pressure, PhaseType pt){ dfugdp = (Math.log(fugcoef(phase, numberOfComponents, * temperature, pressure+0.01, pt))-Math.log(fugcoef(phase, numberOfComponents, temperature, * pressure-0.01, pt)))/0.02; return dfugdp; } - * + * * public double fugcoefDiffTemp(PhaseInterface phase, int numberOfComponents, double temperature, * double pressure, PhaseType pt){ dfugdt = (Math.log(fugcoef(phase, numberOfComponents, * temperature+0.01, pressure, pt))-Math.log(fugcoef(phase, numberOfComponents, temperature-0.01, diff --git a/src/main/java/neqsim/thermo/component/ComponentHydrateGF.java b/src/main/java/neqsim/thermo/component/ComponentHydrateGF.java index dd3f1c106..499028913 100644 --- a/src/main/java/neqsim/thermo/component/ComponentHydrateGF.java +++ b/src/main/java/neqsim/thermo/component/ComponentHydrateGF.java @@ -134,7 +134,7 @@ public double fugcoef(PhaseInterface phase, int numberOfComps, double temp, doub * (getEmptyHydrateStructureVapourPressure(hydrateStructure, temp) * Math.exp(solvol / (R * * temp) * (pres - getEmptyHydrateStructureVapourPressure(hydrateStructure, temp)) * * 1e5))); - * + * */ // System.out.println("pointing " // +(Math.exp(solvol/(R*temp)*((pres-getEmptyHydrateStructureVapourPressure(hydrateStruct,temp))*1e5)))); diff --git a/src/main/java/neqsim/thermo/component/ComponentPrCPA.java b/src/main/java/neqsim/thermo/component/ComponentPrCPA.java index 02a847120..854c8d915 100644 --- a/src/main/java/neqsim/thermo/component/ComponentPrCPA.java +++ b/src/main/java/neqsim/thermo/component/ComponentPrCPA.java @@ -4,7 +4,8 @@ import neqsim.thermo.phase.PhaseInterface; /** - * + * Abstract class ComponentPrCPA. + * * @author Even Solbraa */ abstract class ComponentPrCPA extends ComponentPR implements ComponentCPAInterface { diff --git a/src/main/java/neqsim/thermo/phase/PhaseEos.java b/src/main/java/neqsim/thermo/phase/PhaseEos.java index d86008fd5..162b88bdf 100644 --- a/src/main/java/neqsim/thermo/phase/PhaseEos.java +++ b/src/main/java/neqsim/thermo/phase/PhaseEos.java @@ -14,6 +14,7 @@ import neqsim.thermo.mixingRule.EosMixingRulesInterface; /** + * Abstract class PhaseEos. * * @author Even Solbraa */ diff --git a/src/main/java/neqsim/thermo/phase/PhaseGEUniquacmodifiedHV.java b/src/main/java/neqsim/thermo/phase/PhaseGEUniquacmodifiedHV.java index 5d76fca72..6e69f0aa5 100644 --- a/src/main/java/neqsim/thermo/phase/PhaseGEUniquacmodifiedHV.java +++ b/src/main/java/neqsim/thermo/phase/PhaseGEUniquacmodifiedHV.java @@ -43,7 +43,7 @@ public double getExcessGibbsEnergy(PhaseInterface phase, int numberOfComponents, /* * ComponentGEInterface[] comp_Array = (ComponentGEInterface[]) this.getcomponentArray(); - * + * * for (int i = 0; i < numberOfComponents; i++) { GE = GE + comp_Array[i].getx() * * Math.log(comp_Array[i].getGamma(phase, numberOfComponents, temperature, pressure, pt)); } */ diff --git a/src/main/java/neqsim/thermo/phase/PhaseInterface.java b/src/main/java/neqsim/thermo/phase/PhaseInterface.java index b40def85e..f6d015a6a 100644 --- a/src/main/java/neqsim/thermo/phase/PhaseInterface.java +++ b/src/main/java/neqsim/thermo/phase/PhaseInterface.java @@ -716,7 +716,7 @@ public void init(double totalNumberOfMoles, int numberOfComponents, int initType *

* Change the number of moles of component of phase,i.e., numberOfMolesInPhase but do * not change the total number of moles of component in system. - * + * * NB! Phase fraction beta is not updated by this method. Must be done separately to * keep consistency between phase and component calculation of total number of moles in system. *

@@ -733,7 +733,7 @@ public default void addMoles(int component, double dn) { * Change the number of moles of component of phase, i.e., numberOfMolesInPhase, and * total number of moles of component in system, i.e., numberOfMoles with the same * amount. - * + * * NB! Phase fraction beta is not updated by this method. Must be done separately to * keep consistency between phase and component calculation of total number of moles in system. *

@@ -751,7 +751,7 @@ public default void addMolesChemReac(int component, double dn) { * Component properties for the number of moles of component of phase, i.e., * numberOfMolesInPhase, and total number of moles of component in system, i.e., * numberOfMoles with separate amounts. - * + * * NB! Phase fraction beta is not updated by this method. Must be done separately to * keep consistency between phase and component calculation of total number of moles in system. *

diff --git a/src/main/java/neqsim/thermo/phase/PhasePCSAFTRahmat.java b/src/main/java/neqsim/thermo/phase/PhasePCSAFTRahmat.java index bfb9af91f..ec9cef08b 100644 --- a/src/main/java/neqsim/thermo/phase/PhasePCSAFTRahmat.java +++ b/src/main/java/neqsim/thermo/phase/PhasePCSAFTRahmat.java @@ -1159,23 +1159,22 @@ public double molarVolume(double pressure, double temperature, double A, double * = 1.0 + Btemp/Math.pow(BonVold,2.0)*(Btemp/numberOfMolesInPhase*dFdVdV()); //dhh = * -2.0*Btemp/Math.pow(BonV,3.0)*(Btemp/numberOfMolesInPhase*dFdVdV())-Math.pow( * Btemp,2.0)/Math.pow(BonV,4.0)*(Btemp/numberOfMolesInPhase*dFdVdVdV()); - * + * * //made by Rahmat - * + * * BonV = BonVold - 0.5* (2* h * dh / ((2* Math.pow(dh,2) - h * dhh))); - * + * * double dBonV = BonV - BonVold; dhh = (dh - dhOld)/ dBonV; dhOld = dh; - * + * * hOld = h; - * - * + * * //d1 = - h/dh; //d2 = - dh/dhh; //BonV += d1; //*(1.0+0.5*-1.0); /* * if(Math.abs(d1/d2)<=1.0){ BonV += d1*(1.0+0.5*d1/d2); } else if(d1/d2<-1){ BonV += * d1*(1.0+0.5*-1.0); } else if(d1/d2>1){ BonV += d2; double hnew = h +d2*-h/d1; * if(Math.abs(hnew)>Math.abs(h)){ System.out.println("volume correction needed...."); BonV = * phase== 1 ? 2.0/(2.0+temperature/getPseudoCriticalTemperature()):pressure*getB()/( * numberOfMolesInPhase*temperature*R); } } - * + * * if(BonV>1){ BonV=1.0-1.0e-6; BonVold=10; } if (BonV < 0) { BonV = 1.0e-16; BonVold = 10; } */ // setMolarVolume(1.0 / BonV * Btemp / numberOfMolesInPhase); @@ -1190,10 +1189,10 @@ public double molarVolume(double pressure, double temperature, double A, double /* * if(BonV<0){ BonV = pressure*getB()/(numberOfMolesInPhase*temperature*R); setMolarVolume(1.0 / * BonV * Btemp / numberOfMolesInPhase); Z = pressure*getMolarVolume()/(R*temperature); - * + * * } if(iterations>=6000) throw new util.exception.TooManyIterationsException(); * if(Double.isNaN(getMolarVolume())) throw new util.exception.IsNaNException(); - * + * * // if(pt==0) System.out.println("density " + getDensity()); //"BonV: " + BonV + * " "+" itert: " + iterations +" " + " phase " + pt+ " " + h + " " +dh + " B " + Btemp + * " D " + Dtemp + " gv" + gV() + " fv " + fv() + " fvv" + fVV()); diff --git a/src/main/java/neqsim/thermo/phase/PhaseSrkCPA.java b/src/main/java/neqsim/thermo/phase/PhaseSrkCPA.java index d05d5d4ee..c52af5f19 100644 --- a/src/main/java/neqsim/thermo/phase/PhaseSrkCPA.java +++ b/src/main/java/neqsim/thermo/phase/PhaseSrkCPA.java @@ -781,7 +781,7 @@ public double molarVolume(double pressure, double temperature, double A, double * // BonV = 0.9999; // BonV = pt == 1 ? 2.0 / (2.0 + temperature / * getPseudoCriticalTemperature()) : pressure * getB() / (numberOfMolesInPhase * temperature * * R); } - * + * * } else if (BonV < 0) { if (iterations < 10) { BonV = Math.abs(BonVold + BonV) / 2.0; } else * { // BonV = calcRootVolFinder(pt); // return molarVolumeChangePhase(pressure, temperature, * A, B, pt); // BonV = pt == 1 ? 2.0 / (2.0 + temperature / getPseudoCriticalTemperature()) : diff --git a/src/main/java/neqsim/thermo/phase/PhaseUMRCPA.java b/src/main/java/neqsim/thermo/phase/PhaseUMRCPA.java index 42014b296..3be502e18 100644 --- a/src/main/java/neqsim/thermo/phase/PhaseUMRCPA.java +++ b/src/main/java/neqsim/thermo/phase/PhaseUMRCPA.java @@ -781,7 +781,7 @@ public double molarVolume(double pressure, double temperature, double A, double * // BonV = 0.9999; // BonV = pt == 1 ? 2.0 / (2.0 + temperature / * getPseudoCriticalTemperature()) : pressure * getB() / (numberOfMolesInPhase * temperature * * R); } - * + * * } else if (BonV < 0) { if (iterations < 10) { BonV = Math.abs(BonVold + BonV) / 2.0; } else * { // BonV = calcRootVolFinder(pt); // return molarVolumeChangePhase(pressure, temperature, * A, B, pt); // BonV = pt == 1 ? 2.0 / (2.0 + temperature / getPseudoCriticalTemperature()) : diff --git a/src/main/java/neqsim/thermo/system/SystemInterface.java b/src/main/java/neqsim/thermo/system/SystemInterface.java index 75db75ed2..c2ff5a80c 100644 --- a/src/main/java/neqsim/thermo/system/SystemInterface.java +++ b/src/main/java/neqsim/thermo/system/SystemInterface.java @@ -1181,7 +1181,7 @@ public default void addComponent(String name) { /** *

* Getter for property beta. - * + * * Gets value for heaviest phase. *

* diff --git a/src/main/java/neqsim/thermo/system/SystemThermo.java b/src/main/java/neqsim/thermo/system/SystemThermo.java index 5888d3650..9f651ca93 100644 --- a/src/main/java/neqsim/thermo/system/SystemThermo.java +++ b/src/main/java/neqsim/thermo/system/SystemThermo.java @@ -3070,7 +3070,7 @@ public final double getSumBeta() { /** * Verify if beta array has valid values and sum is approximately equal to 1. - * + * * @return True if beta values are valid. False indicates that a flash must be done. */ public final boolean isBetaValid() { @@ -3888,9 +3888,9 @@ public void saveObject(int ID, String text) { * if (!text.isEmpty()) { ps = con.prepareStatement( * "REPLACE INTO fluidinfo (ID, TEXT) VALUES (?,?)"); ps.setInt(1, ID); ps.setString(2, text); * } - * + * * ps.executeUpdate(); - * + * */ } catch (Exception ex) { logger.error(ex.getMessage(), ex); diff --git a/src/main/java/neqsim/thermo/util/GERG/DETAIL.java b/src/main/java/neqsim/thermo/util/GERG/DETAIL.java index fe951a20d..6371beb56 100644 --- a/src/main/java/neqsim/thermo/util/GERG/DETAIL.java +++ b/src/main/java/neqsim/thermo/util/GERG/DETAIL.java @@ -13,1545 +13,1541 @@ * @version $Id: $Id */ public class DETAIL { - // The compositions in the x() array use the following order and must be sent as - // mole fractions: - // 0 - PLACEHOLDER - // 1 - Methane - // 2 - Nitrogen - // 3 - Carbon dioxide - // 4 - Ethane - // 5 - Propane - // 6 - Isobutane - // 7 - n-Butane - // 8 - Isopentane - // 9 - n-Pentane - // 10 - n-Hexane - // 11 - n-Heptane - // 12 - n-Octane - // 13 - n-Nonane - // 14 - n-Decane - // 15 - Hydrogen - // 16 - Oxygen - // 17 - Carbon monoxide - // 18 - Water - // 19 - Hydrogen sulfide - // 20 - Helium - // 21 - Argon - // - // For example, a mixture (in moles) of 94% methane, 5% CO2, and 1% helium would - // be (in mole fractions): - // x(1)=0.94, x(3)=0.05, x(20)=0.01 - - // Variables containing the common parameters in the DETAIL equations - double RDetail; - int NcDetail = 21, MaxFlds = 21, NTerms = 58; - double epsilon = 1e-15; - int[] fn = new int[NTerms + 1]; - int[] gn = new int[NTerms + 1]; - int[] qn = new int[NTerms + 1]; - double[] an = new double[NTerms + 1]; - double[] un = new double[NTerms + 1]; - int[] bn = new int[NTerms + 1]; - int[] kn = new int[NTerms + 1]; - - double[][][] Bsnij2 = new double[MaxFlds + 1][MaxFlds + 1][18 + 1]; - double[] Bs = new double[18 + 1]; - double[] Csn = new double[NTerms + 1]; - - double[] Fi = new double[MaxFlds + 1]; - double[] Gi = new double[MaxFlds + 1]; - double[] Qi = new double[MaxFlds + 1]; - - double[] Ki25 = new double[MaxFlds + 1]; - double[] Ei25 = new double[MaxFlds + 1]; - - double[][] Kij5 = new double[MaxFlds + 1][MaxFlds + 1]; - double[][] Uij5 = new double[MaxFlds + 1][MaxFlds + 1]; - double[][] Gij5 = new double[MaxFlds + 1][MaxFlds + 1]; - - double[] Tun = new double[NTerms + 1]; - double Told; - double[][] n0i = new double[MaxFlds + 1][7 + 1]; - double[][] th0i = new double[MaxFlds + 1][7 + 1]; - - double[] MMiDetail = new double[MaxFlds + 1]; - double[] xold = new double[MaxFlds + 1]; - double K3; - double dPdDsave; - - /** - *

- * sq. - *

- * - * @param x a double - * @return a double - */ - public double sq(double x) { - return x * x; + // The compositions in the x() array use the following order and must be sent as + // mole fractions: + // 0 - PLACEHOLDER + // 1 - Methane + // 2 - Nitrogen + // 3 - Carbon dioxide + // 4 - Ethane + // 5 - Propane + // 6 - Isobutane + // 7 - n-Butane + // 8 - Isopentane + // 9 - n-Pentane + // 10 - n-Hexane + // 11 - n-Heptane + // 12 - n-Octane + // 13 - n-Nonane + // 14 - n-Decane + // 15 - Hydrogen + // 16 - Oxygen + // 17 - Carbon monoxide + // 18 - Water + // 19 - Hydrogen sulfide + // 20 - Helium + // 21 - Argon + // + // For example, a mixture (in moles) of 94% methane, 5% CO2, and 1% helium would + // be (in mole fractions): + // x(1)=0.94, x(3)=0.05, x(20)=0.01 + + // Variables containing the common parameters in the DETAIL equations + double RDetail; + int NcDetail = 21, MaxFlds = 21, NTerms = 58; + double epsilon = 1e-15; + int[] fn = new int[NTerms + 1]; + int[] gn = new int[NTerms + 1]; + int[] qn = new int[NTerms + 1]; + double[] an = new double[NTerms + 1]; + double[] un = new double[NTerms + 1]; + int[] bn = new int[NTerms + 1]; + int[] kn = new int[NTerms + 1]; + + double[][][] Bsnij2 = new double[MaxFlds + 1][MaxFlds + 1][18 + 1]; + double[] Bs = new double[18 + 1]; + double[] Csn = new double[NTerms + 1]; + + double[] Fi = new double[MaxFlds + 1]; + double[] Gi = new double[MaxFlds + 1]; + double[] Qi = new double[MaxFlds + 1]; + + double[] Ki25 = new double[MaxFlds + 1]; + double[] Ei25 = new double[MaxFlds + 1]; + + double[][] Kij5 = new double[MaxFlds + 1][MaxFlds + 1]; + double[][] Uij5 = new double[MaxFlds + 1][MaxFlds + 1]; + double[][] Gij5 = new double[MaxFlds + 1][MaxFlds + 1]; + + double[] Tun = new double[NTerms + 1]; + double Told; + double[][] n0i = new double[MaxFlds + 1][7 + 1]; + double[][] th0i = new double[MaxFlds + 1][7 + 1]; + + double[] MMiDetail = new double[MaxFlds + 1]; + double[] xold = new double[MaxFlds + 1]; + double K3; + double dPdDsave; + + /** + *

+ * sq. + *

+ * + * @param x a double + * @return a double + */ + public double sq(double x) { + return x * x; + } + + /** + *

+ * MolarMassDetail. + *

+ * + * @param x an array of {@link double} objects + * @param Mm a {@link org.netlib.util.doubleW} object + */ + public void MolarMassDetail(double[] x, doubleW Mm) { + // Calculate molar mass of the mixture with the compositions contained in the + // x() input array + + // Inputs: + // x() - Composition (mole fraction) + // Do not send mole percents or mass fractions in the x() array, otherwise the + // output will be incorrect. + // The sum of the compositions in the x() array must be equal to one. + // The order of the fluids in this array is given at the top of this code. + + // Outputs: + // Mm - Molar mass (g/mol) + + Mm.val = 0; + for (int i = 1; i <= NcDetail; ++i) { + Mm.val += x[i] * MMiDetail[i]; } - - /** - *

- * MolarMassDetail. - *

- * - * @param x an array of {@link double} objects - * @param Mm a {@link org.netlib.util.doubleW} object - */ - public void MolarMassDetail(double[] x, doubleW Mm) { - // Calculate molar mass of the mixture with the compositions contained in the - // x() input array - - // Inputs: - // x() - Composition (mole fraction) - // Do not send mole percents or mass fractions in the x() array, otherwise the - // output will be incorrect. - // The sum of the compositions in the x() array must be equal to one. - // The order of the fluids in this array is given at the top of this code. - - // Outputs: - // Mm - Molar mass (g/mol) - - Mm.val = 0; - for (int i = 1; i <= NcDetail; ++i) { - Mm.val += x[i] * MMiDetail[i]; - } + } + + /** + *

+ * PressureDetail. + *

+ * + * @param T a double + * @param D a double + * @param x an array of {@link double} objects + * @param P a {@link org.netlib.util.doubleW} object + * @param Z a {@link org.netlib.util.doubleW} object + */ + public void PressureDetail(double T, double D, double[] x, doubleW P, doubleW Z) { + // Sub Pressure(T, D, x, P, Z) + + // Calculate pressure as a function of temperature and density. The derivative + // d(P)/d(D) is also calculated + // for use in the iterative DensityDetail subroutine (and is only returned as a + // common variable). + + // Inputs: + // T - Temperature (K) + // D - Density (mol/l) + // x() - Composition (mole fraction) + // Do not send mole percents or mass fractions in the x() array, otherwise the + // output will be incorrect. + // The sum of the compositions in the x() array must be equal to one. + + // Outputs: + // P - Pressure (kPa) + // Z - Compressibility factor + // dPdDsave - d(P)/d(D) [kPa/(mol/l)] (at constant temperature) + // - This variable is cached in the common variables for use in the iterative + // density solver, but not returned as an argument. + + doubleW[][] ar = new doubleW[3 + 1][3 + 1]; + for (int i = 0; i < 4; i++) { + for (int j = 0; j < 4; j++) { + ar[i][j] = new doubleW(0.0d); + } } - - /** - *

- * PressureDetail. - *

- * - * @param T a double - * @param D a double - * @param x an array of {@link double} objects - * @param P a {@link org.netlib.util.doubleW} object - * @param Z a {@link org.netlib.util.doubleW} object - */ - public void PressureDetail(double T, double D, double[] x, doubleW P, doubleW Z) { - // Sub Pressure(T, D, x, P, Z) - - // Calculate pressure as a function of temperature and density. The derivative - // d(P)/d(D) is also calculated - // for use in the iterative DensityDetail subroutine (and is only returned as a - // common variable). - - // Inputs: - // T - Temperature (K) - // D - Density (mol/l) - // x() - Composition (mole fraction) - // Do not send mole percents or mass fractions in the x() array, otherwise the - // output will be incorrect. - // The sum of the compositions in the x() array must be equal to one. - - // Outputs: - // P - Pressure (kPa) - // Z - Compressibility factor - // dPdDsave - d(P)/d(D) [kPa/(mol/l)] (at constant temperature) - // - This variable is cached in the common variables for use in the iterative - // density solver, but not returned as an argument. - - doubleW[][] ar = new doubleW[3 + 1][3 + 1]; - for (int i = 0; i < 4; i++) { - for (int j = 0; j < 4; j++) { - ar[i][j] = new doubleW(0.0d); - } - } - xTermsDetail(x); - AlpharDetail(0, 2, T, D, ar); - Z.val = 1 + ar[0][1].val / RDetail / T; // ar(0,1) is the first derivative of alpha(r) with - // respect to density - P.val = D * RDetail * T * Z.val; - dPdDsave = RDetail * T + 2 * ar[0][1].val + ar[0][2].val; // d(P)/d(D) for use in density - // iteration + xTermsDetail(x); + AlpharDetail(0, 2, T, D, ar); + Z.val = 1 + ar[0][1].val / RDetail / T; // ar(0,1) is the first derivative of alpha(r) with + // respect to density + P.val = D * RDetail * T * Z.val; + dPdDsave = RDetail * T + 2 * ar[0][1].val + ar[0][2].val; // d(P)/d(D) for use in density + // iteration + } + + /** + *

+ * DensityDetail. + *

+ * + * @param T a double + * @param P a double + * @param x an array of {@link double} objects + * @param D a {@link org.netlib.util.doubleW} object + * @param ierr a {@link org.netlib.util.intW} object + * @param herr a {@link org.netlib.util.StringW} object + */ + public void DensityDetail(double T, double P, double[] x, doubleW D, intW ierr, StringW herr) { + // Sub DensityDetail(T, P, x, D, ierr, herr) + + // Calculate density as a function of temperature and pressure. This is an + // iterative routine that calls PressureDetail + // to find the correct state point. Generally only 6 iterations at most are + // required. + // If the iteration fails to converge, the ideal gas density and an error + // message are returned. + // No checks are made to determine the phase boundary, which would have + // guaranteed that the output is in the gas phase. + // It is up to the user to locate the phase boundary, and thus identify the + // phase of the T and P inputs. + // If the state point is 2-phase, the output density will represent a metastable + // state. + + // Inputs: + // T - Temperature (K) + // P - Pressure (kPa) + // x() - Composition (mole fraction) + + // Outputs: + // D - Density (mol/l) (make D negative and send as an input to use as an + // initial guess) + // ierr - Error number (0 indicates no error) + // herr - Error message if ierr is not equal to zero + + double plog, vlog, dpdlv, vdiff, tolr; + doubleW P2 = new doubleW(0.0d); + doubleW Z = new doubleW(0.0d); + ierr.val = 0; + herr.val = ""; + if (Math.abs(P) < epsilon) { + D.val = 0.0; + return; } - - /** - *

- * DensityDetail. - *

- * - * @param T a double - * @param P a double - * @param x an array of {@link double} objects - * @param D a {@link org.netlib.util.doubleW} object - * @param ierr a {@link org.netlib.util.intW} object - * @param herr a {@link org.netlib.util.StringW} object - */ - public void DensityDetail(double T, double P, double[] x, doubleW D, intW ierr, - StringW herr) { - // Sub DensityDetail(T, P, x, D, ierr, herr) - - // Calculate density as a function of temperature and pressure. This is an - // iterative routine that calls PressureDetail - // to find the correct state point. Generally only 6 iterations at most are - // required. - // If the iteration fails to converge, the ideal gas density and an error - // message are returned. - // No checks are made to determine the phase boundary, which would have - // guaranteed that the output is in the gas phase. - // It is up to the user to locate the phase boundary, and thus identify the - // phase of the T and P inputs. - // If the state point is 2-phase, the output density will represent a metastable - // state. - - // Inputs: - // T - Temperature (K) - // P - Pressure (kPa) - // x() - Composition (mole fraction) - - // Outputs: - // D - Density (mol/l) (make D negative and send as an input to use as an - // initial guess) - // ierr - Error number (0 indicates no error) - // herr - Error message if ierr is not equal to zero - - double plog, vlog, dpdlv, vdiff, tolr; - doubleW P2 = new doubleW(0.0d); - doubleW Z = new doubleW(0.0d); - ierr.val = 0; - herr.val = ""; - if (Math.abs(P) < epsilon) { - D.val = 0.0; - return; - } - tolr = 0.0000001; - if (D.val > -epsilon) { - D.val = P / RDetail / T; // Ideal gas estimate - } else { - D.val = Math.abs(D.val); // If D<0, then use as initial estimate - } - plog = Math.log(P); - vlog = -Math.log(D.val); - for (int it = 1; it <= 20; ++it) { - if (vlog < -7 || vlog > 100) { - ierr.val = 1; - herr.val = - "Calculation failed to converge in DETAIL method, ideal gas density returned."; - D.val = P / RDetail / T; - return; - } - D.val = Math.exp(-vlog); - PressureDetail(T, D.val, x, P2, Z); - if (dPdDsave < epsilon || P2.val < epsilon) { - vlog += 0.1; - } else { - // Find the next density with a first order Newton's type iterative scheme, with - // log(P) as the known variable and log(v) as the unknown property. - // See AGA 8 publication for further information. - dpdlv = -D.val * dPdDsave; // d(p)/d[log(v)] - vdiff = (Math.log(P2.val) - plog) * P2.val / dpdlv; - vlog = vlog - vdiff; - if (Math.abs(vdiff) < tolr) { - D.val = Math.exp(-vlog); - return; // Iteration converged - } - } - } + tolr = 0.0000001; + if (D.val > -epsilon) { + D.val = P / RDetail / T; // Ideal gas estimate + } else { + D.val = Math.abs(D.val); // If D<0, then use as initial estimate + } + plog = Math.log(P); + vlog = -Math.log(D.val); + for (int it = 1; it <= 20; ++it) { + if (vlog < -7 || vlog > 100) { ierr.val = 1; herr.val = "Calculation failed to converge in DETAIL method, ideal gas density returned."; D.val = P / RDetail / T; return; - } - - /** - *

- * PropertiesDetail. - *

- * - * @param T a double - * @param D a double - * @param x an array of {@link double} objects - * @param P a {@link org.netlib.util.doubleW} object - * @param Z a {@link org.netlib.util.doubleW} object - * @param dPdD a {@link org.netlib.util.doubleW} object - * @param d2PdD2 a {@link org.netlib.util.doubleW} object - * @param d2PdTD a {@link org.netlib.util.doubleW} object - * @param dPdT a {@link org.netlib.util.doubleW} object - * @param U a {@link org.netlib.util.doubleW} object - * @param H a {@link org.netlib.util.doubleW} object - * @param S a {@link org.netlib.util.doubleW} object - * @param Cv a {@link org.netlib.util.doubleW} object - * @param Cp a {@link org.netlib.util.doubleW} object - * @param W a {@link org.netlib.util.doubleW} object - * @param G a {@link org.netlib.util.doubleW} object - * @param JT a {@link org.netlib.util.doubleW} object - * @param Kappa a {@link org.netlib.util.doubleW} object - */ - public void PropertiesDetail(double T, double D, double[] x, doubleW P, doubleW Z, - doubleW dPdD, doubleW d2PdD2, doubleW d2PdTD, doubleW dPdT, doubleW U, doubleW H, - doubleW S, doubleW Cv, doubleW Cp, doubleW W, doubleW G, doubleW JT, doubleW Kappa) { - // Sub Properties(T, D, x, P, Z, dPdD, d2PdD2, d2PdTD, dPdT, U, H, S, Cv, Cp, W, - // G, JT, Kappa) - - // Calculate thermodynamic properties as a function of temperature and density. - // Calls are made to the subroutines - // Molarmass, Alpha0Detail, and AlpharDetail. If the density is not known, call - // subroutine DensityDetail first - // with the known values of pressure and temperature. - - // Inputs: - // T - Temperature (K) - // D - Density (mol/l) - // x() - Composition (mole fraction) - - // Outputs: - // P - Pressure (kPa) - // Z - Compressibility factor - // dPdD - First derivative of pressure with respect to density at constant - // temperature [kPa/(mol/l)] - // d2PdD2 - Second derivative of pressure with respect to density at constant - // temperature [kPa/(mol/l)^2] - // d2PdTD - Second derivative of pressure with respect to temperature and - // density [kPa/(mol/l)/K] (currently not calculated) - // dPdT - First derivative of pressure with respect to temperature at constant - // density (kPa/K) - // U - Internal energy (J/mol) - // H - Enthalpy (J/mol) - // S - Entropy [J/(mol-K)] - // Cv - Isochoric heat capacity [J/(mol-K)] - // Cp - Isobaric heat capacity [J/(mol-K)] - // W - Speed of sound (m/s) - // G - Gibbs energy (J/mol) - // JT - Joule-Thomson coefficient (K/kPa) - // Kappa - Isentropic Exponent - doubleW A = new doubleW(0.0d); - doubleW[] a0 = new doubleW[2 + 1]; - for (int i = 0; i < 3; i++) { - a0[i] = new doubleW(0.0d); + } + D.val = Math.exp(-vlog); + PressureDetail(T, D.val, x, P2, Z); + if (dPdDsave < epsilon || P2.val < epsilon) { + vlog += 0.1; + } else { + // Find the next density with a first order Newton's type iterative scheme, with + // log(P) as the known variable and log(v) as the unknown property. + // See AGA 8 publication for further information. + dpdlv = -D.val * dPdDsave; // d(p)/d[log(v)] + vdiff = (Math.log(P2.val) - plog) * P2.val / dpdlv; + vlog = vlog - vdiff; + if (Math.abs(vdiff) < tolr) { + D.val = Math.exp(-vlog); + return; // Iteration converged } - doubleW[][] ar = new doubleW[3 + 1][3 + 1]; + } + } + ierr.val = 1; + herr.val = "Calculation failed to converge in DETAIL method, ideal gas density returned."; + D.val = P / RDetail / T; + return; + } + + /** + *

+ * PropertiesDetail. + *

+ * + * @param T a double + * @param D a double + * @param x an array of {@link double} objects + * @param P a {@link org.netlib.util.doubleW} object + * @param Z a {@link org.netlib.util.doubleW} object + * @param dPdD a {@link org.netlib.util.doubleW} object + * @param d2PdD2 a {@link org.netlib.util.doubleW} object + * @param d2PdTD a {@link org.netlib.util.doubleW} object + * @param dPdT a {@link org.netlib.util.doubleW} object + * @param U a {@link org.netlib.util.doubleW} object + * @param H a {@link org.netlib.util.doubleW} object + * @param S a {@link org.netlib.util.doubleW} object + * @param Cv a {@link org.netlib.util.doubleW} object + * @param Cp a {@link org.netlib.util.doubleW} object + * @param W a {@link org.netlib.util.doubleW} object + * @param G a {@link org.netlib.util.doubleW} object + * @param JT a {@link org.netlib.util.doubleW} object + * @param Kappa a {@link org.netlib.util.doubleW} object + */ + public void PropertiesDetail(double T, double D, double[] x, doubleW P, doubleW Z, doubleW dPdD, + doubleW d2PdD2, doubleW d2PdTD, doubleW dPdT, doubleW U, doubleW H, doubleW S, doubleW Cv, + doubleW Cp, doubleW W, doubleW G, doubleW JT, doubleW Kappa) { + // Sub Properties(T, D, x, P, Z, dPdD, d2PdD2, d2PdTD, dPdT, U, H, S, Cv, Cp, W, + // G, JT, Kappa) + + // Calculate thermodynamic properties as a function of temperature and density. + // Calls are made to the subroutines + // Molarmass, Alpha0Detail, and AlpharDetail. If the density is not known, call + // subroutine DensityDetail first + // with the known values of pressure and temperature. + + // Inputs: + // T - Temperature (K) + // D - Density (mol/l) + // x() - Composition (mole fraction) + + // Outputs: + // P - Pressure (kPa) + // Z - Compressibility factor + // dPdD - First derivative of pressure with respect to density at constant + // temperature [kPa/(mol/l)] + // d2PdD2 - Second derivative of pressure with respect to density at constant + // temperature [kPa/(mol/l)^2] + // d2PdTD - Second derivative of pressure with respect to temperature and + // density [kPa/(mol/l)/K] (currently not calculated) + // dPdT - First derivative of pressure with respect to temperature at constant + // density (kPa/K) + // U - Internal energy (J/mol) + // H - Enthalpy (J/mol) + // S - Entropy [J/(mol-K)] + // Cv - Isochoric heat capacity [J/(mol-K)] + // Cp - Isobaric heat capacity [J/(mol-K)] + // W - Speed of sound (m/s) + // G - Gibbs energy (J/mol) + // JT - Joule-Thomson coefficient (K/kPa) + // Kappa - Isentropic Exponent + doubleW A = new doubleW(0.0d); + doubleW[] a0 = new doubleW[2 + 1]; + for (int i = 0; i < 3; i++) { + a0[i] = new doubleW(0.0d); + } + doubleW[][] ar = new doubleW[3 + 1][3 + 1]; - for (int i = 0; i < 4; i++) { - for (int j = 0; j < 4; j++) { - ar[i][j] = new doubleW(0.0d); - } - } - doubleW Mm = new doubleW(0.0d); - MolarMassDetail(x, Mm); - xTermsDetail(x); - - // Calculate the ideal gas Helmholtz energy, and its first and second - // derivatives with respect to temperature. - Alpha0Detail(T, D, x, a0); - - // Calculate the real gas Helmholtz energy, and its derivatives with respect to - // temperature and/or density. - AlpharDetail(2, 3, T, D, ar); - - double R = RDetail; - double RT = R * T; - Z.val = 1 + ar[0][1].val / RT; - P.val = D * RT * Z.val; - dPdD.val = RT + 2 * ar[0][1].val + ar[0][2].val; - dPdT.val = D * R + D * ar[1][1].val; - A.val = a0[0].val + ar[0][0].val; - S.val = -a0[1].val - ar[1][0].val; - U.val = A.val + T * S.val; - Cv.val = -(a0[2].val + ar[2][0].val); - if (D > epsilon) { - H.val = U.val + P.val / D; - G.val = A.val + P.val / D; - Cp.val = Cv.val + T * sq(dPdT.val / D) / dPdD.val; - d2PdD2.val = (2 * ar[0][1].val + 4 * ar[0][2].val + ar[0][3].val) / D; - JT.val = (T / D * dPdT.val / dPdD.val - 1) / Cp.val / D; - } else { - H.val = U.val + RT; - G.val = A.val + RT; - Cp.val = Cv.val + R; - d2PdD2.val = 0; - JT.val = 1E+20; // =(dB/dT*T-B)/Cp for an ideal gas, but dB/dT is not calculated here - } - W.val = 1000 * Cp.val / Cv.val * dPdD.val / Mm.val; - if (W.val < 0) { - W.val = 0; - } - W.val = Math.sqrt(W.val); - Kappa.val = W.val * W.val * Mm.val / (RT * 1000 * Z.val); - d2PdTD.val = 0; + for (int i = 0; i < 4; i++) { + for (int j = 0; j < 4; j++) { + ar[i][j] = new doubleW(0.0d); + } + } + doubleW Mm = new doubleW(0.0d); + MolarMassDetail(x, Mm); + xTermsDetail(x); + + // Calculate the ideal gas Helmholtz energy, and its first and second + // derivatives with respect to temperature. + Alpha0Detail(T, D, x, a0); + + // Calculate the real gas Helmholtz energy, and its derivatives with respect to + // temperature and/or density. + AlpharDetail(2, 3, T, D, ar); + + double R = RDetail; + double RT = R * T; + Z.val = 1 + ar[0][1].val / RT; + P.val = D * RT * Z.val; + dPdD.val = RT + 2 * ar[0][1].val + ar[0][2].val; + dPdT.val = D * R + D * ar[1][1].val; + A.val = a0[0].val + ar[0][0].val; + S.val = -a0[1].val - ar[1][0].val; + U.val = A.val + T * S.val; + Cv.val = -(a0[2].val + ar[2][0].val); + if (D > epsilon) { + H.val = U.val + P.val / D; + G.val = A.val + P.val / D; + Cp.val = Cv.val + T * sq(dPdT.val / D) / dPdD.val; + d2PdD2.val = (2 * ar[0][1].val + 4 * ar[0][2].val + ar[0][3].val) / D; + JT.val = (T / D * dPdT.val / dPdD.val - 1) / Cp.val / D; + } else { + H.val = U.val + RT; + G.val = A.val + RT; + Cp.val = Cv.val + R; + d2PdD2.val = 0; + JT.val = 1E+20; // =(dB/dT*T-B)/Cp for an ideal gas, but dB/dT is not calculated here + } + W.val = 1000 * Cp.val / Cv.val * dPdD.val / Mm.val; + if (W.val < 0) { + W.val = 0; + } + W.val = Math.sqrt(W.val); + Kappa.val = W.val * W.val * Mm.val / (RT * 1000 * Z.val); + d2PdTD.val = 0; + } + + /** + * // Calculate terms dependent only on composition + * + * @param x Composition (mole fraction) + */ + // The following routines are low-level routines that should not be called outside of this code. + void xTermsDetail(double[] x) { + double G, Q, F, U, Q2, xij, xi2; + int icheck; + + // Check to see if a component fraction has changed. If x is the same as the + // previous call, then exit. + icheck = 0; + for (int i = 1; i <= NcDetail; ++i) { + if (Math.abs(x[i] - xold[i]) > 0.0000001) { + icheck = 1; + } + xold[i] = x[i]; + } + if (icheck == 0) { + return; } - /** - * // Calculate terms dependent only on composition - * - * @param x Composition (mole fraction) - */ - // The following routines are low-level routines that should not be called outside of this code. - void xTermsDetail(double[] x) { - double G, Q, F, U, Q2, xij, xi2; - int icheck; - - // Check to see if a component fraction has changed. If x is the same as the - // previous call, then exit. - icheck = 0; - for (int i = 1; i <= NcDetail; ++i) { - if (Math.abs(x[i] - xold[i]) > 0.0000001) { - icheck = 1; - } - xold[i] = x[i]; - } - if (icheck == 0) { - return; - } + K3 = 0; + U = 0; + G = 0; + Q = 0; + F = 0; + for (int n = 1; n <= 18; ++n) { + Bs[n] = 0; + } - K3 = 0; - U = 0; - G = 0; - Q = 0; - F = 0; + // Calculate pure fluid contributions + for (int i = 1; i <= NcDetail; ++i) { + if (x[i] > 0) { + xi2 = sq(x[i]); + K3 += x[i] * Ki25[i]; // K, U, and G are the sums of a pure fluid contribution and a + U += x[i] * Ei25[i]; // binary pair contribution + G += x[i] * Gi[i]; + Q += x[i] * Qi[i]; // Q and F depend only on the pure fluid parts + F += xi2 * Fi[i]; for (int n = 1; n <= 18; ++n) { - Bs[n] = 0; - } - - // Calculate pure fluid contributions - for (int i = 1; i <= NcDetail; ++i) { - if (x[i] > 0) { - xi2 = sq(x[i]); - K3 += x[i] * Ki25[i]; // K, U, and G are the sums of a pure fluid contribution and a - U += x[i] * Ei25[i]; // binary pair contribution - G += x[i] * Gi[i]; - Q += x[i] * Qi[i]; // Q and F depend only on the pure fluid parts - F += xi2 * Fi[i]; - for (int n = 1; n <= 18; ++n) { - Bs[n] = Bs[n] + xi2 * Bsnij2[i][i][n]; // Pure fluid contributions to second - // virial coefficient - } - } - } - K3 = sq(K3); - U = sq(U); - - // Binary pair contributions - for (int i = 1; i <= NcDetail - 1; ++i) { - if (x[i] > 0) { - for (int j = i + 1; j <= NcDetail; ++j) { - if (x[j] > 0) { - xij = 2 * x[i] * x[j]; - K3 = K3 + xij * Kij5[i][j]; - U = U + xij * Uij5[i][j]; - G = G + xij * Gij5[i][j]; - for (int n = 1; n <= 18; ++n) { - Bs[n] = Bs[n] + xij * Bsnij2[i][j][n]; // Second virial coefficients of - // mixture - } - } - } - } - } - K3 = Math.pow(K3, 0.6); - U = Math.pow(U, 0.2); - - // Third virial and higher coefficients - Q2 = sq(Q); - for (int n = 13; n <= 58; ++n) { - Csn[n] = an[n] * Math.pow(U, un[n]); - if (gn[n] == 1) { - Csn[n] = Csn[n] * G; - } - if (qn[n] == 1) { - Csn[n] = Csn[n] * Q2; - } - if (fn[n] == 1) { - Csn[n] = Csn[n] * F; - } + Bs[n] = Bs[n] + xi2 * Bsnij2[i][i][n]; // Pure fluid contributions to second + // virial coefficient } + } } - - /** - * @param T ... - * @param D ... - * @param x ... - * @param a0 ... - */ - void Alpha0Detail(double T, double D, double[] x, doubleW[] a0) { - // Private Sub Alpha0Detail(T, D, x, a0) - - // Calculate the ideal gas Helmholtz energy and its derivatives with respect to - // T and D. - // This routine is not needed when only P (or Z) is calculated. - - // Inputs: - // T - Temperature (K) - // D - Density (mol/l) - // x() - Composition (mole fraction) - - // Outputs: - // a0(0) - Ideal gas Helmholtz energy (J/mol) - // a0(1) - partial (a0)/partial(T) [J/(mol-K)] - // a0(2) - T*partial^2(a0)/partial(T)^2 [J/(mol-K)] - - double LogT, LogD, LogHyp, th0T, LogxD; - double SumHyp0, SumHyp1, SumHyp2; - double em, ep, hcn, hsn; - - a0[0].val = 0; - a0[1].val = 0; - a0[2].val = 0; - - if (D > epsilon) { - LogD = Math.log(D); - } else { - LogD = Math.log(epsilon); - } - LogT = Math.log(T); - for (int i = 1; i <= NcDetail; ++i) { - if (x[i] > 0) { - LogxD = LogD + Math.log(x[i]); - SumHyp0 = 0; - SumHyp1 = 0; - SumHyp2 = 0; - for (int j = 4; j <= 7; ++j) { - if (th0i[i][j] > 0) { - th0T = th0i[i][j] / T; - ep = Math.exp(th0T); - em = 1 / ep; - hsn = (ep - em) / 2; - hcn = (ep + em) / 2; - if (j == 4 || j == 6) { - LogHyp = Math.log(Math.abs(hsn)); - SumHyp0 += n0i[i][j] * LogHyp; - SumHyp1 += n0i[i][j] * (LogHyp - th0T * hcn / hsn); - SumHyp2 += n0i[i][j] * sq(th0T / hsn); - } else { - LogHyp = Math.log(Math.abs(hcn)); - SumHyp0 += -n0i[i][j] * LogHyp; - SumHyp1 += -n0i[i][j] * (LogHyp - th0T * hsn / hcn); - SumHyp2 += +n0i[i][j] * sq(th0T / hcn); - } - } - } - a0[0].val += - x[i] * (LogxD + n0i[i][1] + n0i[i][2] / T - n0i[i][3] * LogT + SumHyp0); - a0[1].val += x[i] * (LogxD + n0i[i][1] - n0i[i][3] * (1 + LogT) + SumHyp1); - a0[2].val += -x[i] * (n0i[i][3] + SumHyp2); + K3 = sq(K3); + U = sq(U); + + // Binary pair contributions + for (int i = 1; i <= NcDetail - 1; ++i) { + if (x[i] > 0) { + for (int j = i + 1; j <= NcDetail; ++j) { + if (x[j] > 0) { + xij = 2 * x[i] * x[j]; + K3 = K3 + xij * Kij5[i][j]; + U = U + xij * Uij5[i][j]; + G = G + xij * Gij5[i][j]; + for (int n = 1; n <= 18; ++n) { + Bs[n] = Bs[n] + xij * Bsnij2[i][j][n]; // Second virial coefficients of + // mixture } + } } - a0[0].val = a0[0].val * RDetail * T; - a0[1].val = a0[1].val * RDetail; - a0[2].val = a0[2].val * RDetail; + } } - - /** - * @param itau .... - * @param idel ... - * @param T ... - * @param D ... - * @param ar ... - */ - void AlpharDetail(int itau, int idel, double T, double D, doubleW[][] ar) { - // Private Sub AlpharDetail(itau, idel, T, D, ar) - - // Calculate the derivatives of the residual Helmholtz energy (ar) with respect - // to T and D. - // itau and idel are inputs that contain the highest derivatives needed. - // Outputs are returned in the array ar. - // Subroutine xTerms must be called before this routine if x has changed - - // Inputs: - // itau - Set this to 1 to calculate "ar" derivatives with respect to T [i.e., - // ar(1,0), ar(1,1), and ar(2,0)], otherwise set it to 0. - // idel - Currently not used, but kept as an input for future use in specifing - // the highest density derivative needed. - // T - Temperature (K) - // D - Density (mol/l) - - // Outputs: - // ar(0,0) - Residual Helmholtz energy (J/mol) - // ar(0,1) - D*partial (ar)/partial(D) (J/mol) - // ar(0,2) - D^2*partial^2(ar)/partial(D)^2 (J/mol) - // ar(0,3) - D^3*partial^3(ar)/partial(D)^3 (J/mol) - // ar(1,0) - partial (ar)/partial(T) [J/(mol-K)] - // ar(1,1) - D*partial^2(ar)/partial(D)/partial(T) [J/(mol-K)] - // ar(2,0) - T*partial^2(ar)/partial(T)^2 [J/(mol-K)] - - double ckd, bkd, Dred; - double Sum, s0, s1, s2, s3, RT; - double[] Sum0 = new double[NTerms + 1]; - double[] SumB = new double[NTerms + 1]; - double[] Dknn = new double[9 + 1]; - double[] Expn = new double[4 + 1]; - - double[] CoefD1 = new double[NTerms + 1]; - double[] CoefD2 = new double[NTerms + 1]; - double[] CoefD3 = new double[NTerms + 1]; - - double[] CoefT1 = new double[NTerms + 1]; - double[] CoefT2 = new double[NTerms + 1]; - - for (int i = 0; i < 3; ++i) { - for (int j = 0; j < 3; ++j) { - ar[i][j].val = 0; - } - } - if (Math.abs(T - Told) > 0.0000001) { - for (int n = 1; n <= 58; ++n) { - Tun[n] = Math.pow(T, -un[n]); - } - } - Told = T; - - // Precalculation of common powers and exponents of density - Dred = K3 * D; - Dknn[0] = 1; - for (int n = 1; n <= 9; ++n) { - Dknn[n] = Dred * Dknn[n - 1]; - } - Expn[0] = 1; - for (int n = 1; n <= 4; ++n) { - Expn[n] = Math.exp(-Dknn[n]); - } - RT = RDetail * T; - - for (int n = 1; n <= 58; ++n) { - // Contributions to the Helmholtz energy and its derivatives with respect to - // temperature - CoefT1[n] = RDetail * (un[n] - 1); - CoefT2[n] = CoefT1[n] * un[n]; - // Contributions to the virial coefficients - SumB[n] = 0; - Sum0[n] = 0; - if (n <= 18) { - Sum = Bs[n] * D; - if (n >= 13) { - Sum += -Csn[n] * Dred; - } - SumB[n] = Sum * Tun[n]; - } - if (n >= 13) { - // Contributions to the residual part of the Helmholtz energy - Sum0[n] = Csn[n] * Dknn[bn[n]] * Tun[n] * Expn[kn[n]]; - // Contributions to the derivatives of the Helmholtz energy with respect to - // density - bkd = bn[n] - kn[n] * Dknn[kn[n]]; - ckd = kn[n] * kn[n] * Dknn[kn[n]]; - CoefD1[n] = bkd; - CoefD2[n] = bkd * (bkd - 1) - ckd; - CoefD3[n] = (bkd - 2) * CoefD2[n] + ckd * (1 - kn[n] - 2 * bkd); + K3 = Math.pow(K3, 0.6); + U = Math.pow(U, 0.2); + + // Third virial and higher coefficients + Q2 = sq(Q); + for (int n = 13; n <= 58; ++n) { + Csn[n] = an[n] * Math.pow(U, un[n]); + if (gn[n] == 1) { + Csn[n] = Csn[n] * G; + } + if (qn[n] == 1) { + Csn[n] = Csn[n] * Q2; + } + if (fn[n] == 1) { + Csn[n] = Csn[n] * F; + } + } + } + + /** + * @param T ... + * @param D ... + * @param x ... + * @param a0 ... + */ + void Alpha0Detail(double T, double D, double[] x, doubleW[] a0) { + // Private Sub Alpha0Detail(T, D, x, a0) + + // Calculate the ideal gas Helmholtz energy and its derivatives with respect to + // T and D. + // This routine is not needed when only P (or Z) is calculated. + + // Inputs: + // T - Temperature (K) + // D - Density (mol/l) + // x() - Composition (mole fraction) + + // Outputs: + // a0(0) - Ideal gas Helmholtz energy (J/mol) + // a0(1) - partial (a0)/partial(T) [J/(mol-K)] + // a0(2) - T*partial^2(a0)/partial(T)^2 [J/(mol-K)] + + double LogT, LogD, LogHyp, th0T, LogxD; + double SumHyp0, SumHyp1, SumHyp2; + double em, ep, hcn, hsn; + + a0[0].val = 0; + a0[1].val = 0; + a0[2].val = 0; + + if (D > epsilon) { + LogD = Math.log(D); + } else { + LogD = Math.log(epsilon); + } + LogT = Math.log(T); + for (int i = 1; i <= NcDetail; ++i) { + if (x[i] > 0) { + LogxD = LogD + Math.log(x[i]); + SumHyp0 = 0; + SumHyp1 = 0; + SumHyp2 = 0; + for (int j = 4; j <= 7; ++j) { + if (th0i[i][j] > 0) { + th0T = th0i[i][j] / T; + ep = Math.exp(th0T); + em = 1 / ep; + hsn = (ep - em) / 2; + hcn = (ep + em) / 2; + if (j == 4 || j == 6) { + LogHyp = Math.log(Math.abs(hsn)); + SumHyp0 += n0i[i][j] * LogHyp; + SumHyp1 += n0i[i][j] * (LogHyp - th0T * hcn / hsn); + SumHyp2 += n0i[i][j] * sq(th0T / hsn); } else { - CoefD1[n] = 0; - CoefD2[n] = 0; - CoefD3[n] = 0; + LogHyp = Math.log(Math.abs(hcn)); + SumHyp0 += -n0i[i][j] * LogHyp; + SumHyp1 += -n0i[i][j] * (LogHyp - th0T * hsn / hcn); + SumHyp2 += +n0i[i][j] * sq(th0T / hcn); } + } } + a0[0].val += x[i] * (LogxD + n0i[i][1] + n0i[i][2] / T - n0i[i][3] * LogT + SumHyp0); + a0[1].val += x[i] * (LogxD + n0i[i][1] - n0i[i][3] * (1 + LogT) + SumHyp1); + a0[2].val += -x[i] * (n0i[i][3] + SumHyp2); + } + } + a0[0].val = a0[0].val * RDetail * T; + a0[1].val = a0[1].val * RDetail; + a0[2].val = a0[2].val * RDetail; + } + + /** + * @param itau .... + * @param idel ... + * @param T ... + * @param D ... + * @param ar ... + */ + void AlpharDetail(int itau, int idel, double T, double D, doubleW[][] ar) { + // Private Sub AlpharDetail(itau, idel, T, D, ar) + + // Calculate the derivatives of the residual Helmholtz energy (ar) with respect + // to T and D. + // itau and idel are inputs that contain the highest derivatives needed. + // Outputs are returned in the array ar. + // Subroutine xTerms must be called before this routine if x has changed + + // Inputs: + // itau - Set this to 1 to calculate "ar" derivatives with respect to T [i.e., + // ar(1,0), ar(1,1), and ar(2,0)], otherwise set it to 0. + // idel - Currently not used, but kept as an input for future use in specifing + // the highest density derivative needed. + // T - Temperature (K) + // D - Density (mol/l) + + // Outputs: + // ar(0,0) - Residual Helmholtz energy (J/mol) + // ar(0,1) - D*partial (ar)/partial(D) (J/mol) + // ar(0,2) - D^2*partial^2(ar)/partial(D)^2 (J/mol) + // ar(0,3) - D^3*partial^3(ar)/partial(D)^3 (J/mol) + // ar(1,0) - partial (ar)/partial(T) [J/(mol-K)] + // ar(1,1) - D*partial^2(ar)/partial(D)/partial(T) [J/(mol-K)] + // ar(2,0) - T*partial^2(ar)/partial(T)^2 [J/(mol-K)] + + double ckd, bkd, Dred; + double Sum, s0, s1, s2, s3, RT; + double[] Sum0 = new double[NTerms + 1]; + double[] SumB = new double[NTerms + 1]; + double[] Dknn = new double[9 + 1]; + double[] Expn = new double[4 + 1]; + + double[] CoefD1 = new double[NTerms + 1]; + double[] CoefD2 = new double[NTerms + 1]; + double[] CoefD3 = new double[NTerms + 1]; + + double[] CoefT1 = new double[NTerms + 1]; + double[] CoefT2 = new double[NTerms + 1]; + + for (int i = 0; i < 3; ++i) { + for (int j = 0; j < 3; ++j) { + ar[i][j].val = 0; + } + } + if (Math.abs(T - Told) > 0.0000001) { + for (int n = 1; n <= 58; ++n) { + Tun[n] = Math.pow(T, -un[n]); + } + } + Told = T; - for (int n = 1; n <= 58; ++n) { - // Density derivatives - s0 = Sum0[n] + SumB[n]; - s1 = Sum0[n] * CoefD1[n] + SumB[n]; - s2 = Sum0[n] * CoefD2[n]; - s3 = Sum0[n] * CoefD3[n]; - ar[0][0].val = ar[0][0].val + RT * s0; - ar[0][1].val = ar[0][1].val + RT * s1; - ar[0][2].val = ar[0][2].val + RT * s2; - ar[0][3].val = ar[0][3].val + RT * s3; - // Temperature derivatives - if (itau > 0) { - ar[1][0].val = ar[1][0].val - CoefT1[n] * s0; - ar[1][1].val = ar[1][1].val - CoefT1[n] * s1; - ar[2][0].val = ar[2][0].val + CoefT2[n] * s0; - // The following are not used, but fully functional - // ar(1, 2) = ar(1, 2) - CoefT1(n) * s2; - // ar(1, 3) = ar(1, 3) - CoefT1(n) * s3; - // ar(2, 1) = ar(2, 1) + CoefT2(n) * s1; - // ar(2, 2) = ar(2, 2) + CoefT2(n) * s2; - // ar(2, 3) = ar(2, 3) + CoefT2(n) * s3; - } + // Precalculation of common powers and exponents of density + Dred = K3 * D; + Dknn[0] = 1; + for (int n = 1; n <= 9; ++n) { + Dknn[n] = Dred * Dknn[n - 1]; + } + Expn[0] = 1; + for (int n = 1; n <= 4; ++n) { + Expn[n] = Math.exp(-Dknn[n]); + } + RT = RDetail * T; + + for (int n = 1; n <= 58; ++n) { + // Contributions to the Helmholtz energy and its derivatives with respect to + // temperature + CoefT1[n] = RDetail * (un[n] - 1); + CoefT2[n] = CoefT1[n] * un[n]; + // Contributions to the virial coefficients + SumB[n] = 0; + Sum0[n] = 0; + if (n <= 18) { + Sum = Bs[n] * D; + if (n >= 13) { + Sum += -Csn[n] * Dred; } + SumB[n] = Sum * Tun[n]; + } + if (n >= 13) { + // Contributions to the residual part of the Helmholtz energy + Sum0[n] = Csn[n] * Dknn[bn[n]] * Tun[n] * Expn[kn[n]]; + // Contributions to the derivatives of the Helmholtz energy with respect to + // density + bkd = bn[n] - kn[n] * Dknn[kn[n]]; + ckd = kn[n] * kn[n] * Dknn[kn[n]]; + CoefD1[n] = bkd; + CoefD2[n] = bkd * (bkd - 1) - ckd; + CoefD3[n] = (bkd - 2) * CoefD2[n] + ckd * (1 - kn[n] - 2 * bkd); + } else { + CoefD1[n] = 0; + CoefD2[n] = 0; + CoefD3[n] = 0; + } } - // The following routine must be called once before any other routine. - /** - *

- * SetupDetail. - *

- */ - public void SetupDetail() { - // Initialize all the constants and parameters in the DETAIL model. - // Some values are modified for calculations that do not depend on T, D, and x - // in order to speed up the program. - - int[] sn = new int[NTerms + 1]; - int[] wn = new int[NTerms + 1]; - - double[] Ei = new double[MaxFlds + 1]; - double[] Ki = new double[MaxFlds + 1]; - double[] Si = new double[MaxFlds + 1]; - double[] Wi = new double[MaxFlds + 1]; - double Bsnij; - double[][] Kij = new double[MaxFlds + 1][MaxFlds + 1]; - double[][] Gij = new double[MaxFlds + 1][MaxFlds + 1]; - double[][] Eij = new double[MaxFlds + 1][MaxFlds + 1]; - double[][] Uij = new double[MaxFlds + 1][MaxFlds + 1]; - - double d0; - - RDetail = 8.31451; - - // Molar masses (g/mol) - MMiDetail[1] = 16.043; // Methane - MMiDetail[2] = 28.0135; // Nitrogen - MMiDetail[3] = 44.01; // Carbon dioxide - MMiDetail[4] = 30.07; // Ethane - MMiDetail[5] = 44.097; // Propane - MMiDetail[6] = 58.123; // Isobutane - MMiDetail[7] = 58.123; // n-Butane - MMiDetail[8] = 72.15; // Isopentane - MMiDetail[9] = 72.15; // n-Pentane - MMiDetail[10] = 86.177; // Hexane - MMiDetail[11] = 100.204; // Heptane - MMiDetail[12] = 114.231; // Octane - MMiDetail[13] = 128.258; // Nonane - MMiDetail[14] = 142.285; // Decane - MMiDetail[15] = 2.0159; // Hydrogen - MMiDetail[16] = 31.9988; // Oxygen - MMiDetail[17] = 28.01; // Carbon monoxide - MMiDetail[18] = 18.0153; // Water - MMiDetail[19] = 34.082; // Hydrogen sulfide - MMiDetail[20] = 4.0026; // Helium - MMiDetail[21] = 39.948; // Argon - - // Initialize constants - Told = 0; - for (int i = 1; i <= NTerms; ++i) { - an[i] = 0; - bn[i] = 0; - gn[i] = 0; - fn[i] = 0; - kn[i] = 0; - qn[i] = 0; - sn[i] = 0; - un[i] = 0; - wn[i] = 0; - } + for (int n = 1; n <= 58; ++n) { + // Density derivatives + s0 = Sum0[n] + SumB[n]; + s1 = Sum0[n] * CoefD1[n] + SumB[n]; + s2 = Sum0[n] * CoefD2[n]; + s3 = Sum0[n] * CoefD3[n]; + ar[0][0].val = ar[0][0].val + RT * s0; + ar[0][1].val = ar[0][1].val + RT * s1; + ar[0][2].val = ar[0][2].val + RT * s2; + ar[0][3].val = ar[0][3].val + RT * s3; + // Temperature derivatives + if (itau > 0) { + ar[1][0].val = ar[1][0].val - CoefT1[n] * s0; + ar[1][1].val = ar[1][1].val - CoefT1[n] * s1; + ar[2][0].val = ar[2][0].val + CoefT2[n] * s0; + // The following are not used, but fully functional + // ar(1, 2) = ar(1, 2) - CoefT1(n) * s2; + // ar(1, 3) = ar(1, 3) - CoefT1(n) * s3; + // ar(2, 1) = ar(2, 1) + CoefT2(n) * s1; + // ar(2, 2) = ar(2, 2) + CoefT2(n) * s2; + // ar(2, 3) = ar(2, 3) + CoefT2(n) * s3; + } + } + } + + // The following routine must be called once before any other routine. + /** + *

+ * SetupDetail. + *

+ */ + public void SetupDetail() { + // Initialize all the constants and parameters in the DETAIL model. + // Some values are modified for calculations that do not depend on T, D, and x + // in order to speed up the program. + + int[] sn = new int[NTerms + 1]; + int[] wn = new int[NTerms + 1]; + + double[] Ei = new double[MaxFlds + 1]; + double[] Ki = new double[MaxFlds + 1]; + double[] Si = new double[MaxFlds + 1]; + double[] Wi = new double[MaxFlds + 1]; + double Bsnij; + double[][] Kij = new double[MaxFlds + 1][MaxFlds + 1]; + double[][] Gij = new double[MaxFlds + 1][MaxFlds + 1]; + double[][] Eij = new double[MaxFlds + 1][MaxFlds + 1]; + double[][] Uij = new double[MaxFlds + 1][MaxFlds + 1]; + + double d0; + + RDetail = 8.31451; + + // Molar masses (g/mol) + MMiDetail[1] = 16.043; // Methane + MMiDetail[2] = 28.0135; // Nitrogen + MMiDetail[3] = 44.01; // Carbon dioxide + MMiDetail[4] = 30.07; // Ethane + MMiDetail[5] = 44.097; // Propane + MMiDetail[6] = 58.123; // Isobutane + MMiDetail[7] = 58.123; // n-Butane + MMiDetail[8] = 72.15; // Isopentane + MMiDetail[9] = 72.15; // n-Pentane + MMiDetail[10] = 86.177; // Hexane + MMiDetail[11] = 100.204; // Heptane + MMiDetail[12] = 114.231; // Octane + MMiDetail[13] = 128.258; // Nonane + MMiDetail[14] = 142.285; // Decane + MMiDetail[15] = 2.0159; // Hydrogen + MMiDetail[16] = 31.9988; // Oxygen + MMiDetail[17] = 28.01; // Carbon monoxide + MMiDetail[18] = 18.0153; // Water + MMiDetail[19] = 34.082; // Hydrogen sulfide + MMiDetail[20] = 4.0026; // Helium + MMiDetail[21] = 39.948; // Argon + + // Initialize constants + Told = 0; + for (int i = 1; i <= NTerms; ++i) { + an[i] = 0; + bn[i] = 0; + gn[i] = 0; + fn[i] = 0; + kn[i] = 0; + qn[i] = 0; + sn[i] = 0; + un[i] = 0; + wn[i] = 0; + } - for (int i = 1; i <= MaxFlds; ++i) { - Ei[i] = 0; - Fi[i] = 0; - Gi[i] = 0; - Ki[i] = 0; - Qi[i] = 0; - Si[i] = 0; - Wi[i] = 0; - xold[i] = 0; - for (int j = 1; j <= MaxFlds; ++j) { - Eij[i][j] = 1; - Gij[i][j] = 1; - Kij[i][j] = 1; - Uij[i][j] = 1; - } - } + for (int i = 1; i <= MaxFlds; ++i) { + Ei[i] = 0; + Fi[i] = 0; + Gi[i] = 0; + Ki[i] = 0; + Qi[i] = 0; + Si[i] = 0; + Wi[i] = 0; + xold[i] = 0; + for (int j = 1; j <= MaxFlds; ++j) { + Eij[i][j] = 1; + Gij[i][j] = 1; + Kij[i][j] = 1; + Uij[i][j] = 1; + } + } - // Coefficients of the equation of state - an[1] = 0.1538326; - an[2] = 1.341953; - an[3] = -2.998583; - an[4] = -0.04831228; - an[5] = 0.3757965; - an[6] = -1.589575; - an[7] = -0.05358847; - an[8] = 0.88659463; - an[9] = -0.71023704; - an[10] = -1.471722; - an[11] = 1.32185035; - an[12] = -0.78665925; - an[13] = 0.00000000229129; - an[14] = 0.1576724; - an[15] = -0.4363864; - an[16] = -0.04408159; - an[17] = -0.003433888; - an[18] = 0.03205905; - an[19] = 0.02487355; - an[20] = 0.07332279; - an[21] = -0.001600573; - an[22] = 0.6424706; - an[23] = -0.4162601; - an[24] = -0.06689957; - an[25] = 0.2791795; - an[26] = -0.6966051; - an[27] = -0.002860589; - an[28] = -0.008098836; - an[29] = 3.150547; - an[30] = 0.007224479; - an[31] = -0.7057529; - an[32] = 0.5349792; - an[33] = -0.07931491; - an[34] = -1.418465; - an[35] = -5.99905E-17; - an[36] = 0.1058402; - an[37] = 0.03431729; - an[38] = -0.007022847; - an[39] = 0.02495587; - an[40] = 0.04296818; - an[41] = 0.7465453; - an[42] = -0.2919613; - an[43] = 7.294616; - an[44] = -9.936757; - an[45] = -0.005399808; - an[46] = -0.2432567; - an[47] = 0.04987016; - an[48] = 0.003733797; - an[49] = 1.874951; - an[50] = 0.002168144; - an[51] = -0.6587164; - an[52] = 0.000205518; - an[53] = 0.009776195; - an[54] = -0.02048708; - an[55] = 0.01557322; - an[56] = 0.006862415; - an[57] = -0.001226752; - an[58] = 0.002850908; - - // Density exponents - bn[1] = 1; - bn[2] = 1; - bn[3] = 1; - bn[4] = 1; - bn[5] = 1; - bn[6] = 1; - bn[7] = 1; - bn[8] = 1; - bn[9] = 1; - bn[10] = 1; - bn[11] = 1; - bn[12] = 1; - bn[13] = 1; - bn[14] = 1; - bn[15] = 1; - bn[16] = 1; - bn[17] = 1; - bn[18] = 1; - bn[19] = 2; - bn[20] = 2; - bn[21] = 2; - bn[22] = 2; - bn[23] = 2; - bn[24] = 2; - bn[25] = 2; - bn[26] = 2; - bn[27] = 2; - bn[28] = 3; - bn[29] = 3; - bn[30] = 3; - bn[31] = 3; - bn[32] = 3; - bn[33] = 3; - bn[34] = 3; - bn[35] = 3; - bn[36] = 3; - bn[37] = 3; - bn[38] = 4; - bn[39] = 4; - bn[40] = 4; - bn[41] = 4; - bn[42] = 4; - bn[43] = 4; - bn[44] = 4; - bn[45] = 5; - bn[46] = 5; - bn[47] = 5; - bn[48] = 5; - bn[49] = 5; - bn[50] = 6; - bn[51] = 6; - bn[52] = 7; - bn[53] = 7; - bn[54] = 8; - bn[55] = 8; - bn[56] = 8; - bn[57] = 9; - bn[58] = 9; - - // Exponents on density in EXP[-cn*D^kn] part - // The cn part in this term is not included in this program since it is 1 when - // kn<>0][and 0 otherwise - kn[13] = 3; - kn[14] = 2; - kn[15] = 2; - kn[16] = 2; - kn[17] = 4; - kn[18] = 4; - kn[21] = 2; - kn[22] = 2; - kn[23] = 2; - kn[24] = 4; - kn[25] = 4; - kn[26] = 4; - kn[27] = 4; - kn[29] = 1; - kn[30] = 1; - kn[31] = 2; - kn[32] = 2; - kn[33] = 3; - kn[34] = 3; - kn[35] = 4; - kn[36] = 4; - kn[37] = 4; - kn[40] = 2; - kn[41] = 2; - kn[42] = 2; - kn[43] = 4; - kn[44] = 4; - kn[46] = 2; - kn[47] = 2; - kn[48] = 4; - kn[49] = 4; - kn[51] = 2; - kn[53] = 2; - kn[54] = 1; - kn[55] = 2; - kn[56] = 2; - kn[57] = 2; - kn[58] = 2; - - // Temperature exponents - un[1] = 0; - un[2] = 0.5; - un[3] = 1; - un[4] = 3.5; - un[5] = -0.5; - un[6] = 4.5; - un[7] = 0.5; - un[8] = 7.5; - un[9] = 9.5; - un[10] = 6; - un[11] = 12; - un[12] = 12.5; - un[13] = -6; - un[14] = 2; - un[15] = 3; - un[16] = 2; - un[17] = 2; - un[18] = 11; - un[19] = -0.5; - un[20] = 0.5; - un[21] = 0; - un[22] = 4; - un[23] = 6; - un[24] = 21; - un[25] = 23; - un[26] = 22; - un[27] = -1; - un[28] = -0.5; - un[29] = 7; - un[30] = -1; - un[31] = 6; - un[32] = 4; - un[33] = 1; - un[34] = 9; - un[35] = -13; - un[36] = 21; - un[37] = 8; - un[38] = -0.5; - un[39] = 0; - un[40] = 2; - un[41] = 7; - un[42] = 9; - un[43] = 22; - un[44] = 23; - un[45] = 1; - un[46] = 9; - un[47] = 3; - un[48] = 8; - un[49] = 23; - un[50] = 1.5; - un[51] = 5; - un[52] = -0.5; - un[53] = 4; - un[54] = 7; - un[55] = 3; - un[56] = 0; - un[57] = 1; - un[58] = 0; - - // Flags - fn[13] = 1; - fn[27] = 1; - fn[30] = 1; - fn[35] = 1; - gn[5] = 1; - gn[6] = 1; - gn[25] = 1; - gn[29] = 1; - gn[32] = 1; - gn[33] = 1; - gn[34] = 1; - gn[51] = 1; - gn[54] = 1; - gn[56] = 1; - qn[7] = 1; - qn[16] = 1; - qn[26] = 1; - qn[28] = 1; - qn[37] = 1; - qn[42] = 1; - qn[47] = 1; - qn[49] = 1; - qn[52] = 1; - qn[58] = 1; - sn[8] = 1; - sn[9] = 1; - wn[10] = 1; - wn[11] = 1; - wn[12] = 1; - - // Energy parameters - Ei[1] = 151.3183; - Ei[2] = 99.73778; - Ei[3] = 241.9606; - Ei[4] = 244.1667; - Ei[5] = 298.1183; - Ei[6] = 324.0689; - Ei[7] = 337.6389; - Ei[8] = 365.5999; - Ei[9] = 370.6823; - Ei[10] = 402.636293; - Ei[11] = 427.72263; - Ei[12] = 450.325022; - Ei[13] = 470.840891; - Ei[14] = 489.558373; - Ei[15] = 26.95794; - Ei[16] = 122.7667; - Ei[17] = 105.5348; - Ei[18] = 514.0156; - Ei[19] = 296.355; - Ei[20] = 2.610111; - Ei[21] = 119.6299; - - // Size parameters - Ki[1] = 0.4619255; - Ki[2] = 0.4479153; - Ki[3] = 0.4557489; - Ki[4] = 0.5279209; - Ki[5] = 0.583749; - Ki[6] = 0.6406937; - Ki[7] = 0.6341423; - Ki[8] = 0.6738577; - Ki[9] = 0.6798307; - Ki[10] = 0.7175118; - Ki[11] = 0.7525189; - Ki[12] = 0.784955; - Ki[13] = 0.8152731; - Ki[14] = 0.8437826; - Ki[15] = 0.3514916; - Ki[16] = 0.4186954; - Ki[17] = 0.4533894; - Ki[18] = 0.3825868; - Ki[19] = 0.4618263; - Ki[20] = 0.3589888; - Ki[21] = 0.4216551; - - // Orientation parameters - Gi[2] = 0.027815; - Gi[3] = 0.189065; - Gi[4] = 0.0793; - Gi[5] = 0.141239; - Gi[6] = 0.256692; - Gi[7] = 0.281835; - Gi[8] = 0.332267; - Gi[9] = 0.366911; - Gi[10] = 0.289731; - Gi[11] = 0.337542; - Gi[12] = 0.383381; - Gi[13] = 0.427354; - Gi[14] = 0.469659; - Gi[15] = 0.034369; - Gi[16] = 0.021; - Gi[17] = 0.038953; - Gi[18] = 0.3325; - Gi[19] = 0.0885; - - // Quadrupole parameters - Qi[3] = 0.69; - Qi[18] = 1.06775; - Qi[19] = 0.633276; - Fi[15] = 1; // High temperature parameter - Si[18] = 1.5822; // Dipole parameter - Si[19] = 0.39; // Dipole parameter - Wi[18] = 1; // Association parameter - - // Energy parameters - Eij[1][2] = 0.97164; - Eij[1][3] = 0.960644; - Eij[1][5] = 0.994635; - Eij[1][6] = 1.01953; - Eij[1][7] = 0.989844; - Eij[1][8] = 1.00235; - Eij[1][9] = 0.999268; - Eij[1][10] = 1.107274; - Eij[1][11] = 0.88088; - Eij[1][12] = 0.880973; - Eij[1][13] = 0.881067; - Eij[1][14] = 0.881161; - Eij[1][15] = 1.17052; - Eij[1][17] = 0.990126; - Eij[1][18] = 0.708218; - Eij[1][19] = 0.931484; - Eij[2][3] = 1.02274; - Eij[2][4] = 0.97012; - Eij[2][5] = 0.945939; - Eij[2][6] = 0.946914; - Eij[2][7] = 0.973384; - Eij[2][8] = 0.95934; - Eij[2][9] = 0.94552; - Eij[2][15] = 1.08632; - Eij[2][16] = 1.021; - Eij[2][17] = 1.00571; - Eij[2][18] = 0.746954; - Eij[2][19] = 0.902271; - Eij[3][4] = 0.925053; - Eij[3][5] = 0.960237; - Eij[3][6] = 0.906849; - Eij[3][7] = 0.897362; - Eij[3][8] = 0.726255; - Eij[3][9] = 0.859764; - Eij[3][10] = 0.855134; - Eij[3][11] = 0.831229; - Eij[3][12] = 0.80831; - Eij[3][13] = 0.786323; - Eij[3][14] = 0.765171; - Eij[3][15] = 1.28179; - Eij[3][17] = 1.5; - Eij[3][18] = 0.849408; - Eij[3][19] = 0.955052; - Eij[4][5] = 1.02256; - Eij[4][7] = 1.01306; - Eij[4][9] = 1.00532; - Eij[4][15] = 1.16446; - Eij[4][18] = 0.693168; - Eij[4][19] = 0.946871; - Eij[5][7] = 1.0049; - Eij[5][15] = 1.034787; - Eij[6][15] = 1.3; - Eij[7][15] = 1.3; - Eij[10][19] = 1.008692; - Eij[11][19] = 1.010126; - Eij[12][19] = 1.011501; - Eij[13][19] = 1.012821; - Eij[14][19] = 1.014089; - Eij[15][17] = 1.1; - - // Conformal energy parameters - Uij[1][2] = 0.886106; - Uij[1][3] = 0.963827; - Uij[1][5] = 0.990877; - Uij[1][7] = 0.992291; - Uij[1][9] = 1.00367; - Uij[1][10] = 1.302576; - Uij[1][11] = 1.191904; - Uij[1][12] = 1.205769; - Uij[1][13] = 1.219634; - Uij[1][14] = 1.233498; - Uij[1][15] = 1.15639; - Uij[1][19] = 0.736833; - Uij[2][3] = 0.835058; - Uij[2][4] = 0.816431; - Uij[2][5] = 0.915502; - Uij[2][7] = 0.993556; - Uij[2][15] = 0.408838; - Uij[2][19] = 0.993476; - Uij[3][4] = 0.96987; - Uij[3][10] = 1.066638; - Uij[3][11] = 1.077634; - Uij[3][12] = 1.088178; - Uij[3][13] = 1.098291; - Uij[3][14] = 1.108021; - Uij[3][17] = 0.9; - Uij[3][19] = 1.04529; - Uij[4][5] = 1.065173; - Uij[4][6] = 1.25; - Uij[4][7] = 1.25; - Uij[4][8] = 1.25; - Uij[4][9] = 1.25; - Uij[4][15] = 1.61666; - Uij[4][19] = 0.971926; - Uij[10][19] = 1.028973; - Uij[11][19] = 1.033754; - Uij[12][19] = 1.038338; - Uij[13][19] = 1.042735; - Uij[14][19] = 1.046966; - - // Size parameters - Kij[1][2] = 1.00363; - Kij[1][3] = 0.995933; - Kij[1][5] = 1.007619; - Kij[1][7] = 0.997596; - Kij[1][9] = 1.002529; - Kij[1][10] = 0.982962; - Kij[1][11] = 0.983565; - Kij[1][12] = 0.982707; - Kij[1][13] = 0.981849; - Kij[1][14] = 0.980991; - Kij[1][15] = 1.02326; - Kij[1][19] = 1.00008; - Kij[2][3] = 0.982361; - Kij[2][4] = 1.00796; - Kij[2][15] = 1.03227; - Kij[2][19] = 0.942596; - Kij[3][4] = 1.00851; - Kij[3][10] = 0.910183; - Kij[3][11] = 0.895362; - Kij[3][12] = 0.881152; - Kij[3][13] = 0.86752; - Kij[3][14] = 0.854406; - Kij[3][19] = 1.00779; - Kij[4][5] = 0.986893; - Kij[4][15] = 1.02034; - Kij[4][19] = 0.999969; - Kij[10][19] = 0.96813; - Kij[11][19] = 0.96287; - Kij[12][19] = 0.957828; - Kij[13][19] = 0.952441; - Kij[14][19] = 0.948338; - - // Orientation parameters - Gij[1][3] = 0.807653; - Gij[1][15] = 1.95731; - Gij[2][3] = 0.982746; - Gij[3][4] = 0.370296; - Gij[3][18] = 1.67309; - - // Ideal gas parameters - n0i[1][3] = 4.00088; - n0i[1][4] = 0.76315; - n0i[1][5] = 0.0046; - n0i[1][6] = 8.74432; - n0i[1][7] = -4.46921; - n0i[1][1] = 29.83843397; - n0i[1][2] = -15999.69151; - n0i[2][3] = 3.50031; - n0i[2][4] = 0.13732; - n0i[2][5] = -0.1466; - n0i[2][6] = 0.90066; - n0i[2][7] = 0; - n0i[2][1] = 17.56770785; - n0i[2][2] = -2801.729072; - n0i[3][3] = 3.50002; - n0i[3][4] = 2.04452; - n0i[3][5] = -1.06044; - n0i[3][6] = 2.03366; - n0i[3][7] = 0.01393; - n0i[3][1] = 20.65844696; - n0i[3][2] = -4902.171516; - n0i[4][3] = 4.00263; - n0i[4][4] = 4.33939; - n0i[4][5] = 1.23722; - n0i[4][6] = 13.1974; - n0i[4][7] = -6.01989; - n0i[4][1] = 36.73005938; - n0i[4][2] = -23639.65301; - n0i[5][3] = 4.02939; - n0i[5][4] = 6.60569; - n0i[5][5] = 3.197; - n0i[5][6] = 19.1921; - n0i[5][7] = -8.37267; - n0i[5][1] = 44.70909619; - n0i[5][2] = -31236.63551; - n0i[6][3] = 4.06714; - n0i[6][4] = 8.97575; - n0i[6][5] = 5.25156; - n0i[6][6] = 25.1423; - n0i[6][7] = 16.1388; - n0i[6][1] = 34.30180349; - n0i[6][2] = -38525.50276; - n0i[7][3] = 4.33944; - n0i[7][4] = 9.44893; - n0i[7][5] = 6.89406; - n0i[7][6] = 24.4618; - n0i[7][7] = 14.7824; - n0i[7][1] = 36.53237783; - n0i[7][2] = -38957.80933; - n0i[8][3] = 4; - n0i[8][4] = 11.7618; - n0i[8][5] = 20.1101; - n0i[8][6] = 33.1688; - n0i[8][7] = 0; - n0i[8][1] = 43.17218626; - n0i[8][2] = -51198.30946; - n0i[9][3] = 4; - n0i[9][4] = 8.95043; - n0i[9][5] = 21.836; - n0i[9][6] = 33.4032; - n0i[9][7] = 0; - n0i[9][1] = 42.67837089; - n0i[9][2] = -45215.83; - n0i[10][3] = 4; - n0i[10][4] = 11.6977; - n0i[10][5] = 26.8142; - n0i[10][6] = 38.6164; - n0i[10][7] = 0; - n0i[10][1] = 46.99717188; - n0i[10][2] = -52746.83318; - n0i[11][3] = 4; - n0i[11][4] = 13.7266; - n0i[11][5] = 30.4707; - n0i[11][6] = 43.5561; - n0i[11][7] = 0; - n0i[11][1] = 52.07631631; - n0i[11][2] = -57104.81056; - n0i[12][3] = 4; - n0i[12][4] = 15.6865; - n0i[12][5] = 33.8029; - n0i[12][6] = 48.1731; - n0i[12][7] = 0; - n0i[12][1] = 57.25830934; - n0i[12][2] = -60546.76385; - n0i[13][3] = 4; - n0i[13][4] = 18.0241; - n0i[13][5] = 38.1235; - n0i[13][6] = 53.3415; - n0i[13][7] = 0; - n0i[13][1] = 62.09646901; - n0i[13][2] = -66600.12837; - n0i[14][3] = 4; - n0i[14][4] = 21.0069; - n0i[14][5] = 43.4931; - n0i[14][6] = 58.3657; - n0i[14][7] = 0; - n0i[14][1] = 65.93909154; - n0i[14][2] = -74131.45483; - n0i[15][3] = 2.47906; - n0i[15][4] = 0.95806; - n0i[15][5] = 0.45444; - n0i[15][6] = 1.56039; - n0i[15][7] = -1.3756; - n0i[15][1] = 13.07520288; - n0i[15][2] = -5836.943696; - n0i[16][3] = 3.50146; - n0i[16][4] = 1.07558; - n0i[16][5] = 1.01334; - n0i[16][6] = 0; - n0i[16][7] = 0; - n0i[16][1] = 16.8017173; - n0i[16][2] = -2318.32269; - n0i[17][3] = 3.50055; - n0i[17][4] = 1.02865; - n0i[17][5] = 0.00493; - n0i[17][6] = 0; - n0i[17][7] = 0; - n0i[17][1] = 17.45786899; - n0i[17][2] = -2635.244116; - n0i[18][3] = 4.00392; - n0i[18][4] = 0.01059; - n0i[18][5] = 0.98763; - n0i[18][6] = 3.06904; - n0i[18][7] = 0; - n0i[18][1] = 21.57882705; - n0i[18][2] = -7766.733078; - n0i[19][3] = 4; - n0i[19][4] = 3.11942; - n0i[19][5] = 1.00243; - n0i[19][6] = 0; - n0i[19][7] = 0; - n0i[19][1] = 21.5830944; - n0i[19][2] = -6069.035869; - n0i[20][3] = 2.5; - n0i[20][4] = 0; - n0i[20][5] = 0; - n0i[20][6] = 0; - n0i[20][7] = 0; - n0i[20][1] = 10.04639507; - n0i[20][2] = -745.375; - n0i[21][3] = 2.5; - n0i[21][4] = 0; - n0i[21][5] = 0; - n0i[21][6] = 0; - n0i[21][7] = 0; - n0i[21][1] = 10.04639507; - n0i[21][2] = -745.375; - th0i[1][4] = 820.659; - th0i[1][5] = 178.41; - th0i[1][6] = 1062.82; - th0i[1][7] = 1090.53; - th0i[2][4] = 662.738; - th0i[2][5] = 680.562; - th0i[2][6] = 1740.06; - th0i[2][7] = 0; - th0i[3][4] = 919.306; - th0i[3][5] = 865.07; - th0i[3][6] = 483.553; - th0i[3][7] = 341.109; - th0i[4][4] = 559.314; - th0i[4][5] = 223.284; - th0i[4][6] = 1031.38; - th0i[4][7] = 1071.29; - th0i[5][4] = 479.856; - th0i[5][5] = 200.893; - th0i[5][6] = 955.312; - th0i[5][7] = 1027.29; - th0i[6][4] = 438.27; - th0i[6][5] = 198.018; - th0i[6][6] = 1905.02; - th0i[6][7] = 893.765; - th0i[7][4] = 468.27; - th0i[7][5] = 183.636; - th0i[7][6] = 1914.1; - th0i[7][7] = 903.185; - th0i[8][4] = 292.503; - th0i[8][5] = 910.237; - th0i[8][6] = 1919.37; - th0i[8][7] = 0; - th0i[9][4] = 178.67; - th0i[9][5] = 840.538; - th0i[9][6] = 1774.25; - th0i[9][7] = 0; - th0i[10][4] = 182.326; - th0i[10][5] = 859.207; - th0i[10][6] = 1826.59; - th0i[10][7] = 0; - th0i[11][4] = 169.789; - th0i[11][5] = 836.195; - th0i[11][6] = 1760.46; - th0i[11][7] = 0; - th0i[12][4] = 158.922; - th0i[12][5] = 815.064; - th0i[12][6] = 1693.07; - th0i[12][7] = 0; - th0i[13][4] = 156.854; - th0i[13][5] = 814.882; - th0i[13][6] = 1693.79; - th0i[13][7] = 0; - th0i[14][4] = 164.947; - th0i[14][5] = 836.264; - th0i[14][6] = 1750.24; - th0i[14][7] = 0; - th0i[15][4] = 228.734; - th0i[15][5] = 326.843; - th0i[15][6] = 1651.71; - th0i[15][7] = 1671.69; - th0i[16][4] = 2235.71; - th0i[16][5] = 1116.69; - th0i[16][6] = 0; - th0i[16][7] = 0; - th0i[17][4] = 1550.45; - th0i[17][5] = 704.525; - th0i[17][6] = 0; - th0i[17][7] = 0; - th0i[18][4] = 268.795; - th0i[18][5] = 1141.41; - th0i[18][6] = 2507.37; - th0i[18][7] = 0; - th0i[19][4] = 1833.63; - th0i[19][5] = 847.181; - th0i[19][6] = 0; - th0i[19][7] = 0; - th0i[20][4] = 0; - th0i[20][5] = 0; - th0i[20][6] = 0; - th0i[20][7] = 0; - th0i[21][4] = 0; - th0i[21][5] = 0; - th0i[21][6] = 0; - th0i[21][7] = 0; - - // Precalculations of constants - for (int i = 1; i <= MaxFlds; ++i) { - Ki25[i] = Math.pow(Ki[i], 2.5); - Ei25[i] = Math.pow(Ei[i], 2.5); - } - for (int i = 1; i <= MaxFlds; ++i) { - for (int j = i; j <= MaxFlds; ++j) { - for (int n = 1; n <= 18; ++n) { - Bsnij = 1; - if (gn[n] == 1) { - Bsnij = Gij[i][j] * (Gi[i] + Gi[j]) / 2; - } - if (qn[n] == 1) { - Bsnij = Bsnij * Qi[i] * Qi[j]; - } - if (fn[n] == 1) { - Bsnij = Bsnij * Fi[i] * Fi[j]; - } - if (sn[n] == 1) { - Bsnij = Bsnij * Si[i] * Si[j]; - } - if (wn[n] == 1) { - Bsnij = Bsnij * Wi[i] * Wi[j]; - } - Bsnij2[i][j][n] = an[n] * Math.pow(Eij[i][j] * Math.sqrt(Ei[i] * Ei[j]), un[n]) - * Math.pow(Ki[i] * Ki[j], 1.5) * Bsnij; - } - Kij5[i][j] = (Math.pow(Kij[i][j], 5) - 1) * Ki25[i] * Ki25[j]; - Uij5[i][j] = (Math.pow(Uij[i][j], 5) - 1) * Ei25[i] * Ei25[j]; - Gij5[i][j] = (Gij[i][j] - 1) * (Gi[i] + Gi[j]) / 2; - } - } - // Ideal gas terms - d0 = 101.325 / RDetail / 298.15; - for (int i = 1; i <= MaxFlds; ++i) { - n0i[i][3] = n0i[i][3] - 1; - n0i[i][1] = n0i[i][1] - Math.log(d0); + // Coefficients of the equation of state + an[1] = 0.1538326; + an[2] = 1.341953; + an[3] = -2.998583; + an[4] = -0.04831228; + an[5] = 0.3757965; + an[6] = -1.589575; + an[7] = -0.05358847; + an[8] = 0.88659463; + an[9] = -0.71023704; + an[10] = -1.471722; + an[11] = 1.32185035; + an[12] = -0.78665925; + an[13] = 0.00000000229129; + an[14] = 0.1576724; + an[15] = -0.4363864; + an[16] = -0.04408159; + an[17] = -0.003433888; + an[18] = 0.03205905; + an[19] = 0.02487355; + an[20] = 0.07332279; + an[21] = -0.001600573; + an[22] = 0.6424706; + an[23] = -0.4162601; + an[24] = -0.06689957; + an[25] = 0.2791795; + an[26] = -0.6966051; + an[27] = -0.002860589; + an[28] = -0.008098836; + an[29] = 3.150547; + an[30] = 0.007224479; + an[31] = -0.7057529; + an[32] = 0.5349792; + an[33] = -0.07931491; + an[34] = -1.418465; + an[35] = -5.99905E-17; + an[36] = 0.1058402; + an[37] = 0.03431729; + an[38] = -0.007022847; + an[39] = 0.02495587; + an[40] = 0.04296818; + an[41] = 0.7465453; + an[42] = -0.2919613; + an[43] = 7.294616; + an[44] = -9.936757; + an[45] = -0.005399808; + an[46] = -0.2432567; + an[47] = 0.04987016; + an[48] = 0.003733797; + an[49] = 1.874951; + an[50] = 0.002168144; + an[51] = -0.6587164; + an[52] = 0.000205518; + an[53] = 0.009776195; + an[54] = -0.02048708; + an[55] = 0.01557322; + an[56] = 0.006862415; + an[57] = -0.001226752; + an[58] = 0.002850908; + + // Density exponents + bn[1] = 1; + bn[2] = 1; + bn[3] = 1; + bn[4] = 1; + bn[5] = 1; + bn[6] = 1; + bn[7] = 1; + bn[8] = 1; + bn[9] = 1; + bn[10] = 1; + bn[11] = 1; + bn[12] = 1; + bn[13] = 1; + bn[14] = 1; + bn[15] = 1; + bn[16] = 1; + bn[17] = 1; + bn[18] = 1; + bn[19] = 2; + bn[20] = 2; + bn[21] = 2; + bn[22] = 2; + bn[23] = 2; + bn[24] = 2; + bn[25] = 2; + bn[26] = 2; + bn[27] = 2; + bn[28] = 3; + bn[29] = 3; + bn[30] = 3; + bn[31] = 3; + bn[32] = 3; + bn[33] = 3; + bn[34] = 3; + bn[35] = 3; + bn[36] = 3; + bn[37] = 3; + bn[38] = 4; + bn[39] = 4; + bn[40] = 4; + bn[41] = 4; + bn[42] = 4; + bn[43] = 4; + bn[44] = 4; + bn[45] = 5; + bn[46] = 5; + bn[47] = 5; + bn[48] = 5; + bn[49] = 5; + bn[50] = 6; + bn[51] = 6; + bn[52] = 7; + bn[53] = 7; + bn[54] = 8; + bn[55] = 8; + bn[56] = 8; + bn[57] = 9; + bn[58] = 9; + + // Exponents on density in EXP[-cn*D^kn] part + // The cn part in this term is not included in this program since it is 1 when + // kn<>0][and 0 otherwise + kn[13] = 3; + kn[14] = 2; + kn[15] = 2; + kn[16] = 2; + kn[17] = 4; + kn[18] = 4; + kn[21] = 2; + kn[22] = 2; + kn[23] = 2; + kn[24] = 4; + kn[25] = 4; + kn[26] = 4; + kn[27] = 4; + kn[29] = 1; + kn[30] = 1; + kn[31] = 2; + kn[32] = 2; + kn[33] = 3; + kn[34] = 3; + kn[35] = 4; + kn[36] = 4; + kn[37] = 4; + kn[40] = 2; + kn[41] = 2; + kn[42] = 2; + kn[43] = 4; + kn[44] = 4; + kn[46] = 2; + kn[47] = 2; + kn[48] = 4; + kn[49] = 4; + kn[51] = 2; + kn[53] = 2; + kn[54] = 1; + kn[55] = 2; + kn[56] = 2; + kn[57] = 2; + kn[58] = 2; + + // Temperature exponents + un[1] = 0; + un[2] = 0.5; + un[3] = 1; + un[4] = 3.5; + un[5] = -0.5; + un[6] = 4.5; + un[7] = 0.5; + un[8] = 7.5; + un[9] = 9.5; + un[10] = 6; + un[11] = 12; + un[12] = 12.5; + un[13] = -6; + un[14] = 2; + un[15] = 3; + un[16] = 2; + un[17] = 2; + un[18] = 11; + un[19] = -0.5; + un[20] = 0.5; + un[21] = 0; + un[22] = 4; + un[23] = 6; + un[24] = 21; + un[25] = 23; + un[26] = 22; + un[27] = -1; + un[28] = -0.5; + un[29] = 7; + un[30] = -1; + un[31] = 6; + un[32] = 4; + un[33] = 1; + un[34] = 9; + un[35] = -13; + un[36] = 21; + un[37] = 8; + un[38] = -0.5; + un[39] = 0; + un[40] = 2; + un[41] = 7; + un[42] = 9; + un[43] = 22; + un[44] = 23; + un[45] = 1; + un[46] = 9; + un[47] = 3; + un[48] = 8; + un[49] = 23; + un[50] = 1.5; + un[51] = 5; + un[52] = -0.5; + un[53] = 4; + un[54] = 7; + un[55] = 3; + un[56] = 0; + un[57] = 1; + un[58] = 0; + + // Flags + fn[13] = 1; + fn[27] = 1; + fn[30] = 1; + fn[35] = 1; + gn[5] = 1; + gn[6] = 1; + gn[25] = 1; + gn[29] = 1; + gn[32] = 1; + gn[33] = 1; + gn[34] = 1; + gn[51] = 1; + gn[54] = 1; + gn[56] = 1; + qn[7] = 1; + qn[16] = 1; + qn[26] = 1; + qn[28] = 1; + qn[37] = 1; + qn[42] = 1; + qn[47] = 1; + qn[49] = 1; + qn[52] = 1; + qn[58] = 1; + sn[8] = 1; + sn[9] = 1; + wn[10] = 1; + wn[11] = 1; + wn[12] = 1; + + // Energy parameters + Ei[1] = 151.3183; + Ei[2] = 99.73778; + Ei[3] = 241.9606; + Ei[4] = 244.1667; + Ei[5] = 298.1183; + Ei[6] = 324.0689; + Ei[7] = 337.6389; + Ei[8] = 365.5999; + Ei[9] = 370.6823; + Ei[10] = 402.636293; + Ei[11] = 427.72263; + Ei[12] = 450.325022; + Ei[13] = 470.840891; + Ei[14] = 489.558373; + Ei[15] = 26.95794; + Ei[16] = 122.7667; + Ei[17] = 105.5348; + Ei[18] = 514.0156; + Ei[19] = 296.355; + Ei[20] = 2.610111; + Ei[21] = 119.6299; + + // Size parameters + Ki[1] = 0.4619255; + Ki[2] = 0.4479153; + Ki[3] = 0.4557489; + Ki[4] = 0.5279209; + Ki[5] = 0.583749; + Ki[6] = 0.6406937; + Ki[7] = 0.6341423; + Ki[8] = 0.6738577; + Ki[9] = 0.6798307; + Ki[10] = 0.7175118; + Ki[11] = 0.7525189; + Ki[12] = 0.784955; + Ki[13] = 0.8152731; + Ki[14] = 0.8437826; + Ki[15] = 0.3514916; + Ki[16] = 0.4186954; + Ki[17] = 0.4533894; + Ki[18] = 0.3825868; + Ki[19] = 0.4618263; + Ki[20] = 0.3589888; + Ki[21] = 0.4216551; + + // Orientation parameters + Gi[2] = 0.027815; + Gi[3] = 0.189065; + Gi[4] = 0.0793; + Gi[5] = 0.141239; + Gi[6] = 0.256692; + Gi[7] = 0.281835; + Gi[8] = 0.332267; + Gi[9] = 0.366911; + Gi[10] = 0.289731; + Gi[11] = 0.337542; + Gi[12] = 0.383381; + Gi[13] = 0.427354; + Gi[14] = 0.469659; + Gi[15] = 0.034369; + Gi[16] = 0.021; + Gi[17] = 0.038953; + Gi[18] = 0.3325; + Gi[19] = 0.0885; + + // Quadrupole parameters + Qi[3] = 0.69; + Qi[18] = 1.06775; + Qi[19] = 0.633276; + Fi[15] = 1; // High temperature parameter + Si[18] = 1.5822; // Dipole parameter + Si[19] = 0.39; // Dipole parameter + Wi[18] = 1; // Association parameter + + // Energy parameters + Eij[1][2] = 0.97164; + Eij[1][3] = 0.960644; + Eij[1][5] = 0.994635; + Eij[1][6] = 1.01953; + Eij[1][7] = 0.989844; + Eij[1][8] = 1.00235; + Eij[1][9] = 0.999268; + Eij[1][10] = 1.107274; + Eij[1][11] = 0.88088; + Eij[1][12] = 0.880973; + Eij[1][13] = 0.881067; + Eij[1][14] = 0.881161; + Eij[1][15] = 1.17052; + Eij[1][17] = 0.990126; + Eij[1][18] = 0.708218; + Eij[1][19] = 0.931484; + Eij[2][3] = 1.02274; + Eij[2][4] = 0.97012; + Eij[2][5] = 0.945939; + Eij[2][6] = 0.946914; + Eij[2][7] = 0.973384; + Eij[2][8] = 0.95934; + Eij[2][9] = 0.94552; + Eij[2][15] = 1.08632; + Eij[2][16] = 1.021; + Eij[2][17] = 1.00571; + Eij[2][18] = 0.746954; + Eij[2][19] = 0.902271; + Eij[3][4] = 0.925053; + Eij[3][5] = 0.960237; + Eij[3][6] = 0.906849; + Eij[3][7] = 0.897362; + Eij[3][8] = 0.726255; + Eij[3][9] = 0.859764; + Eij[3][10] = 0.855134; + Eij[3][11] = 0.831229; + Eij[3][12] = 0.80831; + Eij[3][13] = 0.786323; + Eij[3][14] = 0.765171; + Eij[3][15] = 1.28179; + Eij[3][17] = 1.5; + Eij[3][18] = 0.849408; + Eij[3][19] = 0.955052; + Eij[4][5] = 1.02256; + Eij[4][7] = 1.01306; + Eij[4][9] = 1.00532; + Eij[4][15] = 1.16446; + Eij[4][18] = 0.693168; + Eij[4][19] = 0.946871; + Eij[5][7] = 1.0049; + Eij[5][15] = 1.034787; + Eij[6][15] = 1.3; + Eij[7][15] = 1.3; + Eij[10][19] = 1.008692; + Eij[11][19] = 1.010126; + Eij[12][19] = 1.011501; + Eij[13][19] = 1.012821; + Eij[14][19] = 1.014089; + Eij[15][17] = 1.1; + + // Conformal energy parameters + Uij[1][2] = 0.886106; + Uij[1][3] = 0.963827; + Uij[1][5] = 0.990877; + Uij[1][7] = 0.992291; + Uij[1][9] = 1.00367; + Uij[1][10] = 1.302576; + Uij[1][11] = 1.191904; + Uij[1][12] = 1.205769; + Uij[1][13] = 1.219634; + Uij[1][14] = 1.233498; + Uij[1][15] = 1.15639; + Uij[1][19] = 0.736833; + Uij[2][3] = 0.835058; + Uij[2][4] = 0.816431; + Uij[2][5] = 0.915502; + Uij[2][7] = 0.993556; + Uij[2][15] = 0.408838; + Uij[2][19] = 0.993476; + Uij[3][4] = 0.96987; + Uij[3][10] = 1.066638; + Uij[3][11] = 1.077634; + Uij[3][12] = 1.088178; + Uij[3][13] = 1.098291; + Uij[3][14] = 1.108021; + Uij[3][17] = 0.9; + Uij[3][19] = 1.04529; + Uij[4][5] = 1.065173; + Uij[4][6] = 1.25; + Uij[4][7] = 1.25; + Uij[4][8] = 1.25; + Uij[4][9] = 1.25; + Uij[4][15] = 1.61666; + Uij[4][19] = 0.971926; + Uij[10][19] = 1.028973; + Uij[11][19] = 1.033754; + Uij[12][19] = 1.038338; + Uij[13][19] = 1.042735; + Uij[14][19] = 1.046966; + + // Size parameters + Kij[1][2] = 1.00363; + Kij[1][3] = 0.995933; + Kij[1][5] = 1.007619; + Kij[1][7] = 0.997596; + Kij[1][9] = 1.002529; + Kij[1][10] = 0.982962; + Kij[1][11] = 0.983565; + Kij[1][12] = 0.982707; + Kij[1][13] = 0.981849; + Kij[1][14] = 0.980991; + Kij[1][15] = 1.02326; + Kij[1][19] = 1.00008; + Kij[2][3] = 0.982361; + Kij[2][4] = 1.00796; + Kij[2][15] = 1.03227; + Kij[2][19] = 0.942596; + Kij[3][4] = 1.00851; + Kij[3][10] = 0.910183; + Kij[3][11] = 0.895362; + Kij[3][12] = 0.881152; + Kij[3][13] = 0.86752; + Kij[3][14] = 0.854406; + Kij[3][19] = 1.00779; + Kij[4][5] = 0.986893; + Kij[4][15] = 1.02034; + Kij[4][19] = 0.999969; + Kij[10][19] = 0.96813; + Kij[11][19] = 0.96287; + Kij[12][19] = 0.957828; + Kij[13][19] = 0.952441; + Kij[14][19] = 0.948338; + + // Orientation parameters + Gij[1][3] = 0.807653; + Gij[1][15] = 1.95731; + Gij[2][3] = 0.982746; + Gij[3][4] = 0.370296; + Gij[3][18] = 1.67309; + + // Ideal gas parameters + n0i[1][3] = 4.00088; + n0i[1][4] = 0.76315; + n0i[1][5] = 0.0046; + n0i[1][6] = 8.74432; + n0i[1][7] = -4.46921; + n0i[1][1] = 29.83843397; + n0i[1][2] = -15999.69151; + n0i[2][3] = 3.50031; + n0i[2][4] = 0.13732; + n0i[2][5] = -0.1466; + n0i[2][6] = 0.90066; + n0i[2][7] = 0; + n0i[2][1] = 17.56770785; + n0i[2][2] = -2801.729072; + n0i[3][3] = 3.50002; + n0i[3][4] = 2.04452; + n0i[3][5] = -1.06044; + n0i[3][6] = 2.03366; + n0i[3][7] = 0.01393; + n0i[3][1] = 20.65844696; + n0i[3][2] = -4902.171516; + n0i[4][3] = 4.00263; + n0i[4][4] = 4.33939; + n0i[4][5] = 1.23722; + n0i[4][6] = 13.1974; + n0i[4][7] = -6.01989; + n0i[4][1] = 36.73005938; + n0i[4][2] = -23639.65301; + n0i[5][3] = 4.02939; + n0i[5][4] = 6.60569; + n0i[5][5] = 3.197; + n0i[5][6] = 19.1921; + n0i[5][7] = -8.37267; + n0i[5][1] = 44.70909619; + n0i[5][2] = -31236.63551; + n0i[6][3] = 4.06714; + n0i[6][4] = 8.97575; + n0i[6][5] = 5.25156; + n0i[6][6] = 25.1423; + n0i[6][7] = 16.1388; + n0i[6][1] = 34.30180349; + n0i[6][2] = -38525.50276; + n0i[7][3] = 4.33944; + n0i[7][4] = 9.44893; + n0i[7][5] = 6.89406; + n0i[7][6] = 24.4618; + n0i[7][7] = 14.7824; + n0i[7][1] = 36.53237783; + n0i[7][2] = -38957.80933; + n0i[8][3] = 4; + n0i[8][4] = 11.7618; + n0i[8][5] = 20.1101; + n0i[8][6] = 33.1688; + n0i[8][7] = 0; + n0i[8][1] = 43.17218626; + n0i[8][2] = -51198.30946; + n0i[9][3] = 4; + n0i[9][4] = 8.95043; + n0i[9][5] = 21.836; + n0i[9][6] = 33.4032; + n0i[9][7] = 0; + n0i[9][1] = 42.67837089; + n0i[9][2] = -45215.83; + n0i[10][3] = 4; + n0i[10][4] = 11.6977; + n0i[10][5] = 26.8142; + n0i[10][6] = 38.6164; + n0i[10][7] = 0; + n0i[10][1] = 46.99717188; + n0i[10][2] = -52746.83318; + n0i[11][3] = 4; + n0i[11][4] = 13.7266; + n0i[11][5] = 30.4707; + n0i[11][6] = 43.5561; + n0i[11][7] = 0; + n0i[11][1] = 52.07631631; + n0i[11][2] = -57104.81056; + n0i[12][3] = 4; + n0i[12][4] = 15.6865; + n0i[12][5] = 33.8029; + n0i[12][6] = 48.1731; + n0i[12][7] = 0; + n0i[12][1] = 57.25830934; + n0i[12][2] = -60546.76385; + n0i[13][3] = 4; + n0i[13][4] = 18.0241; + n0i[13][5] = 38.1235; + n0i[13][6] = 53.3415; + n0i[13][7] = 0; + n0i[13][1] = 62.09646901; + n0i[13][2] = -66600.12837; + n0i[14][3] = 4; + n0i[14][4] = 21.0069; + n0i[14][5] = 43.4931; + n0i[14][6] = 58.3657; + n0i[14][7] = 0; + n0i[14][1] = 65.93909154; + n0i[14][2] = -74131.45483; + n0i[15][3] = 2.47906; + n0i[15][4] = 0.95806; + n0i[15][5] = 0.45444; + n0i[15][6] = 1.56039; + n0i[15][7] = -1.3756; + n0i[15][1] = 13.07520288; + n0i[15][2] = -5836.943696; + n0i[16][3] = 3.50146; + n0i[16][4] = 1.07558; + n0i[16][5] = 1.01334; + n0i[16][6] = 0; + n0i[16][7] = 0; + n0i[16][1] = 16.8017173; + n0i[16][2] = -2318.32269; + n0i[17][3] = 3.50055; + n0i[17][4] = 1.02865; + n0i[17][5] = 0.00493; + n0i[17][6] = 0; + n0i[17][7] = 0; + n0i[17][1] = 17.45786899; + n0i[17][2] = -2635.244116; + n0i[18][3] = 4.00392; + n0i[18][4] = 0.01059; + n0i[18][5] = 0.98763; + n0i[18][6] = 3.06904; + n0i[18][7] = 0; + n0i[18][1] = 21.57882705; + n0i[18][2] = -7766.733078; + n0i[19][3] = 4; + n0i[19][4] = 3.11942; + n0i[19][5] = 1.00243; + n0i[19][6] = 0; + n0i[19][7] = 0; + n0i[19][1] = 21.5830944; + n0i[19][2] = -6069.035869; + n0i[20][3] = 2.5; + n0i[20][4] = 0; + n0i[20][5] = 0; + n0i[20][6] = 0; + n0i[20][7] = 0; + n0i[20][1] = 10.04639507; + n0i[20][2] = -745.375; + n0i[21][3] = 2.5; + n0i[21][4] = 0; + n0i[21][5] = 0; + n0i[21][6] = 0; + n0i[21][7] = 0; + n0i[21][1] = 10.04639507; + n0i[21][2] = -745.375; + th0i[1][4] = 820.659; + th0i[1][5] = 178.41; + th0i[1][6] = 1062.82; + th0i[1][7] = 1090.53; + th0i[2][4] = 662.738; + th0i[2][5] = 680.562; + th0i[2][6] = 1740.06; + th0i[2][7] = 0; + th0i[3][4] = 919.306; + th0i[3][5] = 865.07; + th0i[3][6] = 483.553; + th0i[3][7] = 341.109; + th0i[4][4] = 559.314; + th0i[4][5] = 223.284; + th0i[4][6] = 1031.38; + th0i[4][7] = 1071.29; + th0i[5][4] = 479.856; + th0i[5][5] = 200.893; + th0i[5][6] = 955.312; + th0i[5][7] = 1027.29; + th0i[6][4] = 438.27; + th0i[6][5] = 198.018; + th0i[6][6] = 1905.02; + th0i[6][7] = 893.765; + th0i[7][4] = 468.27; + th0i[7][5] = 183.636; + th0i[7][6] = 1914.1; + th0i[7][7] = 903.185; + th0i[8][4] = 292.503; + th0i[8][5] = 910.237; + th0i[8][6] = 1919.37; + th0i[8][7] = 0; + th0i[9][4] = 178.67; + th0i[9][5] = 840.538; + th0i[9][6] = 1774.25; + th0i[9][7] = 0; + th0i[10][4] = 182.326; + th0i[10][5] = 859.207; + th0i[10][6] = 1826.59; + th0i[10][7] = 0; + th0i[11][4] = 169.789; + th0i[11][5] = 836.195; + th0i[11][6] = 1760.46; + th0i[11][7] = 0; + th0i[12][4] = 158.922; + th0i[12][5] = 815.064; + th0i[12][6] = 1693.07; + th0i[12][7] = 0; + th0i[13][4] = 156.854; + th0i[13][5] = 814.882; + th0i[13][6] = 1693.79; + th0i[13][7] = 0; + th0i[14][4] = 164.947; + th0i[14][5] = 836.264; + th0i[14][6] = 1750.24; + th0i[14][7] = 0; + th0i[15][4] = 228.734; + th0i[15][5] = 326.843; + th0i[15][6] = 1651.71; + th0i[15][7] = 1671.69; + th0i[16][4] = 2235.71; + th0i[16][5] = 1116.69; + th0i[16][6] = 0; + th0i[16][7] = 0; + th0i[17][4] = 1550.45; + th0i[17][5] = 704.525; + th0i[17][6] = 0; + th0i[17][7] = 0; + th0i[18][4] = 268.795; + th0i[18][5] = 1141.41; + th0i[18][6] = 2507.37; + th0i[18][7] = 0; + th0i[19][4] = 1833.63; + th0i[19][5] = 847.181; + th0i[19][6] = 0; + th0i[19][7] = 0; + th0i[20][4] = 0; + th0i[20][5] = 0; + th0i[20][6] = 0; + th0i[20][7] = 0; + th0i[21][4] = 0; + th0i[21][5] = 0; + th0i[21][6] = 0; + th0i[21][7] = 0; + + // Precalculations of constants + for (int i = 1; i <= MaxFlds; ++i) { + Ki25[i] = Math.pow(Ki[i], 2.5); + Ei25[i] = Math.pow(Ei[i], 2.5); + } + for (int i = 1; i <= MaxFlds; ++i) { + for (int j = i; j <= MaxFlds; ++j) { + for (int n = 1; n <= 18; ++n) { + Bsnij = 1; + if (gn[n] == 1) { + Bsnij = Gij[i][j] * (Gi[i] + Gi[j]) / 2; + } + if (qn[n] == 1) { + Bsnij = Bsnij * Qi[i] * Qi[j]; + } + if (fn[n] == 1) { + Bsnij = Bsnij * Fi[i] * Fi[j]; + } + if (sn[n] == 1) { + Bsnij = Bsnij * Si[i] * Si[j]; + } + if (wn[n] == 1) { + Bsnij = Bsnij * Wi[i] * Wi[j]; + } + Bsnij2[i][j][n] = an[n] * Math.pow(Eij[i][j] * Math.sqrt(Ei[i] * Ei[j]), un[n]) + * Math.pow(Ki[i] * Ki[j], 1.5) * Bsnij; } - return; - - // Code to produce nearly exact values for n0[1] and n0[2] - // This is not called in the current code, but included below to show how the - // values were calculated. The return above can be removed to call this code. - // T0 = 298.15; - // d0 = 101.325 / RDetail / T0; - // for (int i=1; i <= MaxFlds; ++i){ - // n1 = 0; n2 = 0; - // if (th0i[i][4] > 0) {n2 = n2 - n0i[i][4] * th0i[i][4] / tanh(th0i[i][4] / - // T0); n1 = n1 - n0i[i][4] * log(sinh(th0i[i][4] / T0));} - // if (th0i[i][5] > 0) {n2 = n2 + n0i[i][5] * th0i[i][5] * tanh(th0i[i][5] / - // T0); n1 = n1 + n0i[i][5] * log(cosh(th0i[i][5] / T0));} - // if (th0i[i][6] > 0) {n2 = n2 - n0i[i][6] * th0i[i][6] / tanh(th0i[i][6] / - // T0); n1 = n1 - n0i[i][6] * log(sinh(th0i[i][6] / T0));} - // if (th0i[i][7] > 0) {n2 = n2 + n0i[i][7] * th0i[i][7] * tanh(th0i[i][7] / - // T0); n1 = n1 + n0i[i][7] * log(cosh(th0i[i][7] / T0));} - // n0i[i][2] = n2 - n0i[i][3] * T0; - // n0i[i][3] = n0i[i][3] - 1; - // n0i[i][1] = n1 - n2 / T0 + n0i[i][3] * (1 + log(T0)) - log(d0); - // } + Kij5[i][j] = (Math.pow(Kij[i][j], 5) - 1) * Ki25[i] * Ki25[j]; + Uij5[i][j] = (Math.pow(Uij[i][j], 5) - 1) * Ei25[i] * Ei25[j]; + Gij5[i][j] = (Gij[i][j] - 1) * (Gi[i] + Gi[j]) / 2; + } } - - /** - *

- * main. - *

- * - * @param args an array of {@link java.lang.String} objects - */ - @SuppressWarnings("unused") - public static void main(String[] args) { - DETAIL test = new DETAIL(); - test.SetupDetail(); - - double T = 400; - doubleW D = new doubleW(0.0); - doubleW P = new doubleW(50000.0d); - intW ierr = new intW(0); - doubleW Mm = new doubleW(0.0d); - doubleW Z = new doubleW(0.0d); - int iFlag = 0; - StringW herr = new StringW(""); - - double x[] = {0.0, 0.77824, 0.02, 0.06, 0.08, 0.03, 0.0015, 0.003, 0.0005, 0.00165, 0.00215, - 0.00088, 0.00024, 0.00015, 0.00009, 0.004, 0.005, 0.002, 0.0001, 0.0025, 0.007, - 0.001}; - - test.MolarMassDetail(x, Mm); - - System.out.println("mol mass " + Mm.val); - - test.DensityDetail(T, P.val, x, D, ierr, herr); - System.out.println("density " + D.val); - test.PressureDetail(T, D.val, x, P, Z); - System.out.println("pressure " + P.val); - System.out.println("Z " + Z.val); - - doubleW dPdD = new doubleW(0.0d), d2PdD2 = new doubleW(0.0d), d2PdTD = new doubleW(0.0d), - dPdT = new doubleW(0.0d), U = new doubleW(0.0d), H = new doubleW(0.0d), - S = new doubleW(0.0d), A = new doubleW(0.0d), P2 = new doubleW(0.0d); - doubleW Cv = new doubleW(0.0d), Cp = new doubleW(0.0d), W = new doubleW(0.0d), - G = new doubleW(0.0d), JT = new doubleW(0.0d), Kappa = new doubleW(0.0d), - PP = new doubleW(0.0d); - - test.PropertiesDetail(T, D.val, x, P, Z, dPdD, d2PdD2, d2PdTD, dPdT, U, H, S, Cv, Cp, W, - G, JT, Kappa); - - System.out.println("JT " + JT.val); - System.out.println("Kappa " + Kappa.val); + // Ideal gas terms + d0 = 101.325 / RDetail / 298.15; + for (int i = 1; i <= MaxFlds; ++i) { + n0i[i][3] = n0i[i][3] - 1; + n0i[i][1] = n0i[i][1] - Math.log(d0); } + return; + + // Code to produce nearly exact values for n0[1] and n0[2] + // This is not called in the current code, but included below to show how the + // values were calculated. The return above can be removed to call this code. + // T0 = 298.15; + // d0 = 101.325 / RDetail / T0; + // for (int i=1; i <= MaxFlds; ++i){ + // n1 = 0; n2 = 0; + // if (th0i[i][4] > 0) {n2 = n2 - n0i[i][4] * th0i[i][4] / tanh(th0i[i][4] / + // T0); n1 = n1 - n0i[i][4] * log(sinh(th0i[i][4] / T0));} + // if (th0i[i][5] > 0) {n2 = n2 + n0i[i][5] * th0i[i][5] * tanh(th0i[i][5] / + // T0); n1 = n1 + n0i[i][5] * log(cosh(th0i[i][5] / T0));} + // if (th0i[i][6] > 0) {n2 = n2 - n0i[i][6] * th0i[i][6] / tanh(th0i[i][6] / + // T0); n1 = n1 - n0i[i][6] * log(sinh(th0i[i][6] / T0));} + // if (th0i[i][7] > 0) {n2 = n2 + n0i[i][7] * th0i[i][7] * tanh(th0i[i][7] / + // T0); n1 = n1 + n0i[i][7] * log(cosh(th0i[i][7] / T0));} + // n0i[i][2] = n2 - n0i[i][3] * T0; + // n0i[i][3] = n0i[i][3] - 1; + // n0i[i][1] = n1 - n2 / T0 + n0i[i][3] * (1 + log(T0)) - log(d0); + // } + } + + /** + *

+ * main. + *

+ * + * @param args an array of {@link java.lang.String} objects + */ + @SuppressWarnings("unused") + public static void main(String[] args) { + DETAIL test = new DETAIL(); + test.SetupDetail(); + + double T = 400; + doubleW D = new doubleW(0.0); + doubleW P = new doubleW(50000.0d); + intW ierr = new intW(0); + doubleW Mm = new doubleW(0.0d); + doubleW Z = new doubleW(0.0d); + int iFlag = 0; + StringW herr = new StringW(""); + + double x[] = {0.0, 0.77824, 0.02, 0.06, 0.08, 0.03, 0.0015, 0.003, 0.0005, 0.00165, 0.00215, + 0.00088, 0.00024, 0.00015, 0.00009, 0.004, 0.005, 0.002, 0.0001, 0.0025, 0.007, 0.001}; + + test.MolarMassDetail(x, Mm); + + System.out.println("mol mass " + Mm.val); + + test.DensityDetail(T, P.val, x, D, ierr, herr); + System.out.println("density " + D.val); + test.PressureDetail(T, D.val, x, P, Z); + System.out.println("pressure " + P.val); + System.out.println("Z " + Z.val); + + doubleW dPdD = new doubleW(0.0d), d2PdD2 = new doubleW(0.0d), d2PdTD = new doubleW(0.0d), + dPdT = new doubleW(0.0d), U = new doubleW(0.0d), H = new doubleW(0.0d), + S = new doubleW(0.0d), A = new doubleW(0.0d), P2 = new doubleW(0.0d); + doubleW Cv = new doubleW(0.0d), Cp = new doubleW(0.0d), W = new doubleW(0.0d), + G = new doubleW(0.0d), JT = new doubleW(0.0d), Kappa = new doubleW(0.0d), + PP = new doubleW(0.0d); + + test.PropertiesDetail(T, D.val, x, P, Z, dPdD, d2PdD2, d2PdTD, dPdT, U, H, S, Cv, Cp, W, G, JT, + Kappa); + + System.out.println("JT " + JT.val); + System.out.println("Kappa " + Kappa.val); + } } diff --git a/src/main/java/neqsim/thermo/util/GERG/GERG2008.java b/src/main/java/neqsim/thermo/util/GERG/GERG2008.java index d1fb9b2ae..70659aada 100644 --- a/src/main/java/neqsim/thermo/util/GERG/GERG2008.java +++ b/src/main/java/neqsim/thermo/util/GERG/GERG2008.java @@ -3283,14 +3283,14 @@ public static void main(String[] args) { /* * // test.PressureGERG(400, 12.798286, x); String herr = ""; test.DensityGERG(0, T, P, x, ierr, * herr); double pres = test.P; double molarmass = test.Mm; - * + * * // double dPdD=0.0, dPdD2=0.0, d2PdTD=0.0, dPdT=0.0, U=0.0, H=0.0, S=0.0, // Cv=0.0, Cp=0.0, * W=0.0, G=0.0, JT=0.0, Kappa=0.0, A=0.0; - * + * * // void DensityGERG(const int iFlag, const double T, const double P, const // * std::vector &x, double &D, int &ierr, std::string &herr) // test.DensityGERG(0, T, P, * x, ierr, herr); - * + * * // Sub PropertiesGERG(T, D, x, P, Z, dPdD, dPdD2, d2PdTD, dPdT, U, H, S, Cv, Cp, // W, G, JT, * Kappa) // test.PropertiesGERG(T, test.D, x); */ diff --git a/src/main/java/neqsim/thermodynamicOperations/ThermodynamicOperations.java b/src/main/java/neqsim/thermodynamicOperations/ThermodynamicOperations.java index 70eb9d7ad..0457820fe 100644 --- a/src/main/java/neqsim/thermodynamicOperations/ThermodynamicOperations.java +++ b/src/main/java/neqsim/thermodynamicOperations/ThermodynamicOperations.java @@ -1999,9 +1999,9 @@ public CalculationResult propertyFlash(List Spec1, List Spec2, i } else { /* * // New attempt: - * + * * // Have to init here to get correct MoleFractionsSum() this.system.init(0); - * + * * // Annoying that MoleFractionsSum is not normalized. sum[0] = * this.system.getMoleFractionsSum(); */ @@ -2047,14 +2047,14 @@ public CalculationResult propertyFlash(List Spec1, List Spec2, i if (hasOnlineFractions) { /* * // New attempt: - * + * * this.system.setEmptyFluid(); - * + * * // Components in system with no corresponding value in onlineFractions will be zero. * for (int componentNumber = 0; componentNumber < onlineFractions .size(); * componentNumber++) { this.system.addComponent(componentNumber, * onlineFractions.get(componentNumber).get(t).doubleValue()); } - * + * * if (this.system.getTotalNumberOfMoles() < 1e-5) { this.system.setTotalNumberOfMoles(1); * } */ diff --git a/src/main/java/neqsim/thermodynamicOperations/flashOps/PHflashSingleComp.java b/src/main/java/neqsim/thermodynamicOperations/flashOps/PHflashSingleComp.java index 14ca103ef..7a84d17f9 100644 --- a/src/main/java/neqsim/thermodynamicOperations/flashOps/PHflashSingleComp.java +++ b/src/main/java/neqsim/thermodynamicOperations/flashOps/PHflashSingleComp.java @@ -66,11 +66,11 @@ public void run() { /* * double solidEnthalpy = 0.0; - * + * * if (system.doSolidPhaseCheck()) { system.init(3, 3); solidEnthalpy = * system.getPhases()[3].getEnthalpy() / system.getPhases()[3].getNumberOfMolesInPhase() * system.getTotalNumberOfMoles(); - * + * * if (Hspec < liqEnthalpy && Hspec > solidEnthalpy) { double solidbeta = (Hspec - liqEnthalpy) * / (gasEnthalpy - liqEnthalpy); } } */ diff --git a/src/main/java/neqsim/thermodynamicOperations/flashOps/TPmultiflash.java b/src/main/java/neqsim/thermodynamicOperations/flashOps/TPmultiflash.java index 1c2f7240c..9dfa3590c 100644 --- a/src/main/java/neqsim/thermodynamicOperations/flashOps/TPmultiflash.java +++ b/src/main/java/neqsim/thermodynamicOperations/flashOps/TPmultiflash.java @@ -258,7 +258,7 @@ public void stabilityAnalysis() { * for (int i = 0; i < system.getPhase(0).getNumberOfComponents(); i++) { if * (system.getPhase(0).getComponent(i).getx() < 1e-100) { clonedSystem.add(null); continue; } * double numb = 0; clonedSystem.add(system.clone()); - * + * * // (clonedSystem.get(i)).init(0); commented out sept 2005, Even S. for (int j = 0; j < * system.getPhase(0).getNumberOfComponents(); j++) { numb = i == j ? 1.0 : 1.0e-12; // set to 0 * by Even Solbraa 23.01.2013 - chaged back to 1.0e-12 27.04.13 if @@ -275,7 +275,7 @@ public void stabilityAnalysis() { * minimumGibbsEnergySystem.getPhase(0).getNumberOfComponents(); i++) { if (!(( * clonedSystem.get(k)) == null)) { sumw[k] += ( * clonedSystem.get(k)).getPhase(1).getComponents()[i].getx(); } } } - * + * * for (int k = 0; k < minimumGibbsEnergySystem.getPhase(0).getNumberOfComponents(); k++) { for * (int i = 0; i < minimumGibbsEnergySystem.getPhase(0).getNumberOfComponents(); i++) { if (!(( * clonedSystem.get(k)) == null) && system.getPhase(0).getComponent(k).getx() > 1e-100) { ( @@ -605,7 +605,7 @@ public void stabilityAnalysis3() { * for (int i = 0; i < system.getPhase(0).getNumberOfComponents(); i++) { if * (system.getPhase(0).getComponent(i).getx() < 1e-100) { clonedSystem.add(null); continue; } * double numb = 0; clonedSystem.add(system.clone()); - * + * * // (clonedSystem.get(i)).init(0); commented out sept 2005, Even S. for (int j = 0; j < * system.getPhase(0).getNumberOfComponents(); j++) { numb = i == j ? 1.0 : 1.0e-12; // set to 0 * by Even Solbraa 23.01.2013 - chaged back to 1.0e-12 27.04.13 if @@ -622,7 +622,7 @@ public void stabilityAnalysis3() { * minimumGibbsEnergySystem.getPhase(0).getNumberOfComponents(); i++) { if (!(( * clonedSystem.get(k)) == null)) { sumw[k] += ( * clonedSystem.get(k)).getPhase(1).getComponents()[i].getx(); } } } - * + * * for (int k = 0; k < minimumGibbsEnergySystem.getPhase(0).getNumberOfComponents(); k++) { for * (int i = 0; i < minimumGibbsEnergySystem.getPhase(0).getNumberOfComponents(); i++) { if (!(( * clonedSystem.get(k)) == null) && system.getPhase(0).getComponent(k).getx() > 1e-100) { ( diff --git a/src/main/java/neqsim/thermodynamicOperations/flashOps/saturationOps/waterDewPointTemperatureFlash.java b/src/main/java/neqsim/thermodynamicOperations/flashOps/saturationOps/waterDewPointTemperatureFlash.java index e663713db..4ab87f72a 100644 --- a/src/main/java/neqsim/thermodynamicOperations/flashOps/saturationOps/waterDewPointTemperatureFlash.java +++ b/src/main/java/neqsim/thermodynamicOperations/flashOps/saturationOps/waterDewPointTemperatureFlash.java @@ -74,7 +74,7 @@ public void run() { * Math.pow(system.getPhases()[0].getComponents()[k] .getFugacityCoefficient(), 2.0) + * system.getPhases()[1].getComponents()[k].getdfugdt() / * system.getPhases()[i].getComponents()[k] .getFugacityCoefficient()); - * + * * system.setTemperature(system.getTemperature() - funk/deriv); */ diff --git a/src/main/java/neqsim/thermodynamicOperations/phaseEnvelopeOps/multicomponentEnvelopeOps/CricondenBarFlash.java b/src/main/java/neqsim/thermodynamicOperations/phaseEnvelopeOps/multicomponentEnvelopeOps/CricondenBarFlash.java index f034148f3..5eecfc870 100644 --- a/src/main/java/neqsim/thermodynamicOperations/phaseEnvelopeOps/multicomponentEnvelopeOps/CricondenBarFlash.java +++ b/src/main/java/neqsim/thermodynamicOperations/phaseEnvelopeOps/multicomponentEnvelopeOps/CricondenBarFlash.java @@ -94,11 +94,11 @@ public void run() { setNewX(); /* * //iter X for (int iterX=0 ; iterX <= 10000 ; iterX++ ){ - * + * * system.setTemperature(T); system.setPressure(P); - * + * * uold = u.copy(); init(); setNewK(); setNewX(); - * + * * double sumK=0.; for (int i=0 ; i < numberOfComponents ; i++ ){ sumK= * sumK+(uold.get(i,0)-u.get(i,0))*(uold.get(i,0)-u.get(i,0)); } if (iterX == 10000 ){ ITERX=-1; * u=uini.copy(); setNewX(); break; } if (sumK <= 1E-7){ ITERX=iterX; setNewX(); break; } } @@ -198,7 +198,7 @@ public void run() { * System.out.println("dfuncdT : " + dfuncdT); System.out.println("dfuncdP : " + * dfuncdP); System.out.println("funcT : " + funcT); System.out.println("funcP : " + * funcP); - * + * * System.out.println(ITERX); System.out.println(ITER); System.out.println(ITERT); * System.out.println(ITERP); */ @@ -300,7 +300,7 @@ public void funcT() { /* * double voll=system.getPhase(0).getMolarVolume(); double * volv=system.getPhase(1).getMolarVolume(); - * + * * double T=system.getPhase(0).getPressure(); double P=system.getPhase(1).getTemperature() ; */ double fugl = system.getPhase(0).getComponent(j).getLogFugacityCoefficient(); diff --git a/src/main/java/neqsim/thermodynamicOperations/phaseEnvelopeOps/multicomponentEnvelopeOps/CricondenThermFlash.java b/src/main/java/neqsim/thermodynamicOperations/phaseEnvelopeOps/multicomponentEnvelopeOps/CricondenThermFlash.java index 6f438d8dd..36c5783af 100644 --- a/src/main/java/neqsim/thermodynamicOperations/phaseEnvelopeOps/multicomponentEnvelopeOps/CricondenThermFlash.java +++ b/src/main/java/neqsim/thermodynamicOperations/phaseEnvelopeOps/multicomponentEnvelopeOps/CricondenThermFlash.java @@ -92,15 +92,15 @@ public void run() { setNewX(); /* * //iter X for (int iterX=0 ; iterX <= 10000 ; iterX++ ){ - * + * * system.setTemperature(T); system.setPressure(P); - * + * * uold = u.copy(); init(); setNewK(); setNewX(); - * + * * double sumK=0.; for (int i=0 ; i < numberOfComponents ; i++ ){ sumK= * sumK+(uold.get(i,0)-u.get(i,0))*(uold.get(i,0)-u.get(i,0)); } if (iterX == 10000 ){ ITERX=-1; * u=uini.copy(); setNewX(); break; } if (sumK <= 1E-7){ ITERX=iterX; setNewX(); break; } } - * + * */ // starting loops for (int iter = 0; iter < 1000; iter++) { @@ -196,7 +196,7 @@ public void run() { * System.out.println("dfuncdT : " + dfuncdT); System.out.println("dfuncdP : " + * dfuncdP); System.out.println("funcT : " + funcT); System.out.println("funcP : " + * funcP); - * + * * System.out.println(ITERX); System.out.println(ITER); System.out.println(ITERT); * System.out.println(ITERP); */ @@ -298,7 +298,7 @@ public void funcT() { /* * double voll=system.getPhase(0).getMolarVolume(); double * volv=system.getPhase(1).getMolarVolume(); - * + * * double T=system.getPhase(0).getPressure(); double P=system.getPhase(1).getTemperature() ; */ double fugl = system.getPhase(0).getComponent(j).getLogFugacityCoefficient(); diff --git a/src/main/java/neqsim/thermodynamicOperations/phaseEnvelopeOps/multicomponentEnvelopeOps/pTphaseEnvelope.java b/src/main/java/neqsim/thermodynamicOperations/phaseEnvelopeOps/multicomponentEnvelopeOps/pTphaseEnvelope.java index 950bbcf71..7d2c2a23d 100644 --- a/src/main/java/neqsim/thermodynamicOperations/phaseEnvelopeOps/multicomponentEnvelopeOps/pTphaseEnvelope.java +++ b/src/main/java/neqsim/thermodynamicOperations/phaseEnvelopeOps/multicomponentEnvelopeOps/pTphaseEnvelope.java @@ -7,14 +7,11 @@ package neqsim.thermodynamicOperations.phaseEnvelopeOps.multicomponentEnvelopeOps; import java.text.DecimalFormat; - import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JProgressBar; - import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; - import neqsim.dataPresentation.JFreeChart.graph2b; import neqsim.thermo.system.SystemInterface; import neqsim.thermodynamicOperations.BaseOperation; @@ -108,8 +105,7 @@ public class pTphaseEnvelope extends BaseOperation { * Constructor for pTphaseEnvelope. *

*/ - public pTphaseEnvelope() { - } + public pTphaseEnvelope() {} /** *

@@ -514,7 +510,7 @@ public void run() { * neqsim.dataPresentation.fileHandeling.createNetCDF.netCDF2D.NetCdf2D(); * file1.setOutputFileName(name1); file1.setXvalues(points2[2], "temp", "sec"); * file1.setYvalues(points2[3], "pres", "meter"); file1.createFile(); - * + * * String name2 = new String(); name2 = fileName + "Bub.nc"; file2 = new * neqsim.dataPresentation.fileHandeling.createNetCDF.netCDF2D.NetCdf2D(); * file2.setOutputFileName(name2); file2.setXvalues(points2[0], "temp", "sec"); diff --git a/src/main/java/neqsim/thermodynamicOperations/phaseEnvelopeOps/multicomponentEnvelopeOps/pTphaseEnvelope1.java b/src/main/java/neqsim/thermodynamicOperations/phaseEnvelopeOps/multicomponentEnvelopeOps/pTphaseEnvelope1.java index fed3e2a99..72e6bbe0b 100644 --- a/src/main/java/neqsim/thermodynamicOperations/phaseEnvelopeOps/multicomponentEnvelopeOps/pTphaseEnvelope1.java +++ b/src/main/java/neqsim/thermodynamicOperations/phaseEnvelopeOps/multicomponentEnvelopeOps/pTphaseEnvelope1.java @@ -315,7 +315,7 @@ public void run() { * neqsim.dataPresentation.fileHandeling.createNetCDF.netCDF2D.NetCdf2D(); * file1.setOutputFileName(name1); file1.setXvalues(points2[2], "temp", "sec"); * file1.setYvalues(points2[3], "pres", "meter"); file1.createFile(); - * + * * String name2 = new String(); name2 = fileName + "Bub.nc"; file2 = new * neqsim.dataPresentation.fileHandeling.createNetCDF.netCDF2D.NetCdf2D(); * file2.setOutputFileName(name2); file2.setXvalues(points2[0], "temp", "sec"); diff --git a/src/main/java/neqsim/thermodynamicOperations/phaseEnvelopeOps/multicomponentEnvelopeOps/pTphaseEnvelopeMay.java b/src/main/java/neqsim/thermodynamicOperations/phaseEnvelopeOps/multicomponentEnvelopeOps/pTphaseEnvelopeMay.java index 7aa341c63..1876e1602 100644 --- a/src/main/java/neqsim/thermodynamicOperations/phaseEnvelopeOps/multicomponentEnvelopeOps/pTphaseEnvelopeMay.java +++ b/src/main/java/neqsim/thermodynamicOperations/phaseEnvelopeOps/multicomponentEnvelopeOps/pTphaseEnvelopeMay.java @@ -466,7 +466,7 @@ public void run() { * neqsim.dataPresentation.fileHandeling.createNetCDF.netCDF2D.NetCdf2D(); * file1.setOutputFileName(name1); file1.setXvalues(points2[2], "temp", "sec"); * file1.setYvalues(points2[3], "pres", "meter"); file1.createFile(); - * + * * String name2 = new String(); name2 = fileName + "Bub.nc"; file2 = new * neqsim.dataPresentation.fileHandeling.createNetCDF.netCDF2D.NetCdf2D(); * file2.setOutputFileName(name2); file2.setXvalues(points2[0], "temp", "sec"); diff --git a/src/main/java/neqsim/thermodynamicOperations/phaseEnvelopeOps/multicomponentEnvelopeOps/pTphaseEnvelopeNew.java b/src/main/java/neqsim/thermodynamicOperations/phaseEnvelopeOps/multicomponentEnvelopeOps/pTphaseEnvelopeNew.java index 56af56dd9..208a35ecf 100644 --- a/src/main/java/neqsim/thermodynamicOperations/phaseEnvelopeOps/multicomponentEnvelopeOps/pTphaseEnvelopeNew.java +++ b/src/main/java/neqsim/thermodynamicOperations/phaseEnvelopeOps/multicomponentEnvelopeOps/pTphaseEnvelopeNew.java @@ -252,7 +252,7 @@ public void run() { * neqsim.dataPresentation.fileHandeling.createNetCDF.netCDF2D.NetCdf2D(); * file1.setOutputFileName(name1); file1.setXvalues(points2[2], "temp", "sec"); * file1.setYvalues(points2[3], "pres", "meter"); file1.createFile(); - * + * * String name2 = new String(); name2 = fileName + "Bub.nc"; file2 = new * neqsim.dataPresentation.fileHandeling.createNetCDF.netCDF2D.NetCdf2D(); * file2.setOutputFileName(name2); file2.setXvalues(points2[0], "temp", "sec"); diff --git a/src/main/java/neqsim/thermodynamicOperations/propertyGenerator/OLGApropertyTableGeneratorWaterEven.java b/src/main/java/neqsim/thermodynamicOperations/propertyGenerator/OLGApropertyTableGeneratorWaterEven.java index 9640ce97b..c592069a3 100644 --- a/src/main/java/neqsim/thermodynamicOperations/propertyGenerator/OLGApropertyTableGeneratorWaterEven.java +++ b/src/main/java/neqsim/thermodynamicOperations/propertyGenerator/OLGApropertyTableGeneratorWaterEven.java @@ -415,9 +415,9 @@ public void run() { * { aMatrix.set(ii, 0, 1.0); aMatrix.set(ii, 1, pressures[i - ii]); aMatrix.set(ii, 2, * pressures[i - ii] * pressures[i - ii]); aMatrix.set(ii, 3, pressures[i - ii] * * pressures[i - ii] * pressures[i - ii]); } - * + * * for (int jj = 0; jj < 9; jj++) { Matrix xg = XMatrixgas.getMatrix(jj, jj, 0, 3); - * + * * try { xcoef[jj] = aMatrix.solve(xg.transpose()); } catch (Exception ex) { * logger.error(ex.getMessage(),e); } // logger.info("xcoef " + j); // xcoef.print(10, 10); * //logger.info("dss: " +ds * dxds.get(speceq, 0)); // specVal = xcoef.get(0, 0) + sny * diff --git a/src/main/java/neqsim/thermodynamicOperations/propertyGenerator/OLGApropertyTableGeneratorWaterStudents.java b/src/main/java/neqsim/thermodynamicOperations/propertyGenerator/OLGApropertyTableGeneratorWaterStudents.java index d636e5947..47ec15230 100644 --- a/src/main/java/neqsim/thermodynamicOperations/propertyGenerator/OLGApropertyTableGeneratorWaterStudents.java +++ b/src/main/java/neqsim/thermodynamicOperations/propertyGenerator/OLGApropertyTableGeneratorWaterStudents.java @@ -1202,7 +1202,7 @@ public void run() { * (temperatures[j] - temperatures[j - 1]))); if * (names[k].equals("LIQUID-WATER SURFACE TENSION") && props[k][i][j] < 10.0e-3) { * props[k][i][j] = 25.0e-3; LWS=1; } - * + * * if (names[k].equals("LIQUID-WATER SURFACE TENSION") && props[k][i][j] > 120.0e-3) { * props[k][i][j] = 80.0e-3; LWS=1; } } */ @@ -1237,7 +1237,7 @@ public void run() { * / (pressures[i - 1] - pressures[i - 3]) * (pressures[i] - pressures[i - 1]))); if * (names[k].equals("LIQUID-WATER SURFACE TENSION") && props[k][i][j] < 10.0e-3) { * props[k][i][j] = 25.0e-3; LWS=1; } - * + * * if (names[k].equals("LIQUID-WATER SURFACE TENSION") && props[k][i][j] > 120.0e-3) { * props[k][i][j] = 80.0e-3; LWS=1; } } */ diff --git a/src/main/java/neqsim/thermodynamicOperations/propertyGenerator/OLGApropertyTableGeneratorWaterStudentsPH.java b/src/main/java/neqsim/thermodynamicOperations/propertyGenerator/OLGApropertyTableGeneratorWaterStudentsPH.java index 8d4bc0ee3..53832fc2d 100644 --- a/src/main/java/neqsim/thermodynamicOperations/propertyGenerator/OLGApropertyTableGeneratorWaterStudentsPH.java +++ b/src/main/java/neqsim/thermodynamicOperations/propertyGenerator/OLGApropertyTableGeneratorWaterStudentsPH.java @@ -1187,7 +1187,7 @@ public void run() { * 3]) / (enthalpies[j - 1] - enthalpies[j - 3]) * (enthalpies[j] - enthalpies[j - * 1]))); if (names[k].equals("LIQUID-WATER SURFACE TENSION") && props[k][i][j] < * 10.0e-3) { props[k][i][j] = 25.0e-3; LWS=1; } - * + * * if (names[k].equals("LIQUID-WATER SURFACE TENSION") && props[k][i][j] > 120.0e-3) { * props[k][i][j] = 80.0e-3; LWS=1; } } */ @@ -1222,7 +1222,7 @@ public void run() { * / (pressures[i - 1] - pressures[i - 3]) * (pressures[i] - pressures[i - 1]))); if * (names[k].equals("LIQUID-WATER SURFACE TENSION") && props[k][i][j] < 10.0e-3) { * props[k][i][j] = 25.0e-3; LWS=1; } - * + * * if (names[k].equals("LIQUID-WATER SURFACE TENSION") && props[k][i][j] > 120.0e-3) { * props[k][i][j] = 80.0e-3; LWS=1; } } */ diff --git a/src/main/java/neqsim/util/database/NeqSimContractDataBase.java b/src/main/java/neqsim/util/database/NeqSimContractDataBase.java index cc29c7c44..1da880fb4 100644 --- a/src/main/java/neqsim/util/database/NeqSimContractDataBase.java +++ b/src/main/java/neqsim/util/database/NeqSimContractDataBase.java @@ -57,7 +57,7 @@ public NeqSimContractDataBase() { /** * Drops and re-creates table from contents in csv file. - * + * * @param tableName Name of table to replace */ public static void updateTable(String tableName) { diff --git a/src/main/java/neqsim/util/database/NeqSimDataBase.java b/src/main/java/neqsim/util/database/NeqSimDataBase.java index ba3860c5f..9495d05e8 100644 --- a/src/main/java/neqsim/util/database/NeqSimDataBase.java +++ b/src/main/java/neqsim/util/database/NeqSimDataBase.java @@ -419,7 +419,7 @@ public static boolean hasComponent(String compName) { /** * Drops and re-creates table from contents in csv file. - * + * * @param tableName Name of table to replace */ public static void updateTable(String tableName) { @@ -428,7 +428,7 @@ public static void updateTable(String tableName) { /** * Drops and re-creates table from contents in csv file. - * + * * @param tableName Name of table to replace * @param path Path to csv file to */ @@ -449,7 +449,7 @@ public static void updateTable(String tableName, String path) { /** * Drops and re-creates table from contents in csv file. - * + * * @param tableName Name of table to replace * @param path Path to csv file to */ diff --git a/src/main/java/neqsim/util/database/NeqSimProcessDesignDataBase.java b/src/main/java/neqsim/util/database/NeqSimProcessDesignDataBase.java index ccfabfe8f..2f1df9965 100644 --- a/src/main/java/neqsim/util/database/NeqSimProcessDesignDataBase.java +++ b/src/main/java/neqsim/util/database/NeqSimProcessDesignDataBase.java @@ -63,7 +63,7 @@ public NeqSimProcessDesignDataBase() { /** * Drops and re-creates table from contents in csv file. - * + * * @param tableName Name of table to replace */ public static void updateTable(String tableName) { diff --git a/src/main/java/neqsim/util/unit/LengthUnit.java b/src/main/java/neqsim/util/unit/LengthUnit.java index b8b1aad6d..867650ab9 100644 --- a/src/main/java/neqsim/util/unit/LengthUnit.java +++ b/src/main/java/neqsim/util/unit/LengthUnit.java @@ -21,7 +21,7 @@ public class LengthUnit extends neqsim.util.unit.BaseUnit { *

* Constructor for LengthUnit. *

- * + * * @param value Numeric value * @param name Name of unit */ diff --git a/src/main/java/neqsim/util/unit/TimeUnit.java b/src/main/java/neqsim/util/unit/TimeUnit.java index 466f12a5d..bb5aff3a7 100644 --- a/src/main/java/neqsim/util/unit/TimeUnit.java +++ b/src/main/java/neqsim/util/unit/TimeUnit.java @@ -21,7 +21,7 @@ public class TimeUnit extends neqsim.util.unit.BaseUnit { *

* Constructor for TimeUnit. *

- * + * * @param value Numeric value * @param name Name of unit */ diff --git a/src/test/java/neqsim/PVTsimulation/simulation/SaturationTemperatureTest.java b/src/test/java/neqsim/PVTsimulation/simulation/SaturationTemperatureTest.java index b43432f72..8534bc756 100644 --- a/src/test/java/neqsim/PVTsimulation/simulation/SaturationTemperatureTest.java +++ b/src/test/java/neqsim/PVTsimulation/simulation/SaturationTemperatureTest.java @@ -57,7 +57,7 @@ void testCalcSaturationTemperature() { *

* checkSaturationTemperatureToPhaseEnvelope. *

- * + * * @throws Exception */ @Test diff --git a/src/test/java/neqsim/processSimulation/processEquipment/absorber/SimpleAbsorberTest.java b/src/test/java/neqsim/processSimulation/processEquipment/absorber/SimpleAbsorberTest.java index 154a7b4f0..4bb8f6725 100644 --- a/src/test/java/neqsim/processSimulation/processEquipment/absorber/SimpleAbsorberTest.java +++ b/src/test/java/neqsim/processSimulation/processEquipment/absorber/SimpleAbsorberTest.java @@ -5,7 +5,7 @@ import org.junit.jupiter.api.Test; import neqsim.processSimulation.processEquipment.stream.Stream; -public class SimpleAbsorberTest extends neqsim.NeqSimTest{ +public class SimpleAbsorberTest extends neqsim.NeqSimTest { neqsim.thermo.system.SystemFurstElectrolyteEos testSystem; @BeforeEach @@ -31,7 +31,7 @@ void testRun() { * neqsim.processSimulation.processSystem.ProcessSystem operations = new * neqsim.processSimulation.processSystem.ProcessSystem(); operations.add(stream_Hot); * operations.add(absorber1); - * + * * operations.run(); */ // operations.displayResult(); diff --git a/src/test/java/neqsim/processSimulation/processEquipment/adsorber/SimpleAdsorberTest.java b/src/test/java/neqsim/processSimulation/processEquipment/adsorber/SimpleAdsorberTest.java index 5225d9c6a..e77f00adb 100644 --- a/src/test/java/neqsim/processSimulation/processEquipment/adsorber/SimpleAdsorberTest.java +++ b/src/test/java/neqsim/processSimulation/processEquipment/adsorber/SimpleAdsorberTest.java @@ -5,7 +5,7 @@ import org.junit.jupiter.api.Test; import neqsim.processSimulation.processEquipment.stream.Stream; -public class SimpleAdsorberTest extends neqsim.NeqSimTest{ +public class SimpleAdsorberTest extends neqsim.NeqSimTest { neqsim.thermo.system.SystemFurstElectrolyteEos testSystem; @BeforeEach @@ -16,7 +16,7 @@ void setUp() { testSystem.createDatabase(true); testSystem.setMixingRule(4); } - + @Disabled("Disabled until neqsim.processSimulation.processEquipment.adsorber.SimpleAdsorber is fixed") @Test void testRun() { @@ -31,7 +31,7 @@ void testRun() { * neqsim.processSimulation.processSystem.ProcessSystem operations = new * neqsim.processSimulation.processSystem.ProcessSystem(); operations.add(stream_Hot); * operations.add(adsorber1); - * + * * operations.run(); */ // operations.displayResult(); diff --git a/src/test/java/neqsim/processSimulation/processEquipment/compressor/CompressorChartTest.java b/src/test/java/neqsim/processSimulation/processEquipment/compressor/CompressorChartTest.java index 8e5d162d5..923d2268e 100644 --- a/src/test/java/neqsim/processSimulation/processEquipment/compressor/CompressorChartTest.java +++ b/src/test/java/neqsim/processSimulation/processEquipment/compressor/CompressorChartTest.java @@ -132,7 +132,7 @@ public void test_Run() { * comp1.getPolytropicHead()); logger.info("Polytropic eff from curve:" + * comp1.getPolytropicEfficiency() * 100.0); logger.info("flow " + * stream_1.getThermoSystem().getFlowRate("m3/hr")); - * + * * logger.info("speed " + comp1.getCompressorChart().getSpeed( * stream_1.getThermoSystem().getFlowRate("m3/hr") + 10.0, comp1.getPolytropicHead())); * logger.info("pressure out " + comp1.getOutletPressure()); logger.info("temperature out " + diff --git a/src/test/java/neqsim/processSimulation/processEquipment/distillation/DistillationColumnTest.java b/src/test/java/neqsim/processSimulation/processEquipment/distillation/DistillationColumnTest.java index 98814ee44..43f5c7870 100644 --- a/src/test/java/neqsim/processSimulation/processEquipment/distillation/DistillationColumnTest.java +++ b/src/test/java/neqsim/processSimulation/processEquipment/distillation/DistillationColumnTest.java @@ -107,13 +107,11 @@ public void DistillationColumnTest() throws Exception { * System.out.println("Column in is " + totalWaterIn + " kg/hr"); * System.out.println("Column out is " + totalWaterOut + " kg/hr"); * System.out.println("Column is solved " + column.solved()); - * - * - * + * * System.out.println("Calc Water Flow rate via fluid component " + waterFlowRateInColumn); * System.out.println("Calc Water Flow rate via molar mass and flow rate total " + * waterFlowRateInColumn2 + " kg/hr"); - * + * * System.out .println("condenser temperature " + * column.getCondenser().getFluid().getTemperature("C")); System.out.println("condenser duty " + * ((Condenser) column.getCondenser()).getDuty()); diff --git a/src/test/java/neqsim/processSimulation/processEquipment/reservoir/WellFlowTest.java b/src/test/java/neqsim/processSimulation/processEquipment/reservoir/WellFlowTest.java index 58ea795fa..039dfcab8 100644 --- a/src/test/java/neqsim/processSimulation/processEquipment/reservoir/WellFlowTest.java +++ b/src/test/java/neqsim/processSimulation/processEquipment/reservoir/WellFlowTest.java @@ -118,7 +118,7 @@ void testRunTransient() { * System.out.println("reservoir pressure " + wellflow.getInletStream().getPressure("bara")); * System.out .println("pres bottomhole " + wellflow.getOutletStream().getPressure("bara") + * " bara"); - * + * * System.out.println("xmas pressure " + pipe.getOutletStream().getPressure("bara") + * " bara"); System.out .println("top side pressure " + * pipeline.getOutletStream().getPressure("bara") + " bara"); System.out diff --git a/src/test/java/neqsim/processSimulation/processSystem/GlycolRigTest.java b/src/test/java/neqsim/processSimulation/processSystem/GlycolRigTest.java index 537d765c4..4c5387eae 100644 --- a/src/test/java/neqsim/processSimulation/processSystem/GlycolRigTest.java +++ b/src/test/java/neqsim/processSimulation/processSystem/GlycolRigTest.java @@ -212,20 +212,19 @@ public void runDistillationProcessTest() { /* * logger.info("wt n-hexane from column " + * column.getLiquidOutStream().getFluid().getPhase("oil").getWtFrac("n-hexane") * 100.0); - * + * * logger.info("wt methane from column " + * column.getLiquidOutStream().getFluid().getPhase("oil").getWtFrac("methane") * 100.0); - * + * * logger.info("wt propane from column " + * column.getLiquidOutStream().getFluid().getPhase("oil").getWtFrac("propane") * 100.0); - * - * + * * logger.info("wt n-hexane from gas column " + * column.getGasOutStream().getFluid().getPhase("gas").getWtFrac("n-hexane") * 100.0); - * + * * logger.info("wt methane from gas column " + * column.getGasOutStream().getFluid().getPhase("gas").getWtFrac("methane") * 100.0); - * + * * logger.info("wt propane from gas column " + * column.getGasOutStream().getFluid().getPhase("gas").getWtFrac("propane") * 100.0); */ @@ -262,14 +261,13 @@ public void runDistillationProcessTest2() { /* * logger.info("wt n-hexane from column " + * column.getLiquidOutStream().getFluid().getPhase("oil").getWtFrac("n-hexane") * 100.0); - * + * * logger.info("wt propane from column " + * column.getLiquidOutStream().getFluid().getPhase("oil").getWtFrac("propane") * 100.0); - * - * + * * logger.info("wt n-hexane from gas column " + * column.getGasOutStream().getFluid().getPhase("gas").getWtFrac("n-hexane") * 100.0); - * + * * logger.info("wt propane from gas column " + * column.getGasOutStream().getFluid().getPhase("gas").getWtFrac("propane") * 100.0); */ @@ -320,29 +318,28 @@ public void runDistillationProcessTest3() { /* * logger.info("wt n-hexane from column " + * column.getLiquidOutStream().getFluid().getPhase("oil").getWtFrac("n-hexane") * 100.0); - * + * * logger.info("wt ethane from column " + * column.getLiquidOutStream().getFluid().getPhase("oil").getWtFrac("ethane") * 100.0); - * - * + * * logger.info("wt n-hexane from gas column " + * column.getGasOutStream().getFluid().getPhase("gas").getWtFrac("n-hexane") * 100.0); - * + * * logger.info("wt ethane from gas column " + * column.getGasOutStream().getFluid().getPhase("gas").getWtFrac("ethane") * 100.0); - * + * * logger.info("flow rate gas " + * column.getGasOutStream().getFluid().getPhase("gas").getFlowRate("kg/hr") + " kg/hr"); - * + * * logger.info("flow rate oil " + * column.getLiquidOutStream().getFluid().getPhase("oil").getFlowRate("kg/hr") + " kg/hr"); - * + * * System.out .println("flow rate oil " + feedToRegenerator.getFluid().getFlowRate("kg/hr") + * " kg/hr"); - * + * * System.out .println("flow rate gas " + feedToRegenerator2.getFluid().getFlowRate("kg/hr") + * " kg/hr"); column.massBalanceCheck(); - * + * */ } } diff --git a/src/test/java/neqsim/processSimulation/processSystem/waterDegasserTest.java b/src/test/java/neqsim/processSimulation/processSystem/waterDegasserTest.java index 1cf8e7374..4cef57cca 100644 --- a/src/test/java/neqsim/processSimulation/processSystem/waterDegasserTest.java +++ b/src/test/java/neqsim/processSimulation/processSystem/waterDegasserTest.java @@ -175,7 +175,7 @@ public void runProcess2() throws InterruptedException { * heater_TP_setter_main_stream.setOutTemperature(77.92657470703125, "C"); * heater_TP_setter_main_stream.run(); * System.out.println(heater_TP_setter_main_stream.getOutStream().getFlowRate( "kg/hr")); - * + * * neqsim.thermo.system.SystemSrkCPAstatoil fluid_test_separator = new * neqsim.thermo.system.SystemSrkCPAstatoil(273.15 + 42.0, 10.00); * fluid_test_separator.addComponent("water", 0.15); @@ -215,32 +215,32 @@ public void runProcess2() throws InterruptedException { * 036010742188/1000,608 .036010742188/(1000*0.642772477456171)); * fluid_test_separator.setMixingRule(10); fluid_test_separator.setMultiPhaseCheck(true); * fluid_test_separator.init(0); - * + * * neqsim.processSimulation.processEquipment.stream.Stream inlet_stream_test_sep = new * neqsim.processSimulation.processEquipment.stream.Stream( * "TEST_SEPARATOR_INLET,fluid_test_separator", fluid_test_separator); * inlet_stream_test_sep.setTemperature(39.92721557617188, "C"); * inlet_stream_test_sep.setPressure(1.4343990154266357, "bara"); * inlet_stream_test_sep.setFlowRate(472.5621656362427, "kg/hr"); inlet_stream_test_sep.run(); - * + * * neqsim.processSimulation.processEquipment.separator.ThreePhaseSeparator test_separator = new * neqsim.processSimulation.processEquipment.separator.ThreePhaseSeparator( * inlet_stream_test_sep); test_separator.setName("TEST_SEPARATOR"); test_separator.run(); - * + * * neqsim.processSimulation.processEquipment.heatExchanger.Heater heater_TP_setter_test_stream = * new neqsim.processSimulation.processEquipment.heatExchanger.Heater( * "TP_SETTER_FOR_THE_DEGASSER_TEST_SEP_STREAM", test_separator.getWaterOutStream()); * heater_TP_setter_test_stream.setOutPressure(6.22176469039917, "bara"); * heater_TP_setter_test_stream.setOutTemperature(77.92657470703125, "C"); * heater_TP_setter_test_stream.run(); - * + * * neqsim.processSimulation.processEquipment.mixer.StaticMixer mixing_degasser = new * neqsim.processSimulation.processEquipment.mixer.StaticMixer(); * mixing_degasser.setName("MIXING_BEFORE_THE_DEGASSER"); * mixing_degasser.addStream(heater_TP_setter_main_stream.getOutStream()); * mixing_degasser.addStream(heater_TP_setter_test_stream.getOutStream()); * mixing_degasser.run(); - * + * * System.out.println(mixing_degasser.getOutStream().getFlowRate("kg/hr")); // Should be arount * 33946.08070091751 */ diff --git a/src/test/java/neqsim/processSimulation/util/example/OffshoreProcess3.java b/src/test/java/neqsim/processSimulation/util/example/OffshoreProcess3.java index 2a483e700..bb6cdbb0a 100644 --- a/src/test/java/neqsim/processSimulation/util/example/OffshoreProcess3.java +++ b/src/test/java/neqsim/processSimulation/util/example/OffshoreProcess3.java @@ -128,11 +128,11 @@ public static void main(String[] args) { * Stream coolingWater = new Stream("cooling water", coolingWaterSYstm); * coolingWater.setFlowRate(500900.2, "kg/hr"); coolingWater.setTemperature(10.0, "C"); * coolingWater.setPressure(10.0, "bara"); - * + * * HeatExchanger heatEx = new HeatExchanger(lpcompressor.getOutStream()); * heatEx.setName("LP heat Exchanger"); heatEx.setGuessOutTemperature(273.15+40.0); * heatEx.setUAvalue(45000.0); heatEx.setFeedStream(1, coolingWater); - * + * */ Cooler lpHeatExchanger = @@ -281,28 +281,27 @@ public static void main(String[] args) { /* * // System.out.println("second stage comp power " + ((Compressor) // * operations.getUnit("2nd stage recompressor")).getPower()/1.0e3 + " kW"); - * + * * // System.out.println("first stage comp power " + ((Compressor) * operations.getUnit("1st stage recompressor")).getPower()/1.0e3 + " kW"); - * + * * System.out.println("gas from inlet separator " + ((Separator) * operations.getUnit("1st stage separator")) * .getGasOutStream().getFluid().getFlowRate("MSm3/day")); - * + * * System.out .println("pressure of export oil " + ((Stream) * operations.getUnit("stable oil")).getPressure("bara")); - * + * * System.out.println( "temperature of export oil " + ((Stream) * operations.getUnit("stable oil")).getTemperature("C")); - * + * * System.out.println("TVP of export oil (30.0 C) " + ((Stream) * operations.getUnit("stable oil")).TVP(30.0, "C")); - * + * * // System.out.println("entropy production " + // operations.getEntropyProduction("J/K") + * " J/K"); // System.out.println("mass balance separator " + ((Separator) * operations.getUnit("scrubber of mix gas HP")).getMassBalance("kg/sec") + " kg/sec"); - * - * + * * // liqFromlpscrubber.displayResult(); // richGas.phaseEnvelope(); // richGas.displayResult(); * operations.save("c:/temp/offshorePro.neqsim"); * inletSeparator.getLiquidOutStream().getFluid().display(); diff --git a/src/test/java/neqsim/processSimulation/util/example/TEGdehydrationProcessDistillationAaHa.java b/src/test/java/neqsim/processSimulation/util/example/TEGdehydrationProcessDistillationAaHa.java index 957f8841d..c5693ce80 100644 --- a/src/test/java/neqsim/processSimulation/util/example/TEGdehydrationProcessDistillationAaHa.java +++ b/src/test/java/neqsim/processSimulation/util/example/TEGdehydrationProcessDistillationAaHa.java @@ -316,7 +316,7 @@ public static void main(String[] args) { * System.out.println("wt lean TEG " + ((WaterStripperColumn) * operations.getUnit("TEG stripper")) * .getSolventOutStream().getFluid().getPhase("aqueous").getWtFrac("TEG") * 100.0); - * + * * double waterInWetGasppm = * waterSaturatedFeedGas.getFluid().getPhase(0).getComponent("water").getz() * 1.0e6; double * waterInWetGaskgMSm3 = waterInWetGasppm * 0.01802 *ThermodynamicConstantsInterface.atm / @@ -337,22 +337,22 @@ public static void main(String[] args) { * System.out.println("flow rate from pump2 " + * hotLeanTEGPump2.getOutStream().getFluid().getFlowRate("kg/hr")); * System.out.println("makeup TEG " + makeupTEG.getFluid().getFlowRate("kg/hr")); - * + * * TEGFeed.getFluid().display(); absorber.run(); - * + * * System.out.println("pump power " + hotLeanTEGPump.getDuty()); * System.out.println("pump2 power " + hotLeanTEGPump2.getDuty()); * System.out.println("wt lean TEG after reboiler " + * column.getLiquidOutStream().getFluid().getPhase("aqueous").getWtFrac("TEG")); * System.out.println("temperature from pump " + * (hotLeanTEGPump2.getOutStream().getTemperature() - 273.15)); - * + * * System.out.println("flow rate from reboiler " + ((Reboiler) * column.getReboiler()).getLiquidOutStream().getFlowRate("kg/hr")); * System.out.println("flow rate from pump2 " + * hotLeanTEGPump2.getOutStream().getFluid().getFlowRate("kg/hr")); * System.out.println("flow rate to flare " + gasToFlare.getFluid().getFlowRate("kg/hr")); - * + * * System.out.println("condenser duty " + ((Condenser) ((DistillationColumn) * operations.getUnit("TEG regeneration column")).getCondenser()) .getDuty() / 1.0e3); * System.out.println( "richGLycolHeaterCondenser duty " + @@ -360,17 +360,16 @@ public static void main(String[] args) { * System.out.println("richGLycolHeaterCondenser temperature out " + * richGLycolHeaterCondenser.getOutStream().getTemperature("C")); * richGLycolHeaterCondenser.run(); - * + * * hotLeanTEGPump.getOutStream().displayResult(); flashLiquid.displayResult(); - * + * * System.out.println("Temperature rich TEG out of reflux condenser " + * richGLycolHeaterCondenser.getOutStream().getTemperature("C")); heatEx.displayResult(); * System.out.println("glycol out temperature " + * glycol_flash_valve2.getOutStream().getFluid().getTemperature("C")); * System.out.println("glycol out temperature2 " +heatEx2.getOutStream(0).getTemperature("C")); * System.out.println("glycol out temperature2 " +heatEx2.getOutStream(1).getTemperature("C")); - * - * + * * System.out.println("out water rate LP valve" + * glycol_flash_valve2.getOutStream().getFluid().getPhase(0).getComponent( * "water").getNumberOfmoles()); System.out.println("glycol out water rate reboil " + @@ -380,29 +379,26 @@ public static void main(String[] args) { * getNumberOfmoles()); System.out.println("recycle out water rate " * +recycleGasFromStripper.getOutletStream().getFluid().getComponent("water"). * getNumberOfmoles()); - * + * * System.out.println("water dew point of dry gas " + * waterDewPointAnalyser.getMeasuredValue("C")); - * - * + * * System.out.println("hydrocarbons in lean TEG " + (1.0- * stripper.getLiquidOutStream().getFluid().getPhase(0).getWtFrac("TEG")- * stripper.getLiquidOutStream().getFluid().getPhase(0).getWtFrac("water"))*1e6 + " mg/kg"); * System.out.println("hydrocarbons in rich TEG " + (1.0- * flashLiquid.getFluid().getPhase(0).getWtFrac("TEG")-flashLiquid.getFluid(). * getPhase(0).getWtFrac("water"))*1e6 + " mg/kg"); - * + * * //double dewT = ((WaterDewPointAnalyser)operations. * getMeasurementDevice("water dew point analyser")).getMeasuredValue("C"); * //waterDewPointAnalyser.setOnlineValue(measured, unit) * //waterDewPointAnalyser.setOnlineSignal(isOnlineSignal, plantName, transmitterame); - * - * - * + * * //Heat echanger test - * + * * //Sabe and Open copy of model - * + * * ProcessSystem locoperations = operations.copy(); * //((HeatExchanger)locoperations.getUnit("rich TEG heat exchanger 2")). * getInStream(0).setTemperature(298.15, "C"); @@ -417,8 +413,7 @@ public static void main(String[] args) { * eff = ((HeatExchanger)locoperations.getUnit("rich TEG heat exchanger 2")). * getThermalEffectiveness(); System.out.println("eff " + eff); //store fouling factor in * dataframe - * - * + * * dehydratedGas.getFluid().display(); */ diff --git a/src/test/java/neqsim/processSimulation/util/example/TEGdehydrationProcessDistillationGFA.java b/src/test/java/neqsim/processSimulation/util/example/TEGdehydrationProcessDistillationGFA.java index 76c44ce6b..a38b44c6c 100644 --- a/src/test/java/neqsim/processSimulation/util/example/TEGdehydrationProcessDistillationGFA.java +++ b/src/test/java/neqsim/processSimulation/util/example/TEGdehydrationProcessDistillationGFA.java @@ -499,22 +499,22 @@ public static void main(String[] args) { * System.out.println("flow rate from pump2 " + * hotLeanTEGPump2.getOutStream().getFluid().getFlowRate("kg/hr")); * System.out.println("makeup TEG " + makeupTEG.getFluid().getFlowRate("kg/hr")); - * + * * TEGFeed.getFluid().display(); absorber.run(); - * + * * System.out.println("pump power " + hotLeanTEGPump.getDuty()); * System.out.println("pump2 power " + hotLeanTEGPump2.getDuty()); * System.out.println("wt lean TEG after reboiler " + * column.getLiquidOutStream().getFluid().getPhase("aqueous").getWtFrac("TEG")); * System.out.println("temperature from pump " + * (hotLeanTEGPump2.getOutStream().getTemperature() - 273.15)); - * + * * System.out.println("flow rate from reboiler " + ((Reboiler) * column.getReboiler()).getLiquidOutStream().getFlowRate("kg/hr")); * System.out.println("flow rate from pump2 " + * hotLeanTEGPump2.getOutStream().getFluid().getFlowRate("kg/hr")); * System.out.println("flow rate to flare " + gasToFlare.getFluid().getFlowRate("kg/hr")); - * + * * System.out.println("condenser duty " + ((Condenser) ((DistillationColumn) * operations.getUnit("TEG regeneration column")).getCondenser()) .getDuty() / 1.0e3); * System.out.println( "richGLycolHeaterCondenser duty " + @@ -522,17 +522,16 @@ public static void main(String[] args) { * System.out.println("richGLycolHeaterCondenser temperature out " + * richGLycolHeaterCondenser.getOutStream().getTemperature("C")); * richGLycolHeaterCondenser.run(); - * + * * hotLeanTEGPump.getOutStream().displayResult(); flashLiquid.displayResult(); - * + * * System.out.println("Temperature rich TEG out of reflux condenser " + * richGLycolHeaterCondenser.getOutStream().getTemperature("C")); heatEx.displayResult(); * System.out.println("glycol out temperature " + * glycol_flash_valve2.getOutStream().getFluid().getTemperature("C")); * System.out.println("glycol out temperature2 " +heatEx2.getOutStream(0).getTemperature("C")); * System.out.println("glycol out temperature2 " +heatEx2.getOutStream(1).getTemperature("C")); - * - * + * * System.out.println("out water rate LP valve" + * glycol_flash_valve2.getOutStream().getFluid().getPhase(0).getComponent("water"). * getNumberOfmoles()); System.out.println("glycol out water rate reboil " + ((Reboiler) @@ -542,19 +541,17 @@ public static void main(String[] args) { * getNumberOfmoles()); System.out.println("recycle out water rate " * +recycleGasFromStripper.getOutletStream().getFluid().getComponent("water"). * getNumberOfmoles()); - * + * * System.out.println("water dew point of dry gas " + * waterDewPointAnalyser.getMeasuredValue("C")); - * + * * //double dewT = * ((WaterDewPointAnalyser)operations.getMeasurementDevice("water dew point analyser")). * getMeasuredValue("C"); //waterDewPointAnalyser.setOnlineValue(measured, unit) * //waterDewPointAnalyser.setOnlineSignal(isOnlineSignal, plantName, transmitterame); - * - * - * + * * //Heat exchanger test - * + * * //Sabe and Open copy of model */ // ProcessSystem locoperations = operations.copy(); diff --git a/src/test/java/neqsim/processSimulation/util/example/TestNeqsim.java b/src/test/java/neqsim/processSimulation/util/example/TestNeqsim.java index 689464d53..1462b4eeb 100644 --- a/src/test/java/neqsim/processSimulation/util/example/TestNeqsim.java +++ b/src/test/java/neqsim/processSimulation/util/example/TestNeqsim.java @@ -118,12 +118,12 @@ public static void main(String[] args) { /* * temperature[i] = compressor1.getOutStream().getTemperature(); work [i] = * compressor1.getTotalWork(); - * + * * Cp_Vapour [i] = compressor1.getOutStream().getThermoSystem().getPhase(0).getCp(); Cp_liquid * [i] = compressor1.getOutStream().getThermoSystem().getPhase(1).getCp(); Cp [i] = * compressor1.getOutStream().getThermoSystem().getPhase(0).getBeta() * Cp_Vapour [i] + * compressor1.getOutStream().getThermoSystem().getPhase(1).getBeta()* Cp_liquid [i]; - * + * * Density_Vapour [i] = compressor1.getOutStream().getThermoSystem().getPhase(0).getDensity(); * Density_liquid [i] = compressor1.getOutStream().getThermoSystem().getPhase(1).getDensity(); * Density [i] = compressor1.getOutStream().getThermoSystem().getWtFraction(0) * Density_Vapour @@ -141,20 +141,20 @@ public static void main(String[] args) { // catch(Exception ex){ /* * System.out.println( "P_out" ); for (int i=0;i<10;i++ ) { System.out.println(20 + 5*i); - * + * * } - * + * * System.out.println( "Temperature" ); for (int i=0;i<10;i++ ) { System.out.println( * temperature[i] ); - * + * * } - * + * * System.out.println( "Work" ); for (int i=0;i<10;i++ ) { System.out.println( work [i] ); - * + * * } System.out.println( "Cp" ); for (int i=0;i<10;i++ ) { System.out.println( Cp [i] ); - * + * * } - * + * * System.out.println( "Density" ); for (int i=0;i<10;i++ ) { System.out.println( Density [i] ); */ } diff --git a/src/test/java/neqsim/processSimulation/util/example/TestTransientFlow.java b/src/test/java/neqsim/processSimulation/util/example/TestTransientFlow.java index d6ef3fd9e..c047e2ec8 100644 --- a/src/test/java/neqsim/processSimulation/util/example/TestTransientFlow.java +++ b/src/test/java/neqsim/processSimulation/util/example/TestTransientFlow.java @@ -122,11 +122,11 @@ public static void main(String args[]) { * // transient behaviour operations.setTimeStep(1.1); for(int i=0;i<50;i++){ * operations.runTransient(); System.out.println("liquid level " + separator_1.getLiquidLevel()+ * " PRESSURE " + separator_1.getGasOutStream().getPressure()); } - * + * * operations.setTimeStep(30.0); for(int i=0;i<2000;i++){ operations.runTransient(); * System.out.println("liquid level " + separator_1.getLiquidLevel()+ " PRESSURE " + * separator_1.getGasOutStream().getPressure()); } operations.displayResult(); - * + * * operations.displayResult(); */ } diff --git a/src/test/java/neqsim/processSimulation/util/example/destillation1.java b/src/test/java/neqsim/processSimulation/util/example/destillation1.java index ae1770fa0..6edfddf53 100644 --- a/src/test/java/neqsim/processSimulation/util/example/destillation1.java +++ b/src/test/java/neqsim/processSimulation/util/example/destillation1.java @@ -7,64 +7,66 @@ import neqsim.thermodynamicOperations.ThermodynamicOperations; /** - *

destillation1 class.

+ *

+ * destillation1 class. + *

* * @author asmund * @version $Id: $Id * @since 2.2.3 */ public class destillation1 { - /** - * This method is just meant to test the thermo package. - * - * @param args an array of {@link java.lang.String} objects - */ - public static void main(String args[]) { - neqsim.thermo.system.SystemInterface testSystem = - new neqsim.thermo.system.SystemSrkEos((273.15 + 63.0), 16.00); - // testSystem.addComponent("methane", 1.00); - testSystem.addComponent("ethane", 0.002); - // testSystem.addComponent("CO2", 10.00); - testSystem.addComponent("propane", 0.605900); - testSystem.addComponent("i-butane", 0.1473); - testSystem.addComponent("n-butane", 0.2414); - testSystem.addComponent("i-pentane", 0.00322); - testSystem.addComponent("n-pentane", 0.0002); - testSystem.addComponent("methanol", 0.00005); - // testSystem.addComponent("n-heptane", 100.0); - testSystem.createDatabase(true); - testSystem.setMixingRule(2); - ThermodynamicOperations testOps = new ThermodynamicOperations(testSystem); - testOps.TPflash(); - testSystem.display(); + /** + * This method is just meant to test the thermo package. + * + * @param args an array of {@link java.lang.String} objects + */ + public static void main(String args[]) { + neqsim.thermo.system.SystemInterface testSystem = + new neqsim.thermo.system.SystemSrkEos((273.15 + 63.0), 16.00); + // testSystem.addComponent("methane", 1.00); + testSystem.addComponent("ethane", 0.002); + // testSystem.addComponent("CO2", 10.00); + testSystem.addComponent("propane", 0.605900); + testSystem.addComponent("i-butane", 0.1473); + testSystem.addComponent("n-butane", 0.2414); + testSystem.addComponent("i-pentane", 0.00322); + testSystem.addComponent("n-pentane", 0.0002); + testSystem.addComponent("methanol", 0.00005); + // testSystem.addComponent("n-heptane", 100.0); + testSystem.createDatabase(true); + testSystem.setMixingRule(2); + ThermodynamicOperations testOps = new ThermodynamicOperations(testSystem); + testOps.TPflash(); + testSystem.display(); - Stream stream_1 = new Stream("Stream1", testSystem); + Stream stream_1 = new Stream("Stream1", testSystem); - DistillationColumn column = new DistillationColumn(9, true, true); - column.addFeedStream(stream_1, 4); - ((Reboiler) column.getReboiler()).setRefluxRatio(3.7); - ((Condenser) column.getCondenser()).setRefluxRatio(10.7); - // column.setReboilerTemperature(360); - // column.setReboilerTemperature(300); - /* - * Heater heater = new Heater((Stream) column.getGasOutStream()); heater.setdT(-15.0); - * - * DistillationColumn column2 = new DistillationColumn(4, true, true); - * column2.addFeedStream(heater.getOutStream(), 2); ((Reboiler) - * column2.getReboiler()).setRefluxRatio(0.01); ((Condenser) - * column2.getCondenser()).setRefluxRatio(0.01); - */ + DistillationColumn column = new DistillationColumn(9, true, true); + column.addFeedStream(stream_1, 4); + ((Reboiler) column.getReboiler()).setRefluxRatio(3.7); + ((Condenser) column.getCondenser()).setRefluxRatio(10.7); + // column.setReboilerTemperature(360); + // column.setReboilerTemperature(300); + /* + * Heater heater = new Heater((Stream) column.getGasOutStream()); heater.setdT(-15.0); + * + * DistillationColumn column2 = new DistillationColumn(4, true, true); + * column2.addFeedStream(heater.getOutStream(), 2); ((Reboiler) + * column2.getReboiler()).setRefluxRatio(0.01); ((Condenser) + * column2.getCondenser()).setRefluxRatio(0.01); + */ - neqsim.processSimulation.processSystem.ProcessSystem operations = - new neqsim.processSimulation.processSystem.ProcessSystem(); - operations.add(stream_1); - operations.add(column); - // operations.add(heater); - // operations.add(column2); + neqsim.processSimulation.processSystem.ProcessSystem operations = + new neqsim.processSimulation.processSystem.ProcessSystem(); + operations.add(stream_1); + operations.add(column); + // operations.add(heater); + // operations.add(column2); - operations.run(); - // column.getReboiler().displayResult(); - // column.getCondenser().displayResult(); - // operations.displayResult(); - } + operations.run(); + // column.getReboiler().displayResult(); + // column.getCondenser().displayResult(); + // operations.displayResult(); + } } diff --git a/src/test/java/neqsim/processSimulation/util/example/shtokman.java b/src/test/java/neqsim/processSimulation/util/example/shtokman.java index 746751e2d..4a6e1e0ad 100644 --- a/src/test/java/neqsim/processSimulation/util/example/shtokman.java +++ b/src/test/java/neqsim/processSimulation/util/example/shtokman.java @@ -63,7 +63,7 @@ public static void main(String args[]) { // ThermodynamicOperations ops = new ThermodynamicOperations(stream_2.getThermoSystem()); /* * try { // ops.TPflash(); - * + * * ops.waterPrecipitationTemperature(); stream_2.getThermoSystem().display(); * stream_2.getThermoSystem().init(0); ops.hydrateFormationTemperature(2); * stream_2.getThermoSystem().display(); // stream_2.getThermoSystem().display(); // @@ -73,7 +73,7 @@ public static void main(String args[]) { * getThermoSystem().getPhase(1).getComponent("MEG").getMolarMass(); double wtwater = * stream_2.getThermoSystem().getPhase(1).getComponent("water").getx()*stream_2. * getThermoSystem().getPhase(1).getComponent("water").getMolarMass(); - * + * * System.out.println("wt% MEG " + wtMEG/(wtMEG+wtwater)*100); // operations.displayResult(); */ } diff --git a/src/test/java/neqsim/standards/gasQuality/Standard_ISO6976Test.java b/src/test/java/neqsim/standards/gasQuality/Standard_ISO6976Test.java index f0340b852..0b97489a9 100644 --- a/src/test/java/neqsim/standards/gasQuality/Standard_ISO6976Test.java +++ b/src/test/java/neqsim/standards/gasQuality/Standard_ISO6976Test.java @@ -112,16 +112,13 @@ void testCalculate2() { * testSystem.addComponent("22-dim-C3", 0.001015); testSystem.addComponent("n-hexane", * 0.002865); testSystem.addComponent("nitrogen", 0.01023); testSystem.addComponent("CO2", * 0.015236); - * */ /* - * * testSystem.addComponent("methane", 0.9247); testSystem.addComponent("ethane", 0.035); * testSystem.addComponent("propane", 0.0098); testSystem.addComponent("n-butane", 0.0022); * testSystem.addComponent("i-butane", 0.0034); testSystem.addComponent("n-pentane", 0.0006); * testSystem.addComponent("nitrogen", 0.0175); testSystem.addComponent("CO2", 0.0068); - * */ // testSystem.addComponent("water", 0.016837); @@ -130,7 +127,7 @@ void testCalculate2() { * testSystem.addComponent("n-hexane", 0.0); testSystem.addComponent("n-heptane", 0.0); * testSystem.addComponent("n-octane", 0.0); testSystem.addComponent("n-nonane", 0.0); * testSystem.addComponent("nC10", 0.0); - * + * * testSystem.addComponent("CO2", 0.68); testSystem.addComponent("H2S", 0.0); * testSystem.addComponent("water", 0.0); testSystem.addComponent("oxygen", 0.0); * testSystem.addComponent("carbonmonoxide", 0.0); testSystem.addComponent("nitrogen", 1.75); @@ -161,7 +158,7 @@ void testCalculate2() { * StandardInterface standardUK = new UKspecifications_ICF_SI(testSystem); * standardUK.calculate(); logger.info("ICF " + * standardUK.getValue("IncompleteCombustionFactor", "")); - * + * * logger.info("HID " + testSystem.getPhase(0).getComponent("methane").getHID(273.15 - 150.0)); * logger.info("Hres " + testSystem.getPhase(0).getComponent("methane").getHresTP(273.15 - * 150.0)); diff --git a/src/test/java/neqsim/standards/gasQuality/Standard_ISO6976_2016_Test.java b/src/test/java/neqsim/standards/gasQuality/Standard_ISO6976_2016_Test.java index 86e9b06e1..26d8a8677 100644 --- a/src/test/java/neqsim/standards/gasQuality/Standard_ISO6976_2016_Test.java +++ b/src/test/java/neqsim/standards/gasQuality/Standard_ISO6976_2016_Test.java @@ -126,7 +126,7 @@ void testCalculate2() { * StandardInterface standardUK = new UKspecifications_ICF_SI(testSystem); * standardUK.calculate(); logger.info("ICF " + * standardUK.getValue("IncompleteCombustionFactor", "")); - * + * * logger.info("HID " + testSystem.getPhase(0).getComponent("methane").getHID(273.15 - 150.0)); * logger.info("Hres " + testSystem.getPhase(0).getComponent("methane").getHresTP(273.15 - * 150.0)); diff --git a/src/test/java/neqsim/thermo/system/SystemUMRCPAEoStest.java b/src/test/java/neqsim/thermo/system/SystemUMRCPAEoStest.java index 87122f1eb..fd0d106f2 100644 --- a/src/test/java/neqsim/thermo/system/SystemUMRCPAEoStest.java +++ b/src/test/java/neqsim/thermo/system/SystemUMRCPAEoStest.java @@ -204,7 +204,7 @@ public void checkFugacityCoefficientsDn2() { *

* checkPhaseEnvelope. *

- * + * * @throws Exception */ // @Test diff --git a/src/test/java/neqsim/thermo/system/SystemUMRPRUMCEosNewTest.java b/src/test/java/neqsim/thermo/system/SystemUMRPRUMCEosNewTest.java index d54510017..14af4075e 100644 --- a/src/test/java/neqsim/thermo/system/SystemUMRPRUMCEosNewTest.java +++ b/src/test/java/neqsim/thermo/system/SystemUMRPRUMCEosNewTest.java @@ -189,7 +189,7 @@ public void checkFugacityCoefficientsDn2() { *

* checkPhaseEnvelope. *

- * + * * @throws Exception */ @Test @@ -220,7 +220,7 @@ public void checkPhaseEnvelope() throws Exception { *

* checkPhaseEnvelope2. *

- * + * * @throws Exception */ @Test diff --git a/src/test/java/neqsim/thermo/util/example/BubbleFlashCPA.java b/src/test/java/neqsim/thermo/util/example/BubbleFlashCPA.java index d0f6c9965..33f06f01e 100644 --- a/src/test/java/neqsim/thermo/util/example/BubbleFlashCPA.java +++ b/src/test/java/neqsim/thermo/util/example/BubbleFlashCPA.java @@ -47,13 +47,13 @@ public static void main(String args[]) { testSystem.addComponent("TEG", 100.0); /* * testSystem.addComponent("methane", 69.243); - * + * * testSystem.addComponent("CO2", 4.113); testSystem.addComponent("ethane", 8.732); * testSystem.addComponent("propane", 4.27); testSystem.addComponent("n-pentane", 1.641); * testSystem.addComponent("i-pentane", 0.877); - * + * * testSystem.addComponent("benzene", 1.27); - * + * * testSystem.addTBPfraction("C6", 1.49985, 86.178 / 1000.0, 0.664); * testSystem.addTBPfraction("C7", 1.359864, 96.0 / 1000.0, 0.738); * testSystem.addTBPfraction("C8", 0.939906, 107.0 / 1000.0, 0.765); diff --git a/src/test/java/neqsim/thermo/util/example/LNGFlash.java b/src/test/java/neqsim/thermo/util/example/LNGFlash.java index 9c6afda1b..ea57a444f 100644 --- a/src/test/java/neqsim/thermo/util/example/LNGFlash.java +++ b/src/test/java/neqsim/thermo/util/example/LNGFlash.java @@ -66,8 +66,6 @@ public static void main(String args[]) { * ThermodynamicOperations(testSystem); try { testOps.TPflash(); // testSystem.display(); // * testOps.freezingPointTemperatureFlash(); // testOps.calcWAT(); testSystem.display(); } catch * (Exception ex) { logger.error(ex.getMessage(),e); } } - * - * */ } } 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 0e1c68525..0df3439f5 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 @@ -75,10 +75,10 @@ public static void main(String args[]) { /* * testSystem.setTemperature(273.15 + 0.0); testSystem.setPressure(100.0); try { * testOps.TPflash(); // testOps.bubblePointTemperatureFlash(); } catch (Exception ex) { - * + * * } testSystem.init(2); testSystem.setPressure(100.0); // System.out.println("entropy spec" + * entropy); - * + * * // testSystem.setPressure(20.894745); */ testSystem.setPressure(10.0); diff --git a/src/test/java/neqsim/thermo/util/example/PhaseEnvelope.java b/src/test/java/neqsim/thermo/util/example/PhaseEnvelope.java index b724bdb32..fb958e018 100644 --- a/src/test/java/neqsim/thermo/util/example/PhaseEnvelope.java +++ b/src/test/java/neqsim/thermo/util/example/PhaseEnvelope.java @@ -109,10 +109,10 @@ public static void main(String args[]) { * testOps.setRunAsThread(true); testOps.waterDewPointLine(10, 200); boolean isFinished = * testOps.waitAndCheckForFinishedCalculation(50000); double[][] waterData = * testOps.getData(); - * + * * testOps.hydrateEquilibriumLine(10, 200); isFinished = * testOps.waitAndCheckForFinishedCalculation(50000); double[][] hydData = testOps.getData(); - * + * * testSystem.addComponent("water", * -testSystem.getPhase(0).getComponent("water").getNumberOfmoles()); */ diff --git a/src/test/java/neqsim/thermo/util/example/ReadFluidData2.java b/src/test/java/neqsim/thermo/util/example/ReadFluidData2.java index 6d9024070..64cfb4d9d 100644 --- a/src/test/java/neqsim/thermo/util/example/ReadFluidData2.java +++ b/src/test/java/neqsim/thermo/util/example/ReadFluidData2.java @@ -53,7 +53,7 @@ public static void main(String args[]) { * // // ""); // testSystem.addComponent("water", 1.0); testSystem.setMixingRule(2); // * testSystem.setMultiPhaseCheck(true); //testSystem.setMultiPhaseCheck(false); * ThermodynamicOperations testOps = new ThermodynamicOperations(testSystem); - * + * * try { testOps.TPflash(); testSystem.display(); testOps.PSflash(-123.108602625942); * testSystem.display(); testSystem.setPressure(100.0); testOps.PSflash(-119.003271056256); * testSystem.display(); System.out.println("entropy " + testSystem.getEntropy()); diff --git a/src/test/java/neqsim/thermo/util/example/TPflash.java b/src/test/java/neqsim/thermo/util/example/TPflash.java index 93a5159a9..ae044a692 100644 --- a/src/test/java/neqsim/thermo/util/example/TPflash.java +++ b/src/test/java/neqsim/thermo/util/example/TPflash.java @@ -48,7 +48,7 @@ public static void main(String[] args) { * testSystem.addTBPfraction("C10", 1.0, 225.5046 / 1000.0, 841.1014 / 1000.0); * testSystem.setMolarComposition(new double[] { 0.829, 0, 0.0007, 0.002, 0.0707, 0.0072, * 0.0051, 0.0019, 0.0062, 0.0048, 0.006, 0.0074, 0.0109, 0.0109, 0.0062, 0.031 }); - * + * * testSystem.setHeavyTBPfractionAsPlusFraction(); * testSystem.getCharacterization().characterisePlusFraction(); */ diff --git a/src/test/java/neqsim/thermo/util/example/TPflashDehyd.java b/src/test/java/neqsim/thermo/util/example/TPflashDehyd.java index 01447b327..ed8f2e83a 100644 --- a/src/test/java/neqsim/thermo/util/example/TPflashDehyd.java +++ b/src/test/java/neqsim/thermo/util/example/TPflashDehyd.java @@ -75,30 +75,30 @@ public static void main(String[] args) { // testSystem.init(1); /* * testSystem.init(2); - * + * * // testSystem.init(1); // testSystem.init(2); // testSystem.init(3); // * System.out.println("heat cap " + (testSystem.getPhase(1).getCp())); // * testOps.calcPTphaseEnvelope(); testSystem.display(); // testSystem.getPhase(0).getCp(); } * catch (Exception ex) { System.out.println(ex.toString()); } - * + * * /* System.out.println("gas density " + (testSystem.getPhase(0).getDensity())); * System.out.println("gas density " + (1.0 / (testSystem.getPhase(0).getDensity() / * testSystem.getPhase(0).getMolarMass()))); - * + * * System.out.println("liq density " + (testSystem.getPhase(1).getDensity())); * System.out.println("liq density " + (1.0 / (testSystem.getPhase(1).getDensity() / * testSystem.getPhase(1).getMolarMass()))); - * + * * testSystem.initPhysicalProperties(); testSystem.init(1); - * + * * System.out.println("start....."); testSystem.setEmptyFluid(); * testSystem.setMolarComposition(new double[]{1.0, 1e-20, 1e-20}); testSystem.init(0, 0); * testSystem.init(1); testSystem.display(); - * + * * System.out.println("end....."); testSystem.setMolarComposition(new double[]{0.000001, * 0.00001, 1e-20}); // testSystem.init(1); testSystem.init(0, 0); testSystem.init(1); // * testSystem.display(); - * + * * /* testSystem.initPhysicalProperties(); double rho1 = * testSystem.getPhase(0).getPhysicalProperties().getDensity(); System.out.println("drhodP " + * testSystem.getPhase(0).getdrhodP()); System.out.println("drhodT " + @@ -106,10 +106,10 @@ public static void main(String[] args) { * testSystem.setPressure(testSystem.getPressure() + 0.001); testSystem.init(1); // * testSystem.display(); // testSystem.initPhysicalProperties(); double rho2 = * testSystem.getPhase(0).getPhysicalProperties().getDensity(); - * + * * //System.out.println("drhodPnum " + (rho2 - rho1) / 0.01); System.out.println("drhodTnum " + * (rho2 - rho1) / 0.001); - * + * * testSystem.saveFluid(2327); testSystem.saveFluid(2301); // testSystem.setNumberOfPhases(1); * // testSystem.setTemperature(299.0); // testSystem.init(1); // * testSystem.getPhase(0).getEntropy(); // System.out.println("enthalpy " + @@ -119,8 +119,7 @@ public static void main(String[] args) { * testSystem.getPhase(0).getCp()); System.out.println("enthalpy " + * testSystem.getPhase(0).getEnthalpy()); System.out.println("entropy " + * testSystem.getPhase(0).getEntropy()); - * - * + * * testSystem.init(2); System.out.println("Cp " + testSystem.getPhase(0).getCp()); * System.out.println("enthalpy " + testSystem.getPhase(0).getEnthalpy()); * System.out.println("entropy " + testSystem.getPhase(0).getEntropy()); testSystem.init(3); @@ -132,7 +131,7 @@ public static void main(String[] args) { * ThermodynamicOperations(testSystem); try { // testOps.freezingPointTemperatureFlash(); * testOps.TPflash(); // testOps.calcPTphaseEnvelope(); // testOps.display(); // * testSystem.display(); } catch (Exception ex) { System.out.println(ex.toString()); } - * + * * /* double h1 = testSystem.getPhase(0).getEntropy(); System.out.println("H " + * testSystem.getPhase(0).getEntropy()); System.out.println("H dP " + * testSystem.getPhase(0).getEntropydT()); testSystem.setTemperature(testSystem.getTemperature() @@ -147,7 +146,7 @@ public static void main(String[] args) { * (testSystem.getPhase(1).getComponent("methane").getx() / * testSystem.getPhase(0).getComponent("methane").getx()); * System.out.println("selectivity CO2/methane " + seletivity); - * + * * double seletivity2 = testSystem.getPhase(1).getComponent("CO2").getx() / * testSystem.getPhase(0).getComponent("CO2").getx() / * (testSystem.getPhase(1).getComponent("ethane").getx() / @@ -162,24 +161,23 @@ public static void main(String[] args) { * testSystem.getPhase(2).getWtFraction(testSystem) + * testSystem.getPhase(1).getWtFraction(testSystem) + * testSystem.getPhase(0).getWtFraction(testSystem)); - * + * * double a = testSystem.getPhase(0).getBeta() * testSystem.getPhase(0).getMolarMass() / * testSystem.getMolarMass(); double seletivity = * testSystem.getPhase(1).getComponent("CO2").getx() / * testSystem.getPhase(0).getComponent("CO2").getx() / * (testSystem.getPhase(1).getComponent("methane").getx() / * testSystem.getPhase(0).getComponent("methane").getx()); - * - * + * * double solubility = testSystem.getPhase(1).getComponent("CO2").getx() * * ThermodynamicConstantsInterface.R * 298.15 /ThermodynamicConstantsInterface.atm / * (testSystem.getPhase(1).getMolarMass()) * 1000; - * + * * System.out.println("selectivity " + seletivity); System.out.println("CO2 solubility " + * solubility); System.out.println("Z " + testSystem.getPhase(0).getZ()); // * testSystem.getPhase(0).getComponentWithIndex(1); // testSystem.saveObject(300); // * System.out.println("ethanol activity " + testSystem.getPhase(0).getActivityCoefficient(0)); - * + * * //testSystem. // System.out.println("water activity " + * testSystem.getPhase(1).getActivityCoefficient(1)); // System.out.println("TEG activity " + * testSystem.getPhase(1).getActivityCoefficient(0)); // testSystem.display(); diff --git a/src/test/java/neqsim/thermo/util/example/TPflashMethanolWaterPropane.java b/src/test/java/neqsim/thermo/util/example/TPflashMethanolWaterPropane.java index fd83bee68..04da438fc 100644 --- a/src/test/java/neqsim/thermo/util/example/TPflashMethanolWaterPropane.java +++ b/src/test/java/neqsim/thermo/util/example/TPflashMethanolWaterPropane.java @@ -32,7 +32,7 @@ public static void main(String args[]) { /* * testSystem.addComponent("methane", 150.0e-2); testSystem.addComponent("propane", 150.0e-3); * testSystem.addComponent("methanol", 0.5); testSystem.addComponent("water", 0.5); - * + * * testSystem.createDatabase(true); testSystem.setMixingRule(10); * testSystem.setMultiPhaseCheck(true); */ diff --git a/src/test/java/neqsim/thermo/util/example/TestCharacterizationCondensate.java b/src/test/java/neqsim/thermo/util/example/TestCharacterizationCondensate.java index b3adc4d20..654c1104f 100644 --- a/src/test/java/neqsim/thermo/util/example/TestCharacterizationCondensate.java +++ b/src/test/java/neqsim/thermo/util/example/TestCharacterizationCondensate.java @@ -112,7 +112,7 @@ public static void main(String args[]) { /* * System.out.println("molar mass " * +testSystem.getPhase(0).getComponent("PC4_PC").getMolarMass() ); - * + * * testSystem.setMolarCompositionOfPlusFluid(new double[]{0.02, 0.005, 0.4, 0.01, 0.01, 0.02, * 0.02, 0.01 ,0.01, 0.01, 0.01 ,0.01, 0.01, 0.2 }); try { testOps.TPflash(); // * testOps.hydrateFormationTemperature(); // testOps.dewPointTemperatureFlash(); } catch diff --git a/src/test/java/neqsim/thermo/util/readwrite/EclipseFluidReadWriteTest.java b/src/test/java/neqsim/thermo/util/readwrite/EclipseFluidReadWriteTest.java index f81e9baf6..8799c5c20 100644 --- a/src/test/java/neqsim/thermo/util/readwrite/EclipseFluidReadWriteTest.java +++ b/src/test/java/neqsim/thermo/util/readwrite/EclipseFluidReadWriteTest.java @@ -28,7 +28,7 @@ static void setUpBeforeClass() throws Exception {} /** * Test method for * {@link neqsim.thermo.util.readwrite.EclipseFluidReadWrite#read(java.lang.String)}. - * + * * @throws IOException */ @Test diff --git a/src/test/java/neqsim/thermodynamicOperations/flashOps/Degasser.java b/src/test/java/neqsim/thermodynamicOperations/flashOps/Degasser.java index a2d752132..7f7123aaa 100644 --- a/src/test/java/neqsim/thermodynamicOperations/flashOps/Degasser.java +++ b/src/test/java/neqsim/thermodynamicOperations/flashOps/Degasser.java @@ -181,7 +181,7 @@ void testRun2() { * "/workspaces/neqsim/src/test/java/neqsim/thermodynamicOperations/flashOps/my_process.xml"); * String xmlContents = ""; try { //xmlContents = Files.readString(filePath); } catch * (IOException e) { e.printStackTrace(); } - * + * * // Deserialize from xml neqsim.processSimulation.processSystem.ProcessSystem operationsCopy = * (neqsim.processSimulation.processSystem.ProcessSystem) xstream.fromXML(xmlContents); * operationsCopy.run(); neqsim.processSimulation.processEquipment.separator.Separator diff --git a/src/test/java/neqsim/thermodynamicOperations/util/example/PhaseEnvelope.java b/src/test/java/neqsim/thermodynamicOperations/util/example/PhaseEnvelope.java index e5e15d114..5cc91bae7 100644 --- a/src/test/java/neqsim/thermodynamicOperations/util/example/PhaseEnvelope.java +++ b/src/test/java/neqsim/thermodynamicOperations/util/example/PhaseEnvelope.java @@ -9,11 +9,11 @@ /* *

PhaseEnvelope class. Created on 27. september 2001, 10:21 Updated on May 2019 by Nefeli

- * + * * @author esol - * + * * @version $Id: $Id - * + * * @since 2.2.3 */ public class PhaseEnvelope { From 09c539fa53236fac8b95eb196949f0d18bf2cb4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=85smund=20V=C3=A5ge=20Fannemel?= <34712686+asmfstatoil@users.noreply.github.com> Date: Fri, 15 Mar 2024 12:43:45 +0100 Subject: [PATCH 6/8] revert --- .../PVTsimulation/simulation/SlimTubeSim.java | 90 ++++++++++--------- .../neqsim/thermo/system/SystemThermo.java | 41 ++------- 2 files changed, 51 insertions(+), 80 deletions(-) diff --git a/src/main/java/neqsim/PVTsimulation/simulation/SlimTubeSim.java b/src/main/java/neqsim/PVTsimulation/simulation/SlimTubeSim.java index 0e737b90f..c8c9b0d85 100644 --- a/src/main/java/neqsim/PVTsimulation/simulation/SlimTubeSim.java +++ b/src/main/java/neqsim/PVTsimulation/simulation/SlimTubeSim.java @@ -43,7 +43,6 @@ public void run() { getThermoSystem().setTemperature(288.15); thermoOps.TPflash(); - /* * double totalReferenceNodeVolumeAtStadardConditions; if (getThermoSystem().getNumberOfPhases() * > 1) { totalReferenceNodeVolumeAtStadardConditions = @@ -98,30 +97,28 @@ public void run() { if (liquidExcessVolume < 0) { liquidExcessVolume = 0.0; } - double gasExcessVolume = totalVolume - standardNodeVolume - liquidExcessVolume; - double liquidVolume = slimTubeNodeSystem[i].getPhase(liquidPhaseNumber).getVolume(); - - double gasfactor = gasExcessVolume / excessVolume; - if (gasExcessVolume < excessVolume) { - gasfactor = 1.0; - } - double[] removeMoles = - new double[slimTubeNodeSystem[0].getPhase(0).getNumberOfComponents()]; + int numComp = slimTubeNodeSystem[0].getPhase(0).getNumberOfComponents(); + double[] removeMoles = new double[numComp]; if (slimTubeNodeSystem[i].getNumberOfPhases() > 1) { - for (int k = 0; k < slimTubeNodeSystem[i].getPhase(liquidPhaseNumber) - .getNumberOfComponents(); k++) { + double gasExcessVolume = totalVolume - standardNodeVolume - liquidExcessVolume; + double gasfactor = gasExcessVolume / excessVolume; + if (gasExcessVolume < excessVolume) { + gasfactor = 1.0; + } + + for (int k = 0; k < numComp; k++) { double moles = slimTubeNodeSystem[i].getPhase(0).getComponent(k).getNumberOfMolesInPhase(); removeMoles[k] += gasfactor * moles; } } - double liqfactor = liquidExcessVolume / liquidVolume; if (liquidExcessVolume > 0) { - for (int k = 0; k < slimTubeNodeSystem[i].getPhase(liquidPhaseNumber) - .getNumberOfComponents(); k++) { + double liquidVolume = slimTubeNodeSystem[i].getPhase(liquidPhaseNumber).getVolume(); + double liqfactor = liquidExcessVolume / liquidVolume; + for (int k = 0; k < numComp; k++) { double moles = slimTubeNodeSystem[i].getPhase(liquidPhaseNumber).getComponent(k) .getNumberOfMolesInPhase(); removeMoles[k] += moles * liqfactor; @@ -134,11 +131,17 @@ public void run() { * += removeMoles[comp]; } */ - for (int k = 0; k < slimTubeNodeSystem[i].getPhase(liquidPhaseNumber) - .getNumberOfComponents(); k++) { + for (int k = 0; k < numComp; k++) { try { - slimTubeNodeSystem[i + 1].addComponent(k, removeMoles[k]); - slimTubeNodeSystem[i].addComponent(k, -removeMoles[k]); + if (removeMoles[k] <= slimTubeNodeSystem[i].getComponent(k).getNumberOfmoles()) { + slimTubeNodeSystem[i].addComponent(k, -removeMoles[k]); + slimTubeNodeSystem[i + 1].addComponent(k, removeMoles[k]); + } else { + slimTubeNodeSystem[i + 1].addComponent(k, + slimTubeNodeSystem[i].getComponent(k).getNumberOfmoles()); + slimTubeNodeSystem[i].addComponent(k, + -slimTubeNodeSystem[i].getComponent(k).getNumberOfmoles()); + } } catch (Exception e) { logger.warn(e.getMessage()); } @@ -164,13 +167,14 @@ public void run() { .setPressure(ThermodynamicConstantsInterface.referencePressure); slimOps1.TPflash(); - double totalAccumulatedVolumeAtStadardConditions = - slimTubeNodeSystem[numberOfSlimTubeNodes].getPhase(0).getVolume(); - - if (slimTubeNodeSystem[numberOfSlimTubeNodes].getNumberOfPhases() > 1) { - totalAccumulatedVolumeAtStadardConditions = - slimTubeNodeSystem[numberOfSlimTubeNodes].getPhase(1).getVolume(); - } + /* + * double totalAccumulatedVolumeAtStadardConditions = + * slimTubeNodeSystem[numberOfSlimTubeNodes].getPhase(0).getVolume(); + * + * if (slimTubeNodeSystem[numberOfSlimTubeNodes].getNumberOfPhases() > 1) { + * totalAccumulatedVolumeAtStadardConditions = + * slimTubeNodeSystem[numberOfSlimTubeNodes].getPhase(1).getVolume(); } + */ /* * System.out.println("accumulated VOlume " + totalAccumulatedVolumeAtStadardConditions + @@ -185,24 +189,22 @@ public void run() { .setPressure(ThermodynamicConstantsInterface.referencePressure); slimOps1.TPflash(); - double totalAccumulatedVolumeAtStadardConditions = - slimTubeNodeSystem[numberOfSlimTubeNodes].getPhase(0).getVolume(); - - if (slimTubeNodeSystem[numberOfSlimTubeNodes].getNumberOfPhases() > 1) { - totalAccumulatedVolumeAtStadardConditions = - slimTubeNodeSystem[numberOfSlimTubeNodes].getPhase(1).getVolume(); - } - - // System.out.println("accumulated VOlume " + - // totalAccumulatedVolumeAtStadardConditions - // + " total reference volume " + totalReferenceNodeVolumeAtStadardConditions); - // System.out.println("oil recovery ratio" - // + totalAccumulatedVolumeAtStadardConditions / - // totalReferenceNodeVolumeAtStadardConditions); - - for (int i = 0; i < numberOfSlimTubeNodes; i++) { - // slimTubeNodeSystem[i].display(); - } + /* + * double totalAccumulatedVolumeAtStadardConditions = + * slimTubeNodeSystem[numberOfSlimTubeNodes].getPhase(0).getVolume(); + * + * if (slimTubeNodeSystem[numberOfSlimTubeNodes].getNumberOfPhases() > 1) { + * totalAccumulatedVolumeAtStadardConditions = + * slimTubeNodeSystem[numberOfSlimTubeNodes].getPhase(1).getVolume(); } + * + * System.out.println("accumulated VOlume " + totalAccumulatedVolumeAtStadardConditions + + * " total reference volume " + totalReferenceNodeVolumeAtStadardConditions); + * System.out.println("oil recovery ratio" + totalAccumulatedVolumeAtStadardConditions / + * totalReferenceNodeVolumeAtStadardConditions); + */ + /* + * for (int i = 0; i < numberOfSlimTubeNodes; i++) { slimTubeNodeSystem[i].display(); } + */ } /** diff --git a/src/main/java/neqsim/thermo/system/SystemThermo.java b/src/main/java/neqsim/thermo/system/SystemThermo.java index 9f651ca93..d1039b836 100644 --- a/src/main/java/neqsim/thermo/system/SystemThermo.java +++ b/src/main/java/neqsim/thermo/system/SystemThermo.java @@ -1311,16 +1311,10 @@ public void addComponent(int index, double moles) { return; } - if (!this.isBetaValid()) { - logger.warn("Beta array contains invalid values"); - // return; - } - - for (int phaseNum = 0; phaseNum < getNumberOfPhases(); phaseNum++) { - PhaseInterface tmpPhase = getPhase(phaseNum); + for (PhaseInterface tmpPhase : phaseArray) { + // TODO: adding moles to all phases, not just the active ones. if (tmpPhase != null) { - double currBeta = this.beta[getPhaseIndex(tmpPhase)]; - tmpPhase.addMolesChemReac(index, currBeta * moles, currBeta * moles); + tmpPhase.addMolesChemReac(index, moles, moles); } } setTotalNumberOfMoles(getTotalNumberOfMoles() + moles); @@ -1646,9 +1640,6 @@ public final void initBeta() { || this.getSumBeta() > 1.0 + ThermodynamicModelSettings.phaseFractionMinimumLimit) { logger.warn("SystemThermo:initBeta - Sum of beta does not equal 1.0"); } - if (this.getSumBeta() != 1.0) { - logger.warn("SystemThermo:initBeta - Sum of beta does not equal 1.0"); - } } /** {@inheritDoc} */ @@ -3068,28 +3059,6 @@ public final double getSumBeta() { return sum; } - /** - * Verify if beta array has valid values and sum is approximately equal to 1. - * - * @return True if beta values are valid. False indicates that a flash must be done. - */ - public final boolean isBetaValid() { - for (double b : this.beta) { - if (b < 0) { - return false; - } - if (b > 1.0) { - return false; - } - } - - double betaSum = getSumBeta(); - boolean valid = betaSum > 1 - ThermodynamicModelSettings.phaseFractionMinimumLimit - && betaSum < 1 + ThermodynamicModelSettings.phaseFractionMinimumLimit; - - return valid; - } - /** {@inheritDoc} */ @Override public void setAttractiveTerm(int i) { @@ -3888,9 +3857,9 @@ public void saveObject(int ID, String text) { * if (!text.isEmpty()) { ps = con.prepareStatement( * "REPLACE INTO fluidinfo (ID, TEXT) VALUES (?,?)"); ps.setInt(1, ID); ps.setString(2, text); * } - * + * * ps.executeUpdate(); - * + * */ } catch (Exception ex) { logger.error(ex.getMessage(), ex); From 5f1a24351e5e8ecb7cc5700eda74f7c72e9170c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=85smund=20V=C3=A5ge=20Fannemel?= <34712686+asmfstatoil@users.noreply.github.com> Date: Fri, 15 Mar 2024 12:46:09 +0100 Subject: [PATCH 7/8] more whitespace --- .../chemicalReactions/chemicalReaction/ChemicalReaction.java | 1 - .../interfaceProperties/surfaceTension/GTSurfaceTension.java | 1 - .../processEquipment/ProcessEquipmentInterface.java | 1 - .../processSimulation/processEquipment/expander/Expander.java | 1 - .../processEquipment/pipeline/PipeBeggsAndBrills.java | 1 - .../processSimulation/processEquipment/util/FlowSetter.java | 3 --- .../processSystem/processModules/DPCUModule.java | 1 - .../java/neqsim/standards/salesContract/ContractInterface.java | 1 - src/main/java/neqsim/thermo/characterization/Characterise.java | 1 - src/main/java/neqsim/thermo/component/ComponentHydrateGF.java | 1 - src/main/java/neqsim/thermo/system/SystemInterface.java | 1 - .../thermodynamicOperations/ThermodynamicOperations.java | 1 - .../multicomponentEnvelopeOps/CricondenThermFlash.java | 1 - .../PVTsimulation/simulation/SaturationTemperatureTest.java | 1 - .../processSimulation/measurementDevice/WellAllocatorTest.java | 1 - .../processSimulation/processEquipment/mixer/MixerTest.java | 1 - .../processEquipment/separator/SeparatorTest.java | 1 - .../processSimulation/processEquipment/stream/StreamTest.java | 1 - .../neqsim/processSimulation/processSystem/GlycolRigTest.java | 1 - .../processSimulation/util/example/OffshoreProcess3.java | 1 - .../java/neqsim/standards/gasQuality/Standard_ISO6976Test.java | 1 - .../standards/gasQuality/Standard_ISO6976_2016_Test.java | 1 - .../java/neqsim/standards/salesContract/BaseContractTest.java | 1 - .../java/neqsim/thermo/component/ComponentHydrateGFTest.java | 1 - src/test/java/neqsim/thermo/util/example/DewPointCurve.java | 1 - src/test/java/neqsim/thermo/util/example/HydrateFlash.java | 1 - .../thermo/util/readwrite/EclipseFluidReadWriteTest.java | 1 - .../java/neqsim/thermodynamicOperations/flashOps/Degasser.java | 1 - .../thermodynamicOperations/flashOps/PHFlashGERG2008Test.java | 1 - .../neqsim/thermodynamicOperations/flashOps/PHFlashTest.java | 1 - .../thermodynamicOperations/flashOps/PSFlashGERG2008Test.java | 1 - .../neqsim/thermodynamicOperations/flashOps/TPFlashTest.java | 1 - .../thermodynamicOperations/flashOps/TPFlashTestHighTemp.java | 1 - 33 files changed, 35 deletions(-) diff --git a/src/main/java/neqsim/chemicalReactions/chemicalReaction/ChemicalReaction.java b/src/main/java/neqsim/chemicalReactions/chemicalReaction/ChemicalReaction.java index 945abef4a..642e3542a 100644 --- a/src/main/java/neqsim/chemicalReactions/chemicalReaction/ChemicalReaction.java +++ b/src/main/java/neqsim/chemicalReactions/chemicalReaction/ChemicalReaction.java @@ -57,7 +57,6 @@ public ChemicalReaction(String name, String[] names, double[] stocCoefs, double[ double activationEnergy, double refT) { /* * this.names = names; this.stocCoefs = stocCoefs; this.K = K; - * */ super(name); this.names = new String[names.length]; diff --git a/src/main/java/neqsim/physicalProperties/interfaceProperties/surfaceTension/GTSurfaceTension.java b/src/main/java/neqsim/physicalProperties/interfaceProperties/surfaceTension/GTSurfaceTension.java index fbc872f04..708be1322 100644 --- a/src/main/java/neqsim/physicalProperties/interfaceProperties/surfaceTension/GTSurfaceTension.java +++ b/src/main/java/neqsim/physicalProperties/interfaceProperties/surfaceTension/GTSurfaceTension.java @@ -184,7 +184,6 @@ public static double solveWithRefcomp(SystemInterface system, int interface1, in * Tolerances for the odesystem.abstol and .reltol should be less than the integrator tolerances * for stability. Default Newton-Rhapson values are odesystem.normtol = 1e-10; odesystem.reltol * = 1e-8; - * */ odesystem.normtol = 1e-10; odesystem.reltol = 1e-8; diff --git a/src/main/java/neqsim/processSimulation/processEquipment/ProcessEquipmentInterface.java b/src/main/java/neqsim/processSimulation/processEquipment/ProcessEquipmentInterface.java index 01ff9d980..dc979e1c4 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/ProcessEquipmentInterface.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/ProcessEquipmentInterface.java @@ -45,7 +45,6 @@ default void initMechanicalDesign() {} *

* * @return true or false - * */ public default boolean needRecalculation() { return true; diff --git a/src/main/java/neqsim/processSimulation/processEquipment/expander/Expander.java b/src/main/java/neqsim/processSimulation/processEquipment/expander/Expander.java index 5758ca5b4..4799c0a42 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/expander/Expander.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/expander/Expander.java @@ -101,7 +101,6 @@ public void run(UUID id) { * * } while (Math.abs((oldPolyt - polytropicEfficiency) / oldPolyt) > 1e-5 && iter < 500); // * polytropicEfficiency = isentropicEfficiency * (); - * */ } else { getThermoSystem().setPressure(pressure); diff --git a/src/main/java/neqsim/processSimulation/processEquipment/pipeline/PipeBeggsAndBrills.java b/src/main/java/neqsim/processSimulation/processEquipment/pipeline/PipeBeggsAndBrills.java index 6ecf6a7bd..a4b82cb14 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/pipeline/PipeBeggsAndBrills.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/pipeline/PipeBeggsAndBrills.java @@ -878,7 +878,6 @@ public Double getSegmentPressure(int index) { * Get Pressure * * @return ArrayList of pressure drop profile - * */ public List getPressureDropProfile() { return new ArrayList<>(pressureDropProfile); diff --git a/src/main/java/neqsim/processSimulation/processEquipment/util/FlowSetter.java b/src/main/java/neqsim/processSimulation/processEquipment/util/FlowSetter.java index 8679f40bf..4ac6f6920 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/util/FlowSetter.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/util/FlowSetter.java @@ -96,7 +96,6 @@ public void setInletStream(StreamInterface inletStream) { * * @param flowRate flow rate * @param flowUnit Supported units are Sm3/sec, Sm3/hr, Sm3/day, MSm3/day - * */ public void setGasFlowRate(double flowRate, String flowUnit) { double conversionFactor = 1.0; @@ -155,7 +154,6 @@ public double getGasFlowRate(String flowUnit) { * * @param flowRate flow rate * @param flowUnit Supported units are m3/sec, m3/hr, m3/day - * */ public void setOilFlowRate(double flowRate, String flowUnit) { double conversionFactor = 1.0; @@ -208,7 +206,6 @@ public double getOilFlowRate(String flowUnit) { * * @param flowRate flow rate * @param flowUnit Supported units are m3/sec, m3/hr, m3/day - * */ public void setWaterFlowRate(double flowRate, String flowUnit) { double conversionFactor = 1.0; diff --git a/src/main/java/neqsim/processSimulation/processSystem/processModules/DPCUModule.java b/src/main/java/neqsim/processSimulation/processSystem/processModules/DPCUModule.java index a79170100..b3dc3c1c3 100644 --- a/src/main/java/neqsim/processSimulation/processSystem/processModules/DPCUModule.java +++ b/src/main/java/neqsim/processSimulation/processSystem/processModules/DPCUModule.java @@ -200,7 +200,6 @@ public void initializeModule() { * getOperations().add(firstStageCompressor); getOperations().add(glycolMixer); * getOperations().add(mixerAfterCooler); getOperations().add(glycolScrubber); * getOperations().add(secondStageCompressor); getOperations().add(secondStageAfterCooler); - * */ } diff --git a/src/main/java/neqsim/standards/salesContract/ContractInterface.java b/src/main/java/neqsim/standards/salesContract/ContractInterface.java index e40361a6f..fb4bbcb15 100644 --- a/src/main/java/neqsim/standards/salesContract/ContractInterface.java +++ b/src/main/java/neqsim/standards/salesContract/ContractInterface.java @@ -130,7 +130,6 @@ public interface ContractInterface { /** * Prints the contract. - * */ public default void prettyPrint() { neqsim.thermo.util.readwrite.TablePrinter.printTable(getResultTable()); diff --git a/src/main/java/neqsim/thermo/characterization/Characterise.java b/src/main/java/neqsim/thermo/characterization/Characterise.java index 4f2c64a69..34cd86f10 100644 --- a/src/main/java/neqsim/thermo/characterization/Characterise.java +++ b/src/main/java/neqsim/thermo/characterization/Characterise.java @@ -173,6 +173,5 @@ public void characterisePlusFraction() { * public boolean characterize2() { if (TBPCharacterise.groupTBPfractions()) { * TBPCharacterise.solve(); return true; } else { System.out.println("not able to generate pluss * fraction"); return false; } } - * */ } diff --git a/src/main/java/neqsim/thermo/component/ComponentHydrateGF.java b/src/main/java/neqsim/thermo/component/ComponentHydrateGF.java index 499028913..51732ea42 100644 --- a/src/main/java/neqsim/thermo/component/ComponentHydrateGF.java +++ b/src/main/java/neqsim/thermo/component/ComponentHydrateGF.java @@ -134,7 +134,6 @@ public double fugcoef(PhaseInterface phase, int numberOfComps, double temp, doub * (getEmptyHydrateStructureVapourPressure(hydrateStructure, temp) * Math.exp(solvol / (R * * temp) * (pres - getEmptyHydrateStructureVapourPressure(hydrateStructure, temp)) * * 1e5))); - * */ // System.out.println("pointing " // +(Math.exp(solvol/(R*temp)*((pres-getEmptyHydrateStructureVapourPressure(hydrateStruct,temp))*1e5)))); diff --git a/src/main/java/neqsim/thermo/system/SystemInterface.java b/src/main/java/neqsim/thermo/system/SystemInterface.java index c2ff5a80c..784d749c8 100644 --- a/src/main/java/neqsim/thermo/system/SystemInterface.java +++ b/src/main/java/neqsim/thermo/system/SystemInterface.java @@ -1561,7 +1561,6 @@ public default void display() { /** * Prints the fluid in a visually appealing way. - * */ public default void prettyPrint() { neqsim.thermo.util.readwrite.TablePrinter.printTable(createTable(getFluidName())); diff --git a/src/main/java/neqsim/thermodynamicOperations/ThermodynamicOperations.java b/src/main/java/neqsim/thermodynamicOperations/ThermodynamicOperations.java index 0457820fe..07007a3d4 100644 --- a/src/main/java/neqsim/thermodynamicOperations/ThermodynamicOperations.java +++ b/src/main/java/neqsim/thermodynamicOperations/ThermodynamicOperations.java @@ -1009,7 +1009,6 @@ public double[] calcImobilePhaseHydrateTemperature(double[] temperature, double[ * systemTemp.init(0); systemTemp.display(); try { opsTemp.hydrateFormationTemperature(); } * catch (Exception ex) { logger.error(ex.getMessage(),e); } systemTemp.display(); hydTemps[i] * = systemTemp.getTemperature(); - * */ opsTemp = new ThermodynamicOperations(systemTemp); systemTemp.setTemperature(temperature[i]); diff --git a/src/main/java/neqsim/thermodynamicOperations/phaseEnvelopeOps/multicomponentEnvelopeOps/CricondenThermFlash.java b/src/main/java/neqsim/thermodynamicOperations/phaseEnvelopeOps/multicomponentEnvelopeOps/CricondenThermFlash.java index 36c5783af..3b0408b64 100644 --- a/src/main/java/neqsim/thermodynamicOperations/phaseEnvelopeOps/multicomponentEnvelopeOps/CricondenThermFlash.java +++ b/src/main/java/neqsim/thermodynamicOperations/phaseEnvelopeOps/multicomponentEnvelopeOps/CricondenThermFlash.java @@ -100,7 +100,6 @@ public void run() { * double sumK=0.; for (int i=0 ; i < numberOfComponents ; i++ ){ sumK= * sumK+(uold.get(i,0)-u.get(i,0))*(uold.get(i,0)-u.get(i,0)); } if (iterX == 10000 ){ ITERX=-1; * u=uini.copy(); setNewX(); break; } if (sumK <= 1E-7){ ITERX=iterX; setNewX(); break; } } - * */ // starting loops for (int iter = 0; iter < 1000; iter++) { diff --git a/src/test/java/neqsim/PVTsimulation/simulation/SaturationTemperatureTest.java b/src/test/java/neqsim/PVTsimulation/simulation/SaturationTemperatureTest.java index 8534bc756..df9361acf 100644 --- a/src/test/java/neqsim/PVTsimulation/simulation/SaturationTemperatureTest.java +++ b/src/test/java/neqsim/PVTsimulation/simulation/SaturationTemperatureTest.java @@ -12,7 +12,6 @@ /** * @author ESOL - * */ class SaturationTemperatureTest extends neqsim.NeqSimTest { /** diff --git a/src/test/java/neqsim/processSimulation/measurementDevice/WellAllocatorTest.java b/src/test/java/neqsim/processSimulation/measurementDevice/WellAllocatorTest.java index 89b3ca096..f8c775ad6 100644 --- a/src/test/java/neqsim/processSimulation/measurementDevice/WellAllocatorTest.java +++ b/src/test/java/neqsim/processSimulation/measurementDevice/WellAllocatorTest.java @@ -12,7 +12,6 @@ /** * @author ESOL - * */ class WellAllocatorTest extends neqsim.NeqSimTest { static Logger logger = LogManager.getLogger(WellAllocatorTest.class); diff --git a/src/test/java/neqsim/processSimulation/processEquipment/mixer/MixerTest.java b/src/test/java/neqsim/processSimulation/processEquipment/mixer/MixerTest.java index 9aa6257e6..4e156d1e8 100644 --- a/src/test/java/neqsim/processSimulation/processEquipment/mixer/MixerTest.java +++ b/src/test/java/neqsim/processSimulation/processEquipment/mixer/MixerTest.java @@ -11,7 +11,6 @@ /** * @author ESOL - * */ class MixerTest { static neqsim.thermo.system.SystemInterface testSystem; diff --git a/src/test/java/neqsim/processSimulation/processEquipment/separator/SeparatorTest.java b/src/test/java/neqsim/processSimulation/processEquipment/separator/SeparatorTest.java index 1cde49170..7f7664f6c 100644 --- a/src/test/java/neqsim/processSimulation/processEquipment/separator/SeparatorTest.java +++ b/src/test/java/neqsim/processSimulation/processEquipment/separator/SeparatorTest.java @@ -11,7 +11,6 @@ /** * @author ESOL - * */ class SeparatorTest extends neqsim.NeqSimTest { static neqsim.thermo.system.SystemInterface testSystem = null; diff --git a/src/test/java/neqsim/processSimulation/processEquipment/stream/StreamTest.java b/src/test/java/neqsim/processSimulation/processEquipment/stream/StreamTest.java index f5fffc226..2ee7739da 100644 --- a/src/test/java/neqsim/processSimulation/processEquipment/stream/StreamTest.java +++ b/src/test/java/neqsim/processSimulation/processEquipment/stream/StreamTest.java @@ -11,7 +11,6 @@ /** * @author ESOL - * */ class StreamTest extends neqsim.NeqSimTest { static neqsim.thermo.system.SystemInterface testSystem = null; diff --git a/src/test/java/neqsim/processSimulation/processSystem/GlycolRigTest.java b/src/test/java/neqsim/processSimulation/processSystem/GlycolRigTest.java index 4c5387eae..ad7965691 100644 --- a/src/test/java/neqsim/processSimulation/processSystem/GlycolRigTest.java +++ b/src/test/java/neqsim/processSimulation/processSystem/GlycolRigTest.java @@ -339,7 +339,6 @@ public void runDistillationProcessTest3() { * * System.out .println("flow rate gas " + feedToRegenerator2.getFluid().getFlowRate("kg/hr") + * " kg/hr"); column.massBalanceCheck(); - * */ } } diff --git a/src/test/java/neqsim/processSimulation/util/example/OffshoreProcess3.java b/src/test/java/neqsim/processSimulation/util/example/OffshoreProcess3.java index bb6cdbb0a..58fd9b2c7 100644 --- a/src/test/java/neqsim/processSimulation/util/example/OffshoreProcess3.java +++ b/src/test/java/neqsim/processSimulation/util/example/OffshoreProcess3.java @@ -132,7 +132,6 @@ public static void main(String[] args) { * HeatExchanger heatEx = new HeatExchanger(lpcompressor.getOutStream()); * heatEx.setName("LP heat Exchanger"); heatEx.setGuessOutTemperature(273.15+40.0); * heatEx.setUAvalue(45000.0); heatEx.setFeedStream(1, coolingWater); - * */ Cooler lpHeatExchanger = diff --git a/src/test/java/neqsim/standards/gasQuality/Standard_ISO6976Test.java b/src/test/java/neqsim/standards/gasQuality/Standard_ISO6976Test.java index 0b97489a9..076cb9ae3 100644 --- a/src/test/java/neqsim/standards/gasQuality/Standard_ISO6976Test.java +++ b/src/test/java/neqsim/standards/gasQuality/Standard_ISO6976Test.java @@ -11,7 +11,6 @@ /** * @author ESOL - * */ class Standard_ISO6976Test extends neqsim.NeqSimTest { static SystemInterface testSystem = null; diff --git a/src/test/java/neqsim/standards/gasQuality/Standard_ISO6976_2016_Test.java b/src/test/java/neqsim/standards/gasQuality/Standard_ISO6976_2016_Test.java index 26d8a8677..645ff2638 100644 --- a/src/test/java/neqsim/standards/gasQuality/Standard_ISO6976_2016_Test.java +++ b/src/test/java/neqsim/standards/gasQuality/Standard_ISO6976_2016_Test.java @@ -11,7 +11,6 @@ /** * @author ESOL - * */ class Standard_ISO6976_2016_Test extends neqsim.NeqSimTest { static SystemInterface testSystem = null; diff --git a/src/test/java/neqsim/standards/salesContract/BaseContractTest.java b/src/test/java/neqsim/standards/salesContract/BaseContractTest.java index 9328d9db8..5b4cec795 100644 --- a/src/test/java/neqsim/standards/salesContract/BaseContractTest.java +++ b/src/test/java/neqsim/standards/salesContract/BaseContractTest.java @@ -9,7 +9,6 @@ /** * @author ESOL - * */ class BaseContractTest extends neqsim.NeqSimTest { static SystemInterface testSystem = null; diff --git a/src/test/java/neqsim/thermo/component/ComponentHydrateGFTest.java b/src/test/java/neqsim/thermo/component/ComponentHydrateGFTest.java index 1e0e256f3..97c69fefd 100644 --- a/src/test/java/neqsim/thermo/component/ComponentHydrateGFTest.java +++ b/src/test/java/neqsim/thermo/component/ComponentHydrateGFTest.java @@ -12,7 +12,6 @@ /** * @author ESOL - * */ class ComponentHydrateGFTest extends neqsim.NeqSimTest { static Logger logger = LogManager.getLogger(ComponentHydrateGFTest.class); diff --git a/src/test/java/neqsim/thermo/util/example/DewPointCurve.java b/src/test/java/neqsim/thermo/util/example/DewPointCurve.java index d131330c5..81d6eb141 100644 --- a/src/test/java/neqsim/thermo/util/example/DewPointCurve.java +++ b/src/test/java/neqsim/thermo/util/example/DewPointCurve.java @@ -92,7 +92,6 @@ public static void main(String args[]) { * testSystem.getPhase(1).getActivityCoefficientSymetric(i)); } * System.out.println("activity coeff " + testSystem.getPhase(1).getComponent(1).getName() + " " * + testSystem.getPhase(1).getActivityCoefficient(1, 0)); - * */ } } diff --git a/src/test/java/neqsim/thermo/util/example/HydrateFlash.java b/src/test/java/neqsim/thermo/util/example/HydrateFlash.java index 29579bbd7..6a30a937d 100644 --- a/src/test/java/neqsim/thermo/util/example/HydrateFlash.java +++ b/src/test/java/neqsim/thermo/util/example/HydrateFlash.java @@ -170,7 +170,6 @@ public static void main(String args[]) { * testOps2.waterDewPointTemperatureFlash(); * * } catch (Exception ex) { logger.error(ex.getMessage()) } testSystem2.display(); - * */ } } diff --git a/src/test/java/neqsim/thermo/util/readwrite/EclipseFluidReadWriteTest.java b/src/test/java/neqsim/thermo/util/readwrite/EclipseFluidReadWriteTest.java index 8799c5c20..68c145c7d 100644 --- a/src/test/java/neqsim/thermo/util/readwrite/EclipseFluidReadWriteTest.java +++ b/src/test/java/neqsim/thermo/util/readwrite/EclipseFluidReadWriteTest.java @@ -8,7 +8,6 @@ /** * @author ESOL - * */ class EclipseFluidReadWriteTest extends neqsim.NeqSimTest { static neqsim.thermo.system.SystemInterface testSystem = null; diff --git a/src/test/java/neqsim/thermodynamicOperations/flashOps/Degasser.java b/src/test/java/neqsim/thermodynamicOperations/flashOps/Degasser.java index 7f7123aaa..566a6d4e8 100644 --- a/src/test/java/neqsim/thermodynamicOperations/flashOps/Degasser.java +++ b/src/test/java/neqsim/thermodynamicOperations/flashOps/Degasser.java @@ -9,7 +9,6 @@ /** * @author ESOL - * */ class Degasser { static neqsim.thermo.system.SystemInterface testSystem = null; diff --git a/src/test/java/neqsim/thermodynamicOperations/flashOps/PHFlashGERG2008Test.java b/src/test/java/neqsim/thermodynamicOperations/flashOps/PHFlashGERG2008Test.java index ee0a6020a..731e7d5f6 100644 --- a/src/test/java/neqsim/thermodynamicOperations/flashOps/PHFlashGERG2008Test.java +++ b/src/test/java/neqsim/thermodynamicOperations/flashOps/PHFlashGERG2008Test.java @@ -7,7 +7,6 @@ /** * @author ESOL - * */ class PHFlashGERG2008Test { static neqsim.thermo.system.SystemInterface testSystem = null; diff --git a/src/test/java/neqsim/thermodynamicOperations/flashOps/PHFlashTest.java b/src/test/java/neqsim/thermodynamicOperations/flashOps/PHFlashTest.java index 406dc3dde..f2239b838 100644 --- a/src/test/java/neqsim/thermodynamicOperations/flashOps/PHFlashTest.java +++ b/src/test/java/neqsim/thermodynamicOperations/flashOps/PHFlashTest.java @@ -7,7 +7,6 @@ /** * @author ESOL - * */ class PHFlashTest { static neqsim.thermo.system.SystemInterface testSystem = null; diff --git a/src/test/java/neqsim/thermodynamicOperations/flashOps/PSFlashGERG2008Test.java b/src/test/java/neqsim/thermodynamicOperations/flashOps/PSFlashGERG2008Test.java index 88f027f49..d7345039c 100644 --- a/src/test/java/neqsim/thermodynamicOperations/flashOps/PSFlashGERG2008Test.java +++ b/src/test/java/neqsim/thermodynamicOperations/flashOps/PSFlashGERG2008Test.java @@ -7,7 +7,6 @@ /** * @author ESOL - * */ class PSFlashGERG2008Test { static neqsim.thermo.system.SystemInterface testSystem = null; diff --git a/src/test/java/neqsim/thermodynamicOperations/flashOps/TPFlashTest.java b/src/test/java/neqsim/thermodynamicOperations/flashOps/TPFlashTest.java index 83590e167..a700beed4 100644 --- a/src/test/java/neqsim/thermodynamicOperations/flashOps/TPFlashTest.java +++ b/src/test/java/neqsim/thermodynamicOperations/flashOps/TPFlashTest.java @@ -7,7 +7,6 @@ /** * @author ESOL - * */ class TPFlashTest { static neqsim.thermo.system.SystemInterface testSystem = null; diff --git a/src/test/java/neqsim/thermodynamicOperations/flashOps/TPFlashTestHighTemp.java b/src/test/java/neqsim/thermodynamicOperations/flashOps/TPFlashTestHighTemp.java index bf81197f2..4dac61a32 100644 --- a/src/test/java/neqsim/thermodynamicOperations/flashOps/TPFlashTestHighTemp.java +++ b/src/test/java/neqsim/thermodynamicOperations/flashOps/TPFlashTestHighTemp.java @@ -7,7 +7,6 @@ /** * @author ESOL - * */ class TPFlashTestHighTemp { static neqsim.thermo.system.SystemInterface testSystem = null; From 47dc40f3065da3282500b0a6767a1c9ae196adb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=85smund=20V=C3=A5ge=20Fannemel?= <34712686+asmfstatoil@users.noreply.github.com> Date: Fri, 15 Mar 2024 12:54:55 +0100 Subject: [PATCH 8/8] more --- .../LinearProgrammingChemicalEquilibrium.java | 11 ++++------- .../processEquipment/expander/Expander.java | 5 ++--- .../processSystem/ProcessSystem.java | 4 +--- .../thermo/component/ComponentGEUniquac.java | 8 ++------ .../neqsim/thermo/phase/PhasePCSAFTRahmat.java | 5 ++--- .../java/neqsim/thermo/phase/PhaseSrkCPA.java | 11 +++++------ .../java/neqsim/thermo/phase/PhaseUMRCPA.java | 11 +++++------ .../util/example/TestNeqsim.java | 15 ++++----------- .../neqsim/thermo/util/example/HydrateFlash.java | 5 ++--- .../neqsim/thermo/util/example/PS_PH_flash.java | 5 ++--- .../flashOps/TPFlashTestWellFluid.java | 1 - .../flashOps/WaxFlashTest.java | 1 - 12 files changed, 29 insertions(+), 53 deletions(-) diff --git a/src/main/java/neqsim/chemicalReactions/chemicalEquilibriaum/LinearProgrammingChemicalEquilibrium.java b/src/main/java/neqsim/chemicalReactions/chemicalEquilibriaum/LinearProgrammingChemicalEquilibrium.java index b05380e48..b2f590ff2 100644 --- a/src/main/java/neqsim/chemicalReactions/chemicalEquilibriaum/LinearProgrammingChemicalEquilibrium.java +++ b/src/main/java/neqsim/chemicalReactions/chemicalEquilibriaum/LinearProgrammingChemicalEquilibrium.java @@ -315,14 +315,11 @@ public void calcx(Matrix atemp, Matrix lagrangeTemp) { * btemp; Matrix mutemp = new * Matrix(chemRefPot,1).times(1.0/(R*system.getPhase(phase).getTemperature())). copy(); Matrix * ntemp; atemp = new Matrix(7,7); btemp = new Matrix(1,7); //for (i=0;i<4;i++) for (i=0;i<5;i++) - * { for (j=0;j<7;j++) atemp.set(i,j,Amatrix[i][j]); btemp.set(0,i,bVector[i]); - * - * } atemp.set(5,4,1); atemp.set(6,5,1); //atemp.set(4,4,1); //atemp.set(5,5,1); - * //atemp.set(6,1,1); //atemp.print(5,1); //btemp.print(5,5); //mutemp.print(5,5); ntemp = + * { for (j=0;j<7;j++) atemp.set(i,j,Amatrix[i][j]); btemp.set(0,i,bVector[i]); } + * atemp.set(5,4,1); atemp.set(6,5,1); //atemp.set(4,4,1); //atemp.set(5,5,1); //atemp.set(6,1,1); + * //atemp.print(5,1); //btemp.print(5,5); //mutemp.print(5,5); ntemp = * atemp.solve(btemp.transpose()); ntemp.print(5,5); for (i=0;i<7;i++) n[i] = ntemp.get(i,0); int - * rank = atemp.rank(); return n; - * - * } + * rank = atemp.rank(); return n; } */ // Method updated to use Apache Commons Math 3 by Marlene 07.12.18 diff --git a/src/main/java/neqsim/processSimulation/processEquipment/expander/Expander.java b/src/main/java/neqsim/processSimulation/processEquipment/expander/Expander.java index 4799c0a42..b11ecaad1 100644 --- a/src/main/java/neqsim/processSimulation/processEquipment/expander/Expander.java +++ b/src/main/java/neqsim/processSimulation/processEquipment/expander/Expander.java @@ -97,9 +97,8 @@ public void run(UUID id) { * 1.0); oldPolyt = polytropicEfficiency; polytropicEfficiency = factor * * isentropicEfficiency; dH = thermoSystem.getEnthalpy() - hinn; hout = hinn + dH / * polytropicEfficiency; thermoOps.PHflash(hout, 0); System.out.println(" factor " + factor + - * " n " + n + " k " + k + " polytropic effici " + polytropicEfficiency + " iter " + iter); - * - * } while (Math.abs((oldPolyt - polytropicEfficiency) / oldPolyt) > 1e-5 && iter < 500); // + * " n " + n + " k " + k + " polytropic effici " + polytropicEfficiency + " iter " + iter); } + * while (Math.abs((oldPolyt - polytropicEfficiency) / oldPolyt) > 1e-5 && iter < 500); // * polytropicEfficiency = isentropicEfficiency * (); */ } else { diff --git a/src/main/java/neqsim/processSimulation/processSystem/ProcessSystem.java b/src/main/java/neqsim/processSimulation/processSystem/ProcessSystem.java index e68c17460..d0a2a555c 100644 --- a/src/main/java/neqsim/processSimulation/processSystem/ProcessSystem.java +++ b/src/main/java/neqsim/processSimulation/processSystem/ProcessSystem.java @@ -480,9 +480,7 @@ public void run(UUID id) { * measurementDevices.get(i)) .getName(); signalDB[timeStepNumber][3 * i + 2] = Double * .toString(((MeasurementDeviceInterface) measurementDevices.get(i)).getMeasuredValue()); * signalDB[timeStepNumber][3 * i + 3] = ((MeasurementDeviceInterface) - * measurementDevices.get(i)) .getUnit(); - * - * } + * measurementDevices.get(i)) .getUnit(); } */ } while ((!isConverged || (iter < 2 && hasResycle)) && iter < 100); diff --git a/src/main/java/neqsim/thermo/component/ComponentGEUniquac.java b/src/main/java/neqsim/thermo/component/ComponentGEUniquac.java index cfb9592e6..2178437da 100644 --- a/src/main/java/neqsim/thermo/component/ComponentGEUniquac.java +++ b/src/main/java/neqsim/thermo/component/ComponentGEUniquac.java @@ -136,9 +136,7 @@ public double getGamma(PhaseInterface phase, int numberOfComponents, double temp * * for (k=0;k< numberOfComponents;k++){ temp5 = 0; for (j=0;j< numberOfComponents;j++){ temp5 = * temp5 + compArray[j].getq() * compArray[j].getx() * - * Math.exp(-intparam[compArray[j].getIndex()][compArray[k].getIndex()]/ temperature); - * - * } + * Math.exp(-intparam[compArray[j].getIndex()][compArray[k].getIndex()]/ temperature); } * * temp3 = temp3 + (compArray[k].getq() * compArray[k].getx() * Math.exp(- * intparam[this.getIndex()][compArray[k].getIndex()]/temperature)) / temp5; } @@ -205,9 +203,7 @@ public double fugcoefDiffTemp(PhaseInterface phase, int numberOfComponents, doub * System.out.println("dfugdT : " + NumericalDerivative.fugcoefDiffTemp(this, phase, * numberOfComponents, temperature, pressure, pt)); return * NumericalDerivative.fugcoefDiffTemp(this, phase, numberOfComponents, temperature, pressure, - * pt); - * - * } + * pt); } */ /** diff --git a/src/main/java/neqsim/thermo/phase/PhasePCSAFTRahmat.java b/src/main/java/neqsim/thermo/phase/PhasePCSAFTRahmat.java index ec9cef08b..8b9c39d21 100644 --- a/src/main/java/neqsim/thermo/phase/PhasePCSAFTRahmat.java +++ b/src/main/java/neqsim/thermo/phase/PhasePCSAFTRahmat.java @@ -1188,9 +1188,8 @@ public double molarVolume(double pressure, double temperature, double A, double // System.out.println("iterations " + iterations); /* * if(BonV<0){ BonV = pressure*getB()/(numberOfMolesInPhase*temperature*R); setMolarVolume(1.0 / - * BonV * Btemp / numberOfMolesInPhase); Z = pressure*getMolarVolume()/(R*temperature); - * - * } if(iterations>=6000) throw new util.exception.TooManyIterationsException(); + * BonV * Btemp / numberOfMolesInPhase); Z = pressure*getMolarVolume()/(R*temperature); } + * if(iterations>=6000) throw new util.exception.TooManyIterationsException(); * if(Double.isNaN(getMolarVolume())) throw new util.exception.IsNaNException(); * * // if(pt==0) System.out.println("density " + getDensity()); //"BonV: " + BonV + diff --git a/src/main/java/neqsim/thermo/phase/PhaseSrkCPA.java b/src/main/java/neqsim/thermo/phase/PhaseSrkCPA.java index c52af5f19..3ad5f08fd 100644 --- a/src/main/java/neqsim/thermo/phase/PhaseSrkCPA.java +++ b/src/main/java/neqsim/thermo/phase/PhaseSrkCPA.java @@ -780,12 +780,11 @@ public double molarVolume(double pressure, double temperature, double A, double * = calcRootVolFinder(pt); // BonV = molarVolumeChangePhase(pressure, temperature, A, B, pt); * // BonV = 0.9999; // BonV = pt == 1 ? 2.0 / (2.0 + temperature / * getPseudoCriticalTemperature()) : pressure * getB() / (numberOfMolesInPhase * temperature * - * R); } - * - * } else if (BonV < 0) { if (iterations < 10) { BonV = Math.abs(BonVold + BonV) / 2.0; } else - * { // BonV = calcRootVolFinder(pt); // return molarVolumeChangePhase(pressure, temperature, - * A, B, pt); // BonV = pt == 1 ? 2.0 / (2.0 + temperature / getPseudoCriticalTemperature()) : - * pressure * getB() / (numberOfMolesInPhase * temperature * R); } } + * R); } } else if (BonV < 0) { if (iterations < 10) { BonV = Math.abs(BonVold + BonV) / 2.0; + * } else { // BonV = calcRootVolFinder(pt); // return molarVolumeChangePhase(pressure, + * temperature, A, B, pt); // BonV = pt == 1 ? 2.0 / (2.0 + temperature / + * getPseudoCriticalTemperature()) : pressure * getB() / (numberOfMolesInPhase * temperature * + * R); } } */ setMolarVolume(1.0 / BonV * Btemp / numberOfMolesInPhase); Z = pressure * getMolarVolume() / (R * temperature); diff --git a/src/main/java/neqsim/thermo/phase/PhaseUMRCPA.java b/src/main/java/neqsim/thermo/phase/PhaseUMRCPA.java index 3be502e18..9aebd2f09 100644 --- a/src/main/java/neqsim/thermo/phase/PhaseUMRCPA.java +++ b/src/main/java/neqsim/thermo/phase/PhaseUMRCPA.java @@ -780,12 +780,11 @@ public double molarVolume(double pressure, double temperature, double A, double * = calcRootVolFinder(pt); // BonV = molarVolumeChangePhase(pressure, temperature, A, B, pt); * // BonV = 0.9999; // BonV = pt == 1 ? 2.0 / (2.0 + temperature / * getPseudoCriticalTemperature()) : pressure * getB() / (numberOfMolesInPhase * temperature * - * R); } - * - * } else if (BonV < 0) { if (iterations < 10) { BonV = Math.abs(BonVold + BonV) / 2.0; } else - * { // BonV = calcRootVolFinder(pt); // return molarVolumeChangePhase(pressure, temperature, - * A, B, pt); // BonV = pt == 1 ? 2.0 / (2.0 + temperature / getPseudoCriticalTemperature()) : - * pressure * getB() / (numberOfMolesInPhase * temperature * R); } } + * R); } } else if (BonV < 0) { if (iterations < 10) { BonV = Math.abs(BonVold + BonV) / 2.0; + * } else { // BonV = calcRootVolFinder(pt); // return molarVolumeChangePhase(pressure, + * temperature, A, B, pt); // BonV = pt == 1 ? 2.0 / (2.0 + temperature / + * getPseudoCriticalTemperature()) : pressure * getB() / (numberOfMolesInPhase * temperature * + * R); } } */ setMolarVolume(1.0 / BonV * Btemp / numberOfMolesInPhase); Z = pressure * getMolarVolume() / (R * temperature); diff --git a/src/test/java/neqsim/processSimulation/util/example/TestNeqsim.java b/src/test/java/neqsim/processSimulation/util/example/TestNeqsim.java index 1462b4eeb..76dbeb30f 100644 --- a/src/test/java/neqsim/processSimulation/util/example/TestNeqsim.java +++ b/src/test/java/neqsim/processSimulation/util/example/TestNeqsim.java @@ -140,20 +140,13 @@ public static void main(String[] args) { } // catch(Exception ex){ /* - * System.out.println( "P_out" ); for (int i=0;i<10;i++ ) { System.out.println(20 + 5*i); - * - * } + * System.out.println( "P_out" ); for (int i=0;i<10;i++ ) { System.out.println(20 + 5*i); } * * System.out.println( "Temperature" ); for (int i=0;i<10;i++ ) { System.out.println( - * temperature[i] ); - * - * } - * - * System.out.println( "Work" ); for (int i=0;i<10;i++ ) { System.out.println( work [i] ); - * - * } System.out.println( "Cp" ); for (int i=0;i<10;i++ ) { System.out.println( Cp [i] ); + * temperature[i] ); } * - * } + * System.out.println( "Work" ); for (int i=0;i<10;i++ ) { System.out.println( work [i] ); } + * System.out.println( "Cp" ); for (int i=0;i<10;i++ ) { System.out.println( Cp [i] ); } * * System.out.println( "Density" ); for (int i=0;i<10;i++ ) { System.out.println( Density [i] ); */ diff --git a/src/test/java/neqsim/thermo/util/example/HydrateFlash.java b/src/test/java/neqsim/thermo/util/example/HydrateFlash.java index 6a30a937d..a7c4d5639 100644 --- a/src/test/java/neqsim/thermo/util/example/HydrateFlash.java +++ b/src/test/java/neqsim/thermo/util/example/HydrateFlash.java @@ -167,9 +167,8 @@ public static void main(String args[]) { * * testSystem2.setMixingRule(7); testSystem2.init(0); testSystem2.init(1); * ThermodynamicOperations testOps2 = new ThermodynamicOperations(testSystem2); try { - * testOps2.waterDewPointTemperatureFlash(); - * - * } catch (Exception ex) { logger.error(ex.getMessage()) } testSystem2.display(); + * testOps2.waterDewPointTemperatureFlash(); } catch (Exception ex) { + * logger.error(ex.getMessage()) } testSystem2.display(); */ } } 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 0df3439f5..c31fd705d 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 @@ -74,9 +74,8 @@ public static void main(String args[]) { double entropy = testSystem.getEntropy(); /* * testSystem.setTemperature(273.15 + 0.0); testSystem.setPressure(100.0); try { - * testOps.TPflash(); // testOps.bubblePointTemperatureFlash(); } catch (Exception ex) { - * - * } testSystem.init(2); testSystem.setPressure(100.0); // System.out.println("entropy spec" + + * testOps.TPflash(); // testOps.bubblePointTemperatureFlash(); } catch (Exception ex) { } + * testSystem.init(2); testSystem.setPressure(100.0); // System.out.println("entropy spec" + * entropy); * * // testSystem.setPressure(20.894745); diff --git a/src/test/java/neqsim/thermodynamicOperations/flashOps/TPFlashTestWellFluid.java b/src/test/java/neqsim/thermodynamicOperations/flashOps/TPFlashTestWellFluid.java index d95732acf..1ba453a91 100644 --- a/src/test/java/neqsim/thermodynamicOperations/flashOps/TPFlashTestWellFluid.java +++ b/src/test/java/neqsim/thermodynamicOperations/flashOps/TPFlashTestWellFluid.java @@ -7,7 +7,6 @@ /** * @author ESOL - * */ class TPFlashTestWellFluid { static neqsim.thermo.system.SystemInterface wellFluid = null; diff --git a/src/test/java/neqsim/thermodynamicOperations/flashOps/WaxFlashTest.java b/src/test/java/neqsim/thermodynamicOperations/flashOps/WaxFlashTest.java index 98d728330..a59583deb 100644 --- a/src/test/java/neqsim/thermodynamicOperations/flashOps/WaxFlashTest.java +++ b/src/test/java/neqsim/thermodynamicOperations/flashOps/WaxFlashTest.java @@ -11,7 +11,6 @@ /** * @author ESOL - * */ class WaxFlashTest { static Logger logger = LogManager.getLogger(WaxFlashTest.class);