From a42070da209015295d3feda4fbb1fd7d10d026d0 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, 13 Nov 2023 12:55:54 +0100 Subject: [PATCH] feat: 101325.0 -> atm --- .../PFCTConductivityMethodMod86.java | 4 +- .../VolumeFlowTransmitter.java | 9 +- .../processModules/SeparationTrainModule.java | 5 +- .../SeparationTrainModuleSimple.java | 5 +- .../WettedWallColumnSampleCreator.java | 3 +- src/main/java/neqsim/thermo/phase/Phase.java | 12 +- .../neqsim/thermo/phase/PhaseInterface.java | 231 +++++----- .../neqsim/thermo/system/SystemInterface.java | 394 +++++++----------- .../neqsim/thermo/system/SystemThermo.java | 18 +- .../util/empiric/BukacekWaterInGas.java | 5 +- .../util/readwrite/EclipseFluidReadWrite.java | 5 +- src/main/java/neqsim/util/unit/RateUnit.java | 6 +- .../util/example/MasstransferMeOH.java | 4 +- .../TEGdehydrationProcessDistillation.java | 12 +- .../TEGdehydrationProcessDistillation3.java | 12 +- ...TEGdehydrationProcessDistillationAaHa.java | 13 +- .../TEGdehydrationProcessDistillationGFA.java | 13 +- .../thermo/util/example/HydrateFlash.java | 3 +- .../thermo/util/example/TPflashDehyd.java | 2 +- 19 files changed, 332 insertions(+), 424 deletions(-) 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 79b1d6762..b425eba7b 100644 --- a/src/main/java/neqsim/physicalProperties/physicalPropertyMethods/commonPhasePhysicalProperties/conductivity/PFCTConductivityMethodMod86.java +++ b/src/main/java/neqsim/physicalProperties/physicalPropertyMethods/commonPhasePhysicalProperties/conductivity/PFCTConductivityMethodMod86.java @@ -264,8 +264,8 @@ public double getRefComponentViscosity(double temp, double pres) { 4.2903609488e-2, 1.4529023444e2, 6.1276818706e3}; // double viscRefK[] = {-9.74602, 18.0834, -4126.66, 44.6055, 0.9676544, 81.8134, 15649.9}; - double molDens = - 101325.0 / ThermodynamicConstantsInterface.R / phase.getPhase().getTemperature() / 1.0e3; + double molDens = ThermodynamicConstantsInterface.atm / ThermodynamicConstantsInterface.R + / phase.getPhase().getTemperature() / 1.0e3; double critMolDens = 10.15; double redMolDens = (molDens - critMolDens) / critMolDens; double viscRefO = GVcoef[0] * Math.pow(temp, -1.0) + GVcoef[1] * Math.pow(temp, -2.0 / 3.0) diff --git a/src/main/java/neqsim/processSimulation/measurementDevice/VolumeFlowTransmitter.java b/src/main/java/neqsim/processSimulation/measurementDevice/VolumeFlowTransmitter.java index aabd8a74b..2a3f95245 100644 --- a/src/main/java/neqsim/processSimulation/measurementDevice/VolumeFlowTransmitter.java +++ b/src/main/java/neqsim/processSimulation/measurementDevice/VolumeFlowTransmitter.java @@ -1,6 +1,7 @@ package neqsim.processSimulation.measurementDevice; import neqsim.processSimulation.processEquipment.stream.StreamInterface; +import neqsim.thermo.ThermodynamicConstantsInterface; /** *
@@ -58,13 +59,13 @@ public double getMeasuredValue(String unit) { } else if (unit.equals("Nm^3/day")) { return stream.getThermoSystem().getPhase(measuredPhaseNumber).getNumberOfMolesInPhase() * neqsim.thermo.ThermodynamicConstantsInterface.R - * neqsim.thermo.ThermodynamicConstantsInterface.normalStateTemperature / 101325.0 * 3600.0 - * 24; + * neqsim.thermo.ThermodynamicConstantsInterface.normalStateTemperature + / ThermodynamicConstantsInterface.atm * 3600.0 * 24; } else if (unit.equals("Sm^3/day")) { return stream.getThermoSystem().getPhase(measuredPhaseNumber).getNumberOfMolesInPhase() * neqsim.thermo.ThermodynamicConstantsInterface.R - * neqsim.thermo.ThermodynamicConstantsInterface.standardStateTemperature / 101325.0 - * 3600.0 * 24; + * neqsim.thermo.ThermodynamicConstantsInterface.standardStateTemperature + / ThermodynamicConstantsInterface.atm * 3600.0 * 24; } else { return stream.getThermoSystem().getPhase(measuredPhaseNumber).getNumberOfMolesInPhase() * stream.getThermoSystem().getPhase(measuredPhaseNumber).getMolarMass() / stream diff --git a/src/main/java/neqsim/processSimulation/processSystem/processModules/SeparationTrainModule.java b/src/main/java/neqsim/processSimulation/processSystem/processModules/SeparationTrainModule.java index c7f7a0470..db3b13941 100644 --- a/src/main/java/neqsim/processSimulation/processSystem/processModules/SeparationTrainModule.java +++ b/src/main/java/neqsim/processSimulation/processSystem/processModules/SeparationTrainModule.java @@ -342,8 +342,9 @@ public static void main(String[] args) { * getPhase(0).getPhysicalProperties().getDensity() * 3600.0 + " m^3/hr"); * System.out.println("Export gas flow " + * separationModule.getOutputStream("gas exit stream").getThermoSystem(). - * getTotalNumberOfMoles() * ThermodynamicConstantsInterface.R * (273.15 + 15.0) / 101325.0 * - * 3600.0 * 24 / 1.0e6 + " MSm^3/day"); System.out.println("oil/water heater duty " + ((Heater) + * getTotalNumberOfMoles() * ThermodynamicConstantsInterface.R * (273.15 + 15.0) + * /ThermodynamicConstantsInterface.atm * 3600.0 * 24 / 1.0e6 + " MSm^3/day"); + * System.out.println("oil/water heater duty " + ((Heater) * separationModule.getOperations().getUnit("oil/water heater")).getEnergyInput( ) + " W"); * System.out.println("Export oil cooler duty " + ((Cooler) * separationModule.getOperations().getUnit("export oil cooler")).getEnergyInput () + " W"); diff --git a/src/main/java/neqsim/processSimulation/processSystem/processModules/SeparationTrainModuleSimple.java b/src/main/java/neqsim/processSimulation/processSystem/processModules/SeparationTrainModuleSimple.java index 6cb3273d7..49ee75b16 100644 --- a/src/main/java/neqsim/processSimulation/processSystem/processModules/SeparationTrainModuleSimple.java +++ b/src/main/java/neqsim/processSimulation/processSystem/processModules/SeparationTrainModuleSimple.java @@ -338,8 +338,9 @@ public static void main(String[] args) { * getPhase(0).getPhysicalProperties().getDensity() * 3600.0 + " m^3/hr"); * System.out.println("Export gas flow " + * separationModule.getOutputStream("gas exit stream").getThermoSystem(). - * getTotalNumberOfMoles() * ThermodynamicConstantsInterface.R * (273.15 + 15.0) / 101325.0 * - * 3600.0 * 24 / 1.0e6 + " MSm^3/day"); System.out.println("oil/water heater duty " + ((Heater) + * getTotalNumberOfMoles() * ThermodynamicConstantsInterface.R * (273.15 + 15.0) + * /ThermodynamicConstantsInterface.atm * 3600.0 * 24 / 1.0e6 + " MSm^3/day"); + * System.out.println("oil/water heater duty " + ((Heater) * separationModule.getOperations().getUnit("oil/water heater")).getEnergyInput( ) + " W"); * System.out.println("Export oil cooler duty " + ((Cooler) * separationModule.getOperations().getUnit("export oil cooler")).getEnergyInput () + " W"); diff --git a/src/main/java/neqsim/statistics/experimentalSampleCreation/sampleCreator/wettedWallColumnSampleCreator/WettedWallColumnSampleCreator.java b/src/main/java/neqsim/statistics/experimentalSampleCreation/sampleCreator/wettedWallColumnSampleCreator/WettedWallColumnSampleCreator.java index ca225d464..6c6b69cac 100644 --- a/src/main/java/neqsim/statistics/experimentalSampleCreation/sampleCreator/wettedWallColumnSampleCreator/WettedWallColumnSampleCreator.java +++ b/src/main/java/neqsim/statistics/experimentalSampleCreation/sampleCreator/wettedWallColumnSampleCreator/WettedWallColumnSampleCreator.java @@ -190,7 +190,8 @@ public void calcdPdt() { dNdt[i] = dPdt[i] * 1.0 / dPdn[i]; err += Math.abs((dNdtOld[i] - dNdt[i])); // System.out.println("dndt: " + dNdt[i]); - dnVdt[i] = dNdt[i] * ThermodynamicConstantsInterface.R * 298.15 / 101325.0 * 1000 * 60; + dnVdt[i] = dNdt[i] * ThermodynamicConstantsInterface.R * 298.15 + / ThermodynamicConstantsInterface.atm * 1000 * 60; System.out.println("dVdt: " + dnVdt[i]); } System.out.println("err: " + err); diff --git a/src/main/java/neqsim/thermo/phase/Phase.java b/src/main/java/neqsim/thermo/phase/Phase.java index e561031c7..1b486e29b 100644 --- a/src/main/java/neqsim/thermo/phase/Phase.java +++ b/src/main/java/neqsim/thermo/phase/Phase.java @@ -2159,16 +2159,20 @@ public double getFlowRate(String flowunit) { return numberOfMolesInPhase * 3600.0; } else if (flowunit.equals("Sm3/sec")) { return numberOfMolesInPhase * ThermodynamicConstantsInterface.R - * ThermodynamicConstantsInterface.standardStateTemperature / 101325.0; + * ThermodynamicConstantsInterface.standardStateTemperature + / ThermodynamicConstantsInterface.atm; } else if (flowunit.equals("Sm3/hr")) { return numberOfMolesInPhase * 3600.0 * ThermodynamicConstantsInterface.R - * ThermodynamicConstantsInterface.standardStateTemperature / 101325.0; + * ThermodynamicConstantsInterface.standardStateTemperature + / ThermodynamicConstantsInterface.atm; } else if (flowunit.equals("Sm3/day")) { return numberOfMolesInPhase * 3600.0 * 24.0 * ThermodynamicConstantsInterface.R - * ThermodynamicConstantsInterface.standardStateTemperature / 101325.0; + * ThermodynamicConstantsInterface.standardStateTemperature + / ThermodynamicConstantsInterface.atm; } else if (flowunit.equals("MSm3/day")) { return numberOfMolesInPhase * 3600.0 * 24.0 * ThermodynamicConstantsInterface.R - * ThermodynamicConstantsInterface.standardStateTemperature / 101325.0 / 1.0e6; + * ThermodynamicConstantsInterface.standardStateTemperature + / ThermodynamicConstantsInterface.atm / 1.0e6; } else { throw new RuntimeException("failed.. unit: " + flowunit + " not supported"); } diff --git a/src/main/java/neqsim/thermo/phase/PhaseInterface.java b/src/main/java/neqsim/thermo/phase/PhaseInterface.java index 34833aedf..ba7afc9f6 100644 --- a/src/main/java/neqsim/thermo/phase/PhaseInterface.java +++ b/src/main/java/neqsim/thermo/phase/PhaseInterface.java @@ -24,10 +24,10 @@ public interface PhaseInterface extends ThermodynamicConstantsInterface, Cloneab * addcomponent. *
* - * @param name Name of component. - * @param moles a double + * @param name Name of component. + * @param moles a double * @param molesInPhase a double - * @param compNumber a int + * @param compNumber a int */ public void addComponent(String name, double moles, double molesInPhase, int compNumber); @@ -36,10 +36,10 @@ public interface PhaseInterface extends ThermodynamicConstantsInterface, Cloneab * addcomponent. * * - * @param name Name of component. - * @param moles a double + * @param name Name of component. + * @param moles a double * @param molesInPhase a double - * @param compNumber a int + * @param compNumber a int * @deprecated Replaced by {@link addComponent} */ @Deprecated @@ -67,12 +67,10 @@ public default void addcomponent(String name, double moles, double molesInPhase, /** *- * Returns the composition vector in unit - * molefraction/wtfraction/molespersec/volumefraction. + * Returns the composition vector in unit molefraction/wtfraction/molespersec/volumefraction. *
* - * @param unit Supported units are molefraction, wtfraction, molespersec, - * volumefraction + * @param unit Supported units are molefraction, wtfraction, molespersec, volumefraction * @return composition array with unit */ public double[] getComposition(String unit); @@ -138,8 +136,7 @@ public default void addcomponent(String name, double moles, double molesInPhase, public double getVolume(String unit); /** - * method to return heat capacity ratio/adiabatic index/Poisson constant. The - * method calculates it + * method to return heat capacity ratio/adiabatic index/Poisson constant. The method calculates it * as Cp (real) /Cv (real). * * @return gamma @@ -147,8 +144,7 @@ public default void addcomponent(String name, double moles, double molesInPhase, public double getGamma(); /** - * method to return heat capacity ratio calculated as - * Cp/(Cp-R*getNumberOfMolesInPhase). + * method to return heat capacity ratio calculated as Cp/(Cp-R*getNumberOfMolesInPhase). * * @return kappa */ @@ -243,8 +239,8 @@ public default double getGamma2() { * * @param totalNumberOfMoles Total number of moles in all phases of Stream. * @param numberOfComponents Number of components in system. - * @param type a int. Use 0 to init, and 1 to reset. - * @param beta Mole fraction of this phase in system. + * @param type a int. Use 0 to init, and 1 to reset. + * @param beta Mole fraction of this phase in system. */ public default void init(double totalNumberOfMoles, int numberOfComponents, int type, double beta) { @@ -258,9 +254,9 @@ public default void init(double totalNumberOfMoles, int numberOfComponents, int * * @param totalNumberOfMoles Total number of moles in all phases of Stream. * @param numberOfComponents Number of components in system. - * @param type a int. Use 0 to init, and 1 to reset. - * @param pt Type of phase. - * @param beta Mole fraction of this phase in system. + * @param type a int. Use 0 to init, and 1 to reset. + * @param pt Type of phase. + * @param beta Mole fraction of this phase in system. */ public void init(double totalNumberOfMoles, int numberOfComponents, int type, PhaseType pt, double beta); @@ -272,9 +268,9 @@ public void init(double totalNumberOfMoles, int numberOfComponents, int type, Ph * * @param totalNumberOfMoles Total number of moles in system. * @param numberOfComponents Number of components in system. - * @param type a int. Use 0 to init, and 1 to reset. - * @param ptNumber Phase type index. - * @param beta Mole fraction of this phase in system. + * @param type a int. Use 0 to init, and 1 to reset. + * @param ptNumber Phase type index. + * @param beta Mole fraction of this phase in system. * @deprecated Replace with init-function using PhaseType input. */ @Deprecated @@ -367,8 +363,7 @@ public default void init(double totalNumberOfMoles, int numberOfComponents, int * getcomponentArray. * * - * @return an array of {@link neqsim.thermo.component.ComponentInterface} - * objects + * @return an array of {@link neqsim.thermo.component.ComponentInterface} objects */ public ComponentInterface[] getcomponentArray(); @@ -392,19 +387,16 @@ public default void init(double totalNumberOfMoles, int numberOfComponents, int public double getWtFraction(SystemInterface system); /** - * method to return molar volume of the phase note: without Peneloux volume - * correction. + * method to return molar volume of the phase note: without Peneloux volume correction. * * @return molar volume volume in unit m3/mol*1e5 */ public double getMolarVolume(); /** - * method to return molar volume of the fluid: - * eventual volume correction included. - * - * @param unit Supported units are m3/mol, litre/mol + * method to return molar volume of the fluid: eventual volume correction included. * + * @param unit Supported units are m3/mol, litre/mol * @return molar volume volume in unit */ public double getMolarVolume(String unit); @@ -412,9 +404,8 @@ public default void init(double totalNumberOfMoles, int numberOfComponents, int /** * method to return flow rate of a phase. * - * @param flowunit Supported units are kg/sec, kg/min, kg/hr, m3/sec, m3/min, - * m3/hr, ft3/sec, - * mole/sec, mole/min, mole/hr + * @param flowunit Supported units are kg/sec, kg/min, kg/hr, m3/sec, m3/min, m3/hr, ft3/sec, + * mole/sec, mole/min, mole/hr * @return flow rate in specified unit */ public double getFlowRate(String flowunit); @@ -424,8 +415,7 @@ public default void init(double totalNumberOfMoles, int numberOfComponents, int * setComponentArray. * * - * @param components an array of - * {@link neqsim.thermo.component.ComponentInterface} objects + * @param components an array of {@link neqsim.thermo.component.ComponentInterface} objects */ public void setComponentArray(ComponentInterface[] components); @@ -446,8 +436,7 @@ public default void init(double totalNumberOfMoles, int numberOfComponents, int public double[] getProperties_GERG2008(); /** - * method to get density of a phase note: does not use Peneloux volume - * correction. + * method to get density of a phase note: does not use Peneloux volume correction. * * @return density with unit kg/m3 */ @@ -466,10 +455,10 @@ public default void init(double totalNumberOfMoles, int numberOfComponents, int * removeComponent. * * - * @param name a {@link String} object - * @param moles a double + * @param name a {@link String} object + * @param moles a double * @param molesInPhase a double - * @param compNumber a int + * @param compNumber a int */ public void removeComponent(String name, double moles, double molesInPhase, int compNumber); @@ -638,8 +627,7 @@ public default double getExessGibbsEnergySymetric() { /** *
- * Getter for property beta
. Beta is the mole fraction of a phase
- * of all the moles of
+ * Getter for property beta
. Beta is the mole fraction of a phase of all the moles of
* a system.
*
- * Setter for property beta
. Beta is the mole fraction of a phase
- * of all the moles of
+ * Setter for property beta
. Beta is the mole fraction of a phase of all the moles of
* a system.
*
- * Change the number of moles of component of phase,i.e.,
- * numberOfMolesInPhase
but do
+ * 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 of total number
- * of moles 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 of total number of moles in system.
*
- * 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
+ * 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 of total number
- * of moles 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 of total number of moles in system.
*
- * Change the number of moles of component of phase, i.e.,
- * numberOfMolesInPhase
and
- * 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.,
+ * Change the number of moles of component of phase, i.e., numberOfMolesInPhase
and
+ * 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 of total number
- * of moles 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 of total number of moles in system.
*
- * Get sum of mole fractions for all components. NB! init(0) must be called - * first. + * Get sum of mole fractions for all components. NB! init(0) must be called first. *
* * @return a double @@ -247,8 +234,7 @@ public default String[][] calcResultTable() { public double getMoleFractionsSum(); /** - * method to get the speed of sound of a system. The sound speed is implemented - * based on a molar + * method to get the speed of sound of a system. The sound speed is implemented based on a molar * average over the phases * * @param unit Supported units are m/s, km/h @@ -257,8 +243,7 @@ public default String[][] calcResultTable() { public double getSoundSpeed(String unit); /** - * method to get the speed of sound of a system. The sound speed is implemented - * based on a molar + * method to get the speed of sound of a system. The sound speed is implemented based on a molar * average over the phases * * @return speed of sound in m/s @@ -287,8 +272,7 @@ public default String[][] calcResultTable() { public void initPhysicalProperties(String propertyName); /** - * Calculates thermodynamic and physical properties of a fluid using - * initThermoProperties() and + * Calculates thermodynamic and physical properties of a fluid using initThermoProperties() and * initPhysicalProperties(). */ public void initProperties(); @@ -309,12 +293,9 @@ public static SystemInterface addFluids(SystemInterface addFluid1, SystemInterfa /** * method to return interfacial tension between two phases. * - * @param phase1 phase type of phase1 as string (valid phases are gas, oil, - * aqueous) - * @param phase2 phase type of phase2 as string (valid phases are gas, oil, - * aqueous) - * @return interfacial tension with unit N/m. If one or both phases does not - * exist - the method + * @param phase1 phase type of phase1 as string (valid phases are gas, oil, aqueous) + * @param phase2 phase type of phase2 as string (valid phases are gas, oil, aqueous) + * @return interfacial tension with unit N/m. If one or both phases does not exist - the method * will return NaN */ public double getInterfacialTension(String phase1, String phase2); @@ -335,7 +316,7 @@ public static SystemInterface addFluids(SystemInterface addFluid1, SystemInterfa * * @param phase1 phase number of phase1 * @param phase2 phase number of phase2 - * @param unit a {@link java.lang.String} object + * @param unit a {@link java.lang.String} object * @return interfacial tension with specified unit */ public double getInterfacialTension(int phase1, int phase2, String unit); @@ -374,10 +355,8 @@ public default double getGamma2() { /** * method to return flow rate of fluid. * - * @param flowunit Supported units are kg/sec, kg/min, kg/hr, kg/day, m3/sec, - * m3/min, m3/hr, - * idSm3/hr, Sm3/sec, Sm3/hr, Sm3/day, MSm3/day, mole/sec, - * mole/min, mole/hr + * @param flowunit Supported units are kg/sec, kg/min, kg/hr, kg/day, m3/sec, m3/min, m3/hr, + * idSm3/hr, Sm3/sec, Sm3/hr, Sm3/day, MSm3/day, mole/sec, mole/min, mole/hr * @return flow rate in specified unit */ public double getFlowRate(String flowunit); @@ -393,7 +372,7 @@ public default double getGamma2() { * method to set the pressure of a fluid (same pressure for all phases). * * @param newPressure in specified unit - * @param unit unit can be bar, bara, barg or atm + * @param unit unit can be bar, bara, barg or atm */ public void setPressure(double newPressure, String unit); @@ -412,7 +391,7 @@ public default double getGamma2() { * * * @param newTemperature a double - * @param phaseNumber a int + * @param phaseNumber a int */ public void setTemperature(double newTemperature, int phaseNumber); @@ -420,13 +399,12 @@ public default double getGamma2() { * method to set the temperature of a fluid (same temperature for all phases). * * @param newTemperature in specified unit - * @param unit unit can be C or K (Celsius or Kelvin) + * @param unit unit can be C or K (Celsius or Kelvin) */ public void setTemperature(double newTemperature, String unit); /** - * method to return the volume fraction of a phase note: without Peneloux volume - * correction. + * method to return the volume fraction of a phase note: without Peneloux volume correction. * * @param phaseNumber number of the phase to get volume fraction for * @return volume fraction @@ -434,8 +412,7 @@ public default double getGamma2() { public double getVolumeFraction(int phaseNumber); /** - * method to return the volume fraction of a phase note: with Peneloux volume - * correction. + * method to return the volume fraction of a phase note: with Peneloux volume correction. * * @param phaseNumber number of the phase to get volume fraction for * @return volume fraction @@ -529,7 +506,7 @@ public default void removeMoles() { * saveObjectToFile. * * - * @param filePath a {@link java.lang.String} object + * @param filePath a {@link java.lang.String} object * @param fluidName a {@link java.lang.String} object */ public void saveObjectToFile(String filePath, String fluidName); @@ -539,7 +516,7 @@ public default void removeMoles() { * readObjectFromFile. * * - * @param filePath a {@link java.lang.String} object + * @param filePath a {@link java.lang.String} object * @param fluidName a {@link java.lang.String} object * @return a {@link neqsim.thermo.system.SystemInterface} object */ @@ -607,7 +584,7 @@ public default void removeMoles() { * changeComponentName. * * - * @param name a {@link java.lang.String} object + * @param name a {@link java.lang.String} object * @param newName a {@link java.lang.String} object */ public void changeComponentName(String name, String newName); @@ -719,10 +696,8 @@ public default boolean IsPhase(int i) { * * * @param flowRate a double - * @param flowunit a {@link java.lang.String} object. flow units are: kg/sec, - * kg/min, kg/hr - * m3/sec, m3/min, m3/hr, mole/sec, mole/min, mole/hr, Sm3/hr, - * Sm3/day, idSm3/hr, idSm3/day + * @param flowunit a {@link java.lang.String} object. flow units are: kg/sec, kg/min, kg/hr + * m3/sec, m3/min, m3/hr, mole/sec, mole/min, mole/hr, Sm3/hr, Sm3/day, idSm3/hr, idSm3/day */ public void setTotalFlowRate(double flowRate, String flowunit); @@ -874,7 +849,7 @@ public default boolean IsPhase(int i) { * saveObject. * * - * @param ID a int + * @param ID a int * @param text a {@link java.lang.String} object */ public void saveObject(int ID, String text); @@ -957,8 +932,7 @@ public default boolean IsPhase(int i) { /** *- * This method is used to set the total molar composition of a fluid. The total - * flow rate will be + * This method is used to set the total molar composition of a fluid. The total flow rate will be * kept constant. The input mole fractions will be normalized. *
* @@ -967,12 +941,10 @@ public default boolean IsPhase(int i) { public void setMolarComposition(double[] moles); /** - * return the phase of to specified type if the phase does not exist, the method - * will return null. + * return the phase of to specified type if the phase does not exist, the method will return null. * - * @param phaseTypeName the phase type to be returned (gas, oil, aqueous, wax, - * hydrate are - * supported) + * @param phaseTypeName the phase type to be returned (gas, oil, aqueous, wax, hydrate are + * supported) * @return a {@link neqsim.thermo.phase.PhaseInterface} object */ public PhaseInterface getPhaseOfType(String phaseTypeName); @@ -991,8 +963,8 @@ public default boolean IsPhase(int i) { * * @param componentName selected name of the component to be added * @param numberOfMoles number of moles to be added - * @param molarMass molar mass of the component in kg/mol - * @param density density of the component in g/cm3 + * @param molarMass molar mass of the component in kg/mol + * @param density density of the component in g/cm3 */ public void addTBPfraction(String componentName, double numberOfMoles, double molarMass, double density); @@ -1002,13 +974,13 @@ public void addTBPfraction(String componentName, double numberOfMoles, double mo * addTBPfraction. * * - * @param componentName a {@link java.lang.String} object - * @param numberOfMoles a double - * @param molarMass a double - * @param density a double + * @param componentName a {@link java.lang.String} object + * @param numberOfMoles a double + * @param molarMass a double + * @param density a double * @param criticalTemperature a double - * @param criticalPressure a double - * @param acentricFactor a double + * @param criticalPressure a double + * @param acentricFactor a double */ public void addTBPfraction(String componentName, double numberOfMoles, double molarMass, double density, double criticalTemperature, double criticalPressure, double acentricFactor); @@ -1020,8 +992,8 @@ public void addTBPfraction(String componentName, double numberOfMoles, double mo * * @param componentName a {@link java.lang.String} object * @param numberOfMoles a double - * @param molarMass a double - * @param density a double + * @param molarMass a double + * @param density a double */ public void addPlusFraction(String componentName, double numberOfMoles, double molarMass, double density); @@ -1032,7 +1004,7 @@ public void addPlusFraction(String componentName, double numberOfMoles, double m * * * @param componentName a {@link java.lang.String} object - * @param value a double + * @param value a double */ public void addSalt(String componentName, double value); @@ -1123,14 +1095,13 @@ public default boolean hasSolidPhase() { * * * @param model a {@link java.lang.String} object - * @param val a double + * @param val a double * @param phase a int */ public void tuneModel(String model, double val, int phase); /** - * add a component to a fluid. If component already exists, the moles will be - * added to the + * add a component to a fluid. If component already exists, the moles will be added to the * existing component. * * @param inComponent Component object to add. @@ -1138,38 +1109,30 @@ public default boolean hasSolidPhase() { public void addComponent(ComponentInterface inComponent); /** - * add a component to a fluid. If component already exists, the moles will be - * added to the + * add a component to a fluid. If component already exists, the moles will be added to the * existing component. * - * @param name Name of the component to add. See NeqSim database for component - * in the database. + * @param name Name of the component to add. See NeqSim database for component in the database. */ public void addComponent(String name); /** - * add a component to a fluid. If component already exists, the moles will be - * added to the + * add a component to a fluid. If component already exists, the moles will be added to the * existing component. * - * @param moles number of moles (per second) of the component to be added to the - * fluid - * @param name Name of the component to add. See NeqSim database for component - * in the database. + * @param moles number of moles (per second) of the component to be added to the fluid + * @param name Name of the component to add. See NeqSim database for component in the database. */ public void addComponent(String name, double moles); /** - * add a component to a fluid. If component already exists, the moles will be - * added to the + * add a component to a fluid. If component already exists, the moles will be added to the * existing component. * - * @param name Name of the component to add. See NeqSim database for - * component in the database. - * @param value The amount - * @param unitName the unit of rate (sported units are kg/sec, mol/sec, - * Nlitre/min, kg/hr, - * Sm^3/hr, Sm^3/day, MSm^3/day .. + * @param name Name of the component to add. See NeqSim database for component in the database. + * @param value The amount + * @param unitName the unit of rate (sported units are kg/sec, mol/sec, Nlitre/min, kg/hr, + * Sm^3/hr, Sm^3/day, MSm^3/day .. */ public void addComponent(String name, double value, String unitName); @@ -1178,37 +1141,30 @@ public default boolean hasSolidPhase() { * addComponent. * * - * @param name Name of the component to add. See NeqSim database for component - * in the database. - * @param moles number of moles (per second) of the component to be added to the - * fluid - * @param TC Critical temperature - * @param PC Critical pressure - * @param acs a double + * @param name Name of the component to add. See NeqSim database for component in the database. + * @param moles number of moles (per second) of the component to be added to the fluid + * @param TC Critical temperature + * @param PC Critical pressure + * @param acs a double */ public void addComponent(String name, double moles, double TC, double PC, double acs); /** - * add a component to a fluid. If component already exists, the moles will be - * added to the + * add a component to a fluid. If component already exists, the moles will be added to the * existing component. * - * @param name Name of the component to add. See NeqSim database for - * component in the database. - * @param moles number of moles (per second) of the component to be added - * to the fluid + * @param name Name of the component to add. See NeqSim database for component in the database. + * @param moles number of moles (per second) of the component to be added to the fluid * @param phaseNumber Number of the phase to add the component to */ public void addComponent(String name, double moles, int phaseNumber); /** - * add a component to a fluid. I component already exists, it will be added to - * the component + * add a component to a fluid. I component already exists, it will be added to the component * - * @param name Name of the component to add. See NeqSim database for - * component in the database. - * @param value rate of the component to add to the fluid - * @param unitName the unit of the flow rate (eg. mol/sec, kg/sec, etc.) + * @param name Name of the component to add. See NeqSim database for component in the database. + * @param value rate of the component to add to the fluid + * @param unitName the unit of the flow rate (eg. mol/sec, kg/sec, etc.) * @param phaseNumber Number of the phase to add the component to */ public void addComponent(String name, double value, String unitName, int phaseNumber); @@ -1219,8 +1175,7 @@ public default boolean hasSolidPhase() { * * * @param index Component number to add - * @param moles number of moles (per second) of the component to be added to the - * fluid + * @param moles number of moles (per second) of the component to be added to the fluid */ public void addComponent(int index, double moles); @@ -1229,9 +1184,8 @@ public default boolean hasSolidPhase() { * addComponent. * * - * @param index Component number to add - * @param moles number of moles (per second) of the component to be added - * to the fluid + * @param index Component number to add + * @param moles number of moles (per second) of the component to be added to the fluid * @param phaseNumber Number of the phase to add the component to */ public void addComponent(int index, double moles, int phaseNumber); @@ -1241,8 +1195,7 @@ public default boolean hasSolidPhase() { * removeComponent. * * - * @param name Name of the component to remove. See NeqSim database for - * component in the database. + * @param name Name of the component to remove. See NeqSim database for component in the database. */ public void removeComponent(String name); @@ -1269,8 +1222,7 @@ public default boolean hasSolidPhase() { /** *
- * Setter for property beta
. NB! Sets beta = b for first phase and
- * 1-b for second
+ * Setter for property beta
. NB! Sets beta = b for first phase and 1-b for second
* phase, not for multiphase systems.
*
this.phaseIndex[index] = phaseIndex;
*
*
- * @param index a int
+ * @param index a int
* @param phaseIndex a int
*/
public void setPhaseIndex(int index, int phaseIndex);
/**
*
- * Set phaseArray[phaseIndex] = phase
. NB! Transfers the pressure
- * and temperature
+ * Set phaseArray[phaseIndex] = phase
. NB! Transfers the pressure and temperature
* from the currently existing phase object at index numb
*
- * Calculate system beta values using Phase.getNumberOfMolesInPhase and - * getTotalNumberOfMoles. + * Calculate system beta values using Phase.getNumberOfMolesInPhase and getTotalNumberOfMoles. *
*/ public void initBeta(); @@ -2015,7 +1932,7 @@ public double calcBeta() * Change the phase type of a given phase. * * @param phaseToChange the phase number of the phase to set phase type - * @param newPhaseType the phasetype number to set + * @param newPhaseType the phasetype number to set * @deprecated Replaced by {@link setPhaseType} */ @Deprecated @@ -2037,14 +1954,14 @@ public default void setPhaseType(int phaseToChange, String phaseTypeName) { * Change the phase type of a given phase. * * @param phaseToChange the phase number of the phase to set phase type - * @param pt PhaseType to set + * @param pt PhaseType to set */ public void setPhaseType(int phaseToChange, PhaseType pt); /** * Set phase type of all phases. * - * @param phases Set to "all" to set all phases, else nothing happens. + * @param phases Set to "all" to set all phases, else nothing happens. * @param newPhaseType the phasetype number to set * @deprecated Replaced by {@link setAllPhaseType} */ @@ -2268,8 +2185,7 @@ public default ComponentInterface getComponent(int i) { public PhaseInterface getLiquidPhase(); /** - * method to return compressibility factor of a fluid compressibility factor is - * defined in EoS + * method to return compressibility factor of a fluid compressibility factor is defined in EoS * from PV=ZnRT where V is total volume of fluid. * * @return compressibility factor Z @@ -2372,7 +2288,7 @@ public default ComponentInterface getComponent(int i) { * method to return phase fraction of selected phase. * * @param phaseTypeName gas/oil/aqueous - * @param unit mole/volume/weight + * @param unit mole/volume/weight * @return phase: fraction in specified unit */ public double getPhaseFraction(String phaseTypeName, String unit); @@ -2382,9 +2298,9 @@ public default ComponentInterface getComponent(int i) { * getProperty. * * - * @param prop a {@link java.lang.String} object + * @param prop a {@link java.lang.String} object * @param compName a {@link java.lang.String} object - * @param phase a int + * @param phase a int * @return a double */ public double getProperty(String prop, String compName, int phase); @@ -2394,7 +2310,7 @@ public default ComponentInterface getComponent(int i) { * getProperty. * * - * @param prop a {@link java.lang.String} object + * @param prop a {@link java.lang.String} object * @param phase a int * @return a double */ @@ -2674,10 +2590,10 @@ public void setImplementedCompositionDeriativesofFugacity( * addCharacterized. * * - * @param charNames an array of {@link java.lang.String} objects - * @param charFlowrate an array of {@link double} objects - * @param molarMass an array of {@link double} objects - * @param relativedensity an array of {@link double} objects + * @param charNames an array of {@link java.lang.String} objects + * @param charFlowrate an array of {@link double} objects + * @param molarMass an array of {@link double} objects + * @param relativedensity an array of {@link double} objects * @param lastIsPlusFraction True if last fraction is a Plus fraction */ public void addOilFractions(String[] charNames, double[] charFlowrate, double[] molarMass, @@ -2688,12 +2604,12 @@ public void addOilFractions(String[] charNames, double[] charFlowrate, double[] * addCharacterized. * * - * @param charNames an array of {@link java.lang.String} objects - * @param charFlowrate an array of {@link double} objects - * @param molarMass an array of {@link double} objects - * @param relativedensity an array of {@link double} objects - * @param lastIsPlusFraction True if last fraction is a Plus fraction - * @param lumpComponents True if component should be lumped + * @param charNames an array of {@link java.lang.String} objects + * @param charFlowrate an array of {@link double} objects + * @param molarMass an array of {@link double} objects + * @param relativedensity an array of {@link double} objects + * @param lastIsPlusFraction True if last fraction is a Plus fraction + * @param lumpComponents True if component should be lumped * @param numberOfPseudoComponents number of pseudo components */ public void addOilFractions(String[] charNames, double[] charFlowrate, double[] molarMass, @@ -2705,9 +2621,9 @@ public void addOilFractions(String[] charNames, double[] charFlowrate, double[] * addCharacterized. * * - * @param charNames an array of {@link java.lang.String} objects - * @param charFlowrate an array of {@link double} objects - * @param molarMass an array of {@link double} objects + * @param charNames an array of {@link java.lang.String} objects + * @param charFlowrate an array of {@link double} objects + * @param molarMass an array of {@link double} objects * @param relativedensity an array of {@link double} objects */ public void addCharacterized(String[] charNames, double[] charFlowrate, double[] molarMass, diff --git a/src/main/java/neqsim/thermo/system/SystemThermo.java b/src/main/java/neqsim/thermo/system/SystemThermo.java index 849744312..960a20347 100644 --- a/src/main/java/neqsim/thermo/system/SystemThermo.java +++ b/src/main/java/neqsim/thermo/system/SystemThermo.java @@ -731,19 +731,24 @@ public double getFlowRate(String flowunit) { return totalNumberOfMoles * getMolarMass() * 3600.0 / getIdealLiquidDensity("kg/m3"); } else if (flowunit.equals("Sm3/sec")) { return totalNumberOfMoles * ThermodynamicConstantsInterface.R - * ThermodynamicConstantsInterface.standardStateTemperature / 101325.0; + * ThermodynamicConstantsInterface.standardStateTemperature + / ThermodynamicConstantsInterface.atm; } else if (flowunit.equals("Sm3/hr")) { return totalNumberOfMoles * 3600.0 * ThermodynamicConstantsInterface.R - * ThermodynamicConstantsInterface.standardStateTemperature / 101325.0; + * ThermodynamicConstantsInterface.standardStateTemperature + / ThermodynamicConstantsInterface.atm; } else if (flowunit.equals("Sm3/day")) { return totalNumberOfMoles * 3600.0 * 24.0 * ThermodynamicConstantsInterface.R - * ThermodynamicConstantsInterface.standardStateTemperature / 101325.0; + * ThermodynamicConstantsInterface.standardStateTemperature + / ThermodynamicConstantsInterface.atm; } else if (flowunit.equals("MSm3/day")) { return totalNumberOfMoles * 3600.0 * 24.0 * ThermodynamicConstantsInterface.R - * ThermodynamicConstantsInterface.standardStateTemperature / 101325.0 / 1.0e6; + * ThermodynamicConstantsInterface.standardStateTemperature + / ThermodynamicConstantsInterface.atm / 1.0e6; } else if (flowunit.equals("MSm3/hr")) { return totalNumberOfMoles * 3600.0 * ThermodynamicConstantsInterface.R - * ThermodynamicConstantsInterface.standardStateTemperature / 101325.0 / 1.0e6; + * ThermodynamicConstantsInterface.standardStateTemperature + / ThermodynamicConstantsInterface.atm / 1.0e6; } else if (flowunit.equals("mole/sec")) { return totalNumberOfMoles; } else if (flowunit.equals("mole/min")) { @@ -2868,7 +2873,8 @@ public double getDensity(String unit) { conversionFactor = 0.0624279606; break; case "kg/Sm3": - return getMolarMass() * 101325.0 / ThermodynamicConstantsInterface.R + return getMolarMass() * ThermodynamicConstantsInterface.atm + / ThermodynamicConstantsInterface.R / ThermodynamicConstantsInterface.standardStateTemperature; case "mol/m3": conversionFactor = 1.0 / getMolarMass(); diff --git a/src/main/java/neqsim/thermo/util/empiric/BukacekWaterInGas.java b/src/main/java/neqsim/thermo/util/empiric/BukacekWaterInGas.java index 193f0ce95..069591118 100644 --- a/src/main/java/neqsim/thermo/util/empiric/BukacekWaterInGas.java +++ b/src/main/java/neqsim/thermo/util/empiric/BukacekWaterInGas.java @@ -39,7 +39,10 @@ public static double getWaterInGas(double temperature, double pressure) { double ans = mgwaterSm3 / molarMassGas; // mol water /Sm3 gas - double molgasSm3 = 101325.0 / (ThermodynamicConstantsInterface.R * 288.15); // mol gas/ Sm3 + double molgasSm3 = + ThermodynamicConstantsInterface.atm / (ThermodynamicConstantsInterface.R * 288.15); // mol + // gas/ + // Sm3 return ans / molgasSm3; } diff --git a/src/main/java/neqsim/thermo/util/readwrite/EclipseFluidReadWrite.java b/src/main/java/neqsim/thermo/util/readwrite/EclipseFluidReadWrite.java index 4b6771141..009145fc2 100644 --- a/src/main/java/neqsim/thermo/util/readwrite/EclipseFluidReadWrite.java +++ b/src/main/java/neqsim/thermo/util/readwrite/EclipseFluidReadWrite.java @@ -134,9 +134,8 @@ public static SystemInterface read(String inputFile, String pseudoNameIn) { * @return a {@link neqsim.thermo.system.SystemInterface} object */ public static SystemInterface read(String inputFile) { - neqsim.thermo.system.SystemInterface fluid = - new neqsim.thermo.system.SystemSrkEos(288.15, - ThermodynamicConstantsInterface.referencePressure); + neqsim.thermo.system.SystemInterface fluid = new neqsim.thermo.system.SystemSrkEos(288.15, + ThermodynamicConstantsInterface.referencePressure); double[][] kij = null; try (BufferedReader br = new BufferedReader(new FileReader(new File(inputFile)))) { diff --git a/src/main/java/neqsim/util/unit/RateUnit.java b/src/main/java/neqsim/util/unit/RateUnit.java index 15d47b6e1..21bf9714e 100644 --- a/src/main/java/neqsim/util/unit/RateUnit.java +++ b/src/main/java/neqsim/util/unit/RateUnit.java @@ -67,9 +67,11 @@ public double getValue(String tounit) { */ public double getConversionFactor(String name) { double mol_m3 = 0.0; - double mol_Sm3 = 101325.0 / (ThermodynamicConstantsInterface.R * standardStateTemperature); + double mol_Sm3 = ThermodynamicConstantsInterface.atm + / (ThermodynamicConstantsInterface.R * standardStateTemperature); if (boilp < 25) { - mol_m3 = 101325.0 / (ThermodynamicConstantsInterface.R * standardStateTemperature); + mol_m3 = ThermodynamicConstantsInterface.atm + / (ThermodynamicConstantsInterface.R * standardStateTemperature); } else { mol_m3 = 1.0 / (molarmass) * stddens * 1000; } diff --git a/src/test/java/neqsim/processSimulation/util/example/MasstransferMeOH.java b/src/test/java/neqsim/processSimulation/util/example/MasstransferMeOH.java index c462c8e62..eac949222 100644 --- a/src/test/java/neqsim/processSimulation/util/example/MasstransferMeOH.java +++ b/src/test/java/neqsim/processSimulation/util/example/MasstransferMeOH.java @@ -91,8 +91,8 @@ public static void main(String[] args) { // column")).setNumberOfTrays(2); System.out.println( "water in wet gas [kg/MSm3] " + ((Stream) operations.getUnit("water saturated feed gas")) - .getFluid().getPhase(0).getComponent("water").getz() * 1.0e6 * 0.01802 * 101325.0 - / (ThermodynamicConstantsInterface.R * 288.15)); + .getFluid().getPhase(0).getComponent("water").getz() * 1.0e6 * 0.01802 + * ThermodynamicConstantsInterface.atm / (ThermodynamicConstantsInterface.R * 288.15)); // mainMixer.getFluid().display(); // scrubber.getGasOutStream().displayResult(); System.out.println("hydt " + gasFromScrubber.getHydrateEquilibriumTemperature()); diff --git a/src/test/java/neqsim/processSimulation/util/example/TEGdehydrationProcessDistillation.java b/src/test/java/neqsim/processSimulation/util/example/TEGdehydrationProcessDistillation.java index 2474db6b6..a90c0bbe6 100644 --- a/src/test/java/neqsim/processSimulation/util/example/TEGdehydrationProcessDistillation.java +++ b/src/test/java/neqsim/processSimulation/util/example/TEGdehydrationProcessDistillation.java @@ -248,8 +248,8 @@ public static void main(String[] args) { // column")).setNumberOfTrays(2); System.out .println("water in wet gas " + ((Stream) operations.getUnit("water saturated feed gas")) - .getFluid().getPhase(0).getComponent("water").getz() * 1.0e6 * 0.01802 * 101325.0 - / (ThermodynamicConstantsInterface.R * 288.15)); + .getFluid().getPhase(0).getComponent("water").getz() * 1.0e6 * 0.01802 + * ThermodynamicConstantsInterface.atm / (ThermodynamicConstantsInterface.R * 288.15)); System.out.println("water in dry gas " + ((Stream) operations.getUnit("dry gas from absorber")) .getFluid().getPhase(0).getComponent("water").getz() * 1.0e6); System.out.println("reboiler duty (KW) " @@ -260,14 +260,14 @@ public static void main(String[] args) { double waterInWetGasppm = waterSaturatedFeedGas.getFluid().getPhase(0).getComponent("water").getz() * 1.0e6; - double waterInWetGaskgMSm3 = - waterInWetGasppm * 0.01802 * 101325.0 / (ThermodynamicConstantsInterface.R * 288.15); + double waterInWetGaskgMSm3 = waterInWetGasppm * 0.01802 * ThermodynamicConstantsInterface.atm + / (ThermodynamicConstantsInterface.R * 288.15); double TEGfeedwt = TEGFeed.getFluid().getPhase("aqueous").getWtFrac("TEG"); double TEGfeedflw = TEGFeed.getFlowRate("kg/hr"); double waterInDehydratedGasppm = dehydratedGas.getFluid().getPhase(0).getComponent("water").getz() * 1.0e6; - double waterInDryGaskgMSm3 = - waterInDehydratedGasppm * 0.01802 * 101325.0 / (ThermodynamicConstantsInterface.R * 288.15); + double waterInDryGaskgMSm3 = waterInDehydratedGasppm * 0.01802 + * ThermodynamicConstantsInterface.atm / (ThermodynamicConstantsInterface.R * 288.15); double richTEG2 = richTEG.getFluid().getPhase("aqueous").getWtFrac("TEG"); System.out.println("reboiler duty (KW) " + ((Reboiler) column.getReboiler()).getDuty() / 1.0e3); System.out.println("flow rate from reboiler " diff --git a/src/test/java/neqsim/processSimulation/util/example/TEGdehydrationProcessDistillation3.java b/src/test/java/neqsim/processSimulation/util/example/TEGdehydrationProcessDistillation3.java index c776395c1..410031f18 100644 --- a/src/test/java/neqsim/processSimulation/util/example/TEGdehydrationProcessDistillation3.java +++ b/src/test/java/neqsim/processSimulation/util/example/TEGdehydrationProcessDistillation3.java @@ -245,8 +245,8 @@ public static void main(String[] args) { // column")).setNumberOfTrays(2); System.out .println("water in wet gas " + ((Stream) operations.getUnit("water saturated feed gas")) - .getFluid().getPhase(0).getComponent("water").getz() * 1.0e6 * 0.01802 * 101325.0 - / (ThermodynamicConstantsInterface.R * 288.15)); + .getFluid().getPhase(0).getComponent("water").getz() * 1.0e6 * 0.01802 + * ThermodynamicConstantsInterface.atm / (ThermodynamicConstantsInterface.R * 288.15)); System.out.println("water in dry gas " + ((Stream) operations.getUnit("dry gas from absorber")) .getFluid().getPhase(0).getComponent("water").getz() * 1.0e6); System.out.println("reboiler duty (KW) " @@ -257,14 +257,14 @@ public static void main(String[] args) { double waterInWetGasppm = waterSaturatedFeedGas.getFluid().getPhase(0).getComponent("water").getz() * 1.0e6; - double waterInWetGaskgMSm3 = - waterInWetGasppm * 0.01802 * 101325.0 / (ThermodynamicConstantsInterface.R * 288.15); + double waterInWetGaskgMSm3 = waterInWetGasppm * 0.01802 * ThermodynamicConstantsInterface.atm + / (ThermodynamicConstantsInterface.R * 288.15); double TEGfeedwt = TEGFeed.getFluid().getPhase("aqueous").getWtFrac("TEG"); double TEGfeedflw = TEGFeed.getFlowRate("kg/hr"); double waterInDehydratedGasppm = dehydratedGas.getFluid().getPhase(0).getComponent("water").getz() * 1.0e6; - double waterInDryGaskgMSm3 = - waterInDehydratedGasppm * 0.01802 * 101325.0 / (ThermodynamicConstantsInterface.R * 288.15); + double waterInDryGaskgMSm3 = waterInDehydratedGasppm * 0.01802 + * ThermodynamicConstantsInterface.atm / (ThermodynamicConstantsInterface.R * 288.15); double richTEG2 = richTEG.getFluid().getPhase("aqueous").getWtFrac("TEG"); System.out.println("reboiler duty (KW) " + ((Reboiler) column.getReboiler()).getDuty() / 1.0e3); System.out.println("flow rate from reboiler " diff --git a/src/test/java/neqsim/processSimulation/util/example/TEGdehydrationProcessDistillationAaHa.java b/src/test/java/neqsim/processSimulation/util/example/TEGdehydrationProcessDistillationAaHa.java index 6512301d8..957f8841d 100644 --- a/src/test/java/neqsim/processSimulation/util/example/TEGdehydrationProcessDistillationAaHa.java +++ b/src/test/java/neqsim/processSimulation/util/example/TEGdehydrationProcessDistillationAaHa.java @@ -306,9 +306,10 @@ public static void main(String[] args) { /* * System.out.println("water in wet gas " + ((Stream) * operations.getUnit("water saturated feed gas")).getFluid() - * .getPhase(0).getComponent("water").getz() * 1.0e6 * 0.01802 * 101325.0 / - * (ThermodynamicConstantsInterface.R * 288.15)); System.out.println("water in dry gas " + - * ((Stream) operations.getUnit("dry gas from absorber")).getFluid() + * .getPhase(0).getComponent("water").getz() * 1.0e6 * 0.01802 + * *ThermodynamicConstantsInterface.atm / (ThermodynamicConstantsInterface.R * 288.15)); + * System.out.println("water in dry gas " + ((Stream) + * operations.getUnit("dry gas from absorber")).getFluid() * .getPhase(0).getComponent("water").getz() * 1.0e6); System.out.println("reboiler duty (KW) " * + ((Reboiler) ((DistillationColumn) * operations.getUnit("TEG regeneration column")).getReboiler()) .getDuty() / 1.0e3); @@ -318,13 +319,13 @@ public static void main(String[] args) { * * double waterInWetGasppm = * waterSaturatedFeedGas.getFluid().getPhase(0).getComponent("water").getz() * 1.0e6; double - * waterInWetGaskgMSm3 = waterInWetGasppm * 0.01802 * 101325.0 / + * waterInWetGaskgMSm3 = waterInWetGasppm * 0.01802 *ThermodynamicConstantsInterface.atm / * (ThermodynamicConstantsInterface.R * 288.15); double TEGfeedwt = * TEGFeed.getFluid().getPhase("aqueous").getWtFrac("TEG"); double TEGfeedflw = * TEGFeed.getFlowRate("kg/hr"); double waterInDehydratedGasppm = * dehydratedGas.getFluid().getPhase(0).getComponent("water").getz() * 1.0e6; double - * waterInDryGaskgMSm3 = waterInDehydratedGasppm * 0.01802 * 101325.0 / - * (ThermodynamicConstantsInterface.R * 288.15); double richTEG2 = + * waterInDryGaskgMSm3 = waterInDehydratedGasppm * 0.01802 *ThermodynamicConstantsInterface.atm + * / (ThermodynamicConstantsInterface.R * 288.15); double richTEG2 = * richTEG.getFluid().getPhase("aqueous").getWtFrac("TEG"); double temp = * ((Stream)operations.getUnit("feed to TEG absorber")).getFluid().getPhase(0). * getComponent("water").getz()*1.0e6*0.01802*101325.0/(ThermodynamicConstantsInterface.R*288.15 diff --git a/src/test/java/neqsim/processSimulation/util/example/TEGdehydrationProcessDistillationGFA.java b/src/test/java/neqsim/processSimulation/util/example/TEGdehydrationProcessDistillationGFA.java index d1be3eecb..76c44ce6b 100644 --- a/src/test/java/neqsim/processSimulation/util/example/TEGdehydrationProcessDistillationGFA.java +++ b/src/test/java/neqsim/processSimulation/util/example/TEGdehydrationProcessDistillationGFA.java @@ -453,9 +453,10 @@ public static void main(String[] args) { /* * System.out.println("water in wet gas " + ((Stream) * operations.getUnit("water saturated feed gas")).getFluid() - * .getPhase(0).getComponent("water").getz() * 1.0e6 * 0.01802 * 101325.0 / - * (ThermodynamicConstantsInterface.R * 288.15)); System.out.println("water in dry gas " + - * ((Stream) operations.getUnit("dry gas from absorber")).getFluid() + * .getPhase(0).getComponent("water").getz() * 1.0e6 * 0.01802 + * *ThermodynamicConstantsInterface.atm / (ThermodynamicConstantsInterface.R * 288.15)); + * System.out.println("water in dry gas " + ((Stream) + * operations.getUnit("dry gas from absorber")).getFluid() * .getPhase(0).getComponent("water").getz() * 1.0e6); System.out.println("reboiler duty (KW) " * + ((Reboiler) ((DistillationColumn) * operations.getUnit("TEG regeneration column")).getReboiler()) .getDuty() / 1.0e3); @@ -480,13 +481,13 @@ public static void main(String[] args) { /* * double waterInWetGasppm = * waterSaturatedFeedGas.getFluid().getPhase(0).getComponent("water").getz() * 1.0e6; double - * waterInWetGaskgMSm3 = waterInWetGasppm * 0.01802 * 101325.0 / + * waterInWetGaskgMSm3 = waterInWetGasppm * 0.01802 *ThermodynamicConstantsInterface.atm / * (ThermodynamicConstantsInterface.R * 288.15); double TEGfeedwt = * TEGFeed.getFluid().getPhase("aqueous").getWtFrac("TEG"); double TEGfeedflw = * TEGFeed.getFlowRate("kg/hr"); double waterInDehydratedGasppm = * dehydratedGas.getFluid().getPhase(0).getComponent("water").getz() * 1.0e6; double - * waterInDryGaskgMSm3 = waterInDehydratedGasppm * 0.01802 * 101325.0 / - * (ThermodynamicConstantsInterface.R * 288.15); double richTEG2 = + * waterInDryGaskgMSm3 = waterInDehydratedGasppm * 0.01802 *ThermodynamicConstantsInterface.atm + * / (ThermodynamicConstantsInterface.R * 288.15); double richTEG2 = * richTEG.getFluid().getPhase("aqueous").getWtFrac("TEG"); double temp = * ((Stream)operations.getUnit("feed to TEG absorber")).getFluid().getPhase(0).getComponent( * "water").getz()*1.0e6*0.01802*101325.0/(ThermodynamicConstantsInterface.R*288.15); diff --git a/src/test/java/neqsim/thermo/util/example/HydrateFlash.java b/src/test/java/neqsim/thermo/util/example/HydrateFlash.java index 342860f53..29579bbd7 100644 --- a/src/test/java/neqsim/thermo/util/example/HydrateFlash.java +++ b/src/test/java/neqsim/thermo/util/example/HydrateFlash.java @@ -150,7 +150,8 @@ public static void main(String args[]) { // testSystem.display(); // System.out.println("kg vann/MSm^3 gas " + // (testSystem.getPhase(0).getComponent("water").getx() * - // testSystem.getPhase(0).getComponent("water").getMolarMass() * 101325.0 / + // testSystem.getPhase(0).getComponent("water").getMolarMass() + // *ThermodynamicConstantsInterface.atm / // ThermodynamicConstantsInterface.R / 288.15) * 1.0e6); // System.out.println("activity coef water " + // testSystem.getPhase(1).getActivityCoefficientSymetric(1)); diff --git a/src/test/java/neqsim/thermo/util/example/TPflashDehyd.java b/src/test/java/neqsim/thermo/util/example/TPflashDehyd.java index feed0754e..70bd2bf68 100644 --- a/src/test/java/neqsim/thermo/util/example/TPflashDehyd.java +++ b/src/test/java/neqsim/thermo/util/example/TPflashDehyd.java @@ -172,7 +172,7 @@ public static void main(String[] args) { * * * double solubility = testSystem.getPhase(1).getComponent("CO2").getx() * - * ThermodynamicConstantsInterface.R * 298.15 / 101325.0 / + * ThermodynamicConstantsInterface.R * 298.15 /ThermodynamicConstantsInterface.atm / * (testSystem.getPhase(1).getMolarMass()) * 1000; * * System.out.println("selectivity " + seletivity); System.out.println("CO2 solubility " +