From 242679761d6d2799aed2295a5fd18d2d6983f135 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, 17 Jun 2022 23:34:58 +0200 Subject: [PATCH 1/2] refact: split tests in two files --- .../flashOps/TPFlashTest.java | 56 ------------- .../flashOps/TPFlashTestWellFluid.java | 79 +++++++++++++++++++ 2 files changed, 79 insertions(+), 56 deletions(-) create mode 100644 src/test/java/neqsim/thermodynamicOperations/flashOps/TPFlashTestWellFluid.java diff --git a/src/test/java/neqsim/thermodynamicOperations/flashOps/TPFlashTest.java b/src/test/java/neqsim/thermodynamicOperations/flashOps/TPFlashTest.java index 7e4ef4a95a..6ce26e05b3 100644 --- a/src/test/java/neqsim/thermodynamicOperations/flashOps/TPFlashTest.java +++ b/src/test/java/neqsim/thermodynamicOperations/flashOps/TPFlashTest.java @@ -14,7 +14,6 @@ */ class TPFlashTest { - static neqsim.thermo.system.SystemInterface wellFluid = null; static neqsim.thermo.system.SystemInterface testSystem = null; static ThermodynamicOperations testOps = null; @@ -23,42 +22,6 @@ class TPFlashTest { */ @BeforeEach void setUp() throws Exception { - wellFluid = new neqsim.thermo.system.SystemSrkCPAstatoil(273.15 + 30.0, 65.00); - wellFluid.addComponent("oxygen", 0.0); - wellFluid.addComponent("H2S", 0.00008); - wellFluid.addComponent("nitrogen", 0.08); - wellFluid.addComponent("CO2", 3.56); - wellFluid.addComponent("methane", 87.36); - wellFluid.addComponent("ethane", 4.02); - wellFluid.addComponent("propane", 1.54); - wellFluid.addComponent("i-butane", 0.2); - wellFluid.addComponent("n-butane", 0.42); - wellFluid.addComponent("i-pentane", 0.15); - wellFluid.addComponent("n-pentane", 0.20); - - wellFluid.addTBPfraction("C6_Frigg", 0.24, 84.99 / 1000.0, 695.0 / 1000.0); - wellFluid.addTBPfraction("C7_Frigg", 0.34, 97.87 / 1000.0, 718.0 / 1000.0); - wellFluid.addTBPfraction("C8_Frigg", 0.33, 111.54 / 1000.0, 729.0 / 1000.0); - wellFluid.addTBPfraction("C9_Frigg", 0.19, 126.1 / 1000.0, 749.0 / 1000.0); - wellFluid.addTBPfraction("C10_Frigg", 0.15, 140.14 / 1000.0, 760.0 / 1000.0); - wellFluid.addTBPfraction("C11_Frigg", 0.69, 175.0 / 1000.0, 830.0 / 1000.0); - wellFluid.addTBPfraction("C12_Frigg", 0.5, 280.0 / 1000.0, 914.0 / 1000.0); - wellFluid.addTBPfraction("C13_Frigg", 0.103, 560.0 / 1000.0, 980.0 / 1000.0); - - wellFluid.addTBPfraction("C6_ML_WestCtrl", 0.0, 84.0 / 1000.0, 684.0 / 1000.0); - wellFluid.addTBPfraction("C7_ML_WestCtrl", 0.0, 97.9 / 1000.0, 742.0 / 1000.0); - wellFluid.addTBPfraction("C8_ML_WestCtrl", 0.0, 111.5 / 1000.0, 770.0 / 1000.0); - wellFluid.addTBPfraction("C9_ML_WestCtrl", 0.0, 126.1 / 1000.0, 790.0 / 1000.0); - wellFluid.addTBPfraction("C10_ML_WestCtrl", 0.0, 140.14 / 1000.0, 805.0 / 1000.0); - wellFluid.addTBPfraction("C11_ML_WestCtrl", 0.0, 175.0 / 1000.0, 815.0 / 1000.0); - wellFluid.addTBPfraction("C12_ML_WestCtrl", 0.0, 280.0 / 1000.0, 835.0 / 1000.0); - wellFluid.addTBPfraction("C13_ML_WestCtrl", 0.0, 450.0 / 1000.0, 850.0 / 1000.0); - wellFluid.addComponent("water", 12.01); - wellFluid.setMixingRule(10); - wellFluid.init(0); - wellFluid.setMultiPhaseCheck(true); - - // Actually there are two sets of tests in the same file now testSystem = new neqsim.thermo.system.SystemPrEos(243.15, 300.0); testSystem.addComponent("nitrogen", 1.0); testSystem.addComponent("methane", 90.0); @@ -75,25 +38,6 @@ void setUp() throws Exception { testSystem.setMultiPhaseCheck(true); } - @Test - void testTPflashComp1() { - testOps = new ThermodynamicOperations(wellFluid); - testOps.TPflash(); - } - - @Test - void testTPflashComp2() { - wellFluid.setTemperature(339.04); - wellFluid.setPressure(1.5); - wellFluid.setMolarComposition(new double[] {0.0, 4.76579e-6, 1.21459e-5, 1.3409e-3, 3.30439e-2, - 5.06e-3, 7.34e-3, 1.53e-3, 4.11e-3, 1.58e-3, 2.255e-3, 2.8779e-4, 8.58e-4, 8.73e-4, 8.5e-4, - 3.88e-3, 7.36e-2, 1.47e-1, 6.176e-2, 3.69e-2, 7.735e-3, 1.023e-2, 6.19e-3, 4.3e-3, 1.2e-2, - 8.96e-3, 1.539e-3, 5.9921e-1}); - testOps = new ThermodynamicOperations(wellFluid); - testOps.TPflash(); - assertEquals(1.4292538950216407, wellFluid.getPhase(0).getDensity(), 1e-5); - } - void testRun() { testSystem.setMultiPhaseCheck(true); testSystem.setPressure(10.0, "bara"); diff --git a/src/test/java/neqsim/thermodynamicOperations/flashOps/TPFlashTestWellFluid.java b/src/test/java/neqsim/thermodynamicOperations/flashOps/TPFlashTestWellFluid.java new file mode 100644 index 0000000000..3af1b0eeb1 --- /dev/null +++ b/src/test/java/neqsim/thermodynamicOperations/flashOps/TPFlashTestWellFluid.java @@ -0,0 +1,79 @@ +/** + * + */ +package neqsim.thermodynamicOperations.flashOps; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import neqsim.thermodynamicOperations.ThermodynamicOperations; + +/** + * @author ESOL + * + */ +class TPFlashTestWellFluid { + + static neqsim.thermo.system.SystemInterface wellFluid = null; + static ThermodynamicOperations testOps = null; + + /** + * @throws java.lang.Exception + */ + @BeforeEach + void setUp() throws Exception { + wellFluid = new neqsim.thermo.system.SystemSrkCPAstatoil(273.15 + 30.0, 65.00); + wellFluid.addComponent("oxygen", 0.0); + wellFluid.addComponent("H2S", 0.00008); + wellFluid.addComponent("nitrogen", 0.08); + wellFluid.addComponent("CO2", 3.56); + wellFluid.addComponent("methane", 87.36); + wellFluid.addComponent("ethane", 4.02); + wellFluid.addComponent("propane", 1.54); + wellFluid.addComponent("i-butane", 0.2); + wellFluid.addComponent("n-butane", 0.42); + wellFluid.addComponent("i-pentane", 0.15); + wellFluid.addComponent("n-pentane", 0.20); + + wellFluid.addTBPfraction("C6_Frigg", 0.24, 84.99 / 1000.0, 695.0 / 1000.0); + wellFluid.addTBPfraction("C7_Frigg", 0.34, 97.87 / 1000.0, 718.0 / 1000.0); + wellFluid.addTBPfraction("C8_Frigg", 0.33, 111.54 / 1000.0, 729.0 / 1000.0); + wellFluid.addTBPfraction("C9_Frigg", 0.19, 126.1 / 1000.0, 749.0 / 1000.0); + wellFluid.addTBPfraction("C10_Frigg", 0.15, 140.14 / 1000.0, 760.0 / 1000.0); + wellFluid.addTBPfraction("C11_Frigg", 0.69, 175.0 / 1000.0, 830.0 / 1000.0); + wellFluid.addTBPfraction("C12_Frigg", 0.5, 280.0 / 1000.0, 914.0 / 1000.0); + wellFluid.addTBPfraction("C13_Frigg", 0.103, 560.0 / 1000.0, 980.0 / 1000.0); + + wellFluid.addTBPfraction("C6_ML_WestCtrl", 0.0, 84.0 / 1000.0, 684.0 / 1000.0); + wellFluid.addTBPfraction("C7_ML_WestCtrl", 0.0, 97.9 / 1000.0, 742.0 / 1000.0); + wellFluid.addTBPfraction("C8_ML_WestCtrl", 0.0, 111.5 / 1000.0, 770.0 / 1000.0); + wellFluid.addTBPfraction("C9_ML_WestCtrl", 0.0, 126.1 / 1000.0, 790.0 / 1000.0); + wellFluid.addTBPfraction("C10_ML_WestCtrl", 0.0, 140.14 / 1000.0, 805.0 / 1000.0); + wellFluid.addTBPfraction("C11_ML_WestCtrl", 0.0, 175.0 / 1000.0, 815.0 / 1000.0); + wellFluid.addTBPfraction("C12_ML_WestCtrl", 0.0, 280.0 / 1000.0, 835.0 / 1000.0); + wellFluid.addTBPfraction("C13_ML_WestCtrl", 0.0, 450.0 / 1000.0, 850.0 / 1000.0); + wellFluid.addComponent("water", 12.01); + wellFluid.setMixingRule(10); + wellFluid.init(0); + wellFluid.setMultiPhaseCheck(true); + } + + @Test + void testTPflashComp1() { + testOps = new ThermodynamicOperations(wellFluid); + testOps.TPflash(); + } + + @Test + void testTPflashComp2() { + wellFluid.setTemperature(339.04); + wellFluid.setPressure(1.5); + wellFluid.setMolarComposition(new double[] {0.0, 4.76579e-6, 1.21459e-5, 1.3409e-3, 3.30439e-2, + 5.06e-3, 7.34e-3, 1.53e-3, 4.11e-3, 1.58e-3, 2.255e-3, 2.8779e-4, 8.58e-4, 8.73e-4, 8.5e-4, + 3.88e-3, 7.36e-2, 1.47e-1, 6.176e-2, 3.69e-2, 7.735e-3, 1.023e-2, 6.19e-3, 4.3e-3, 1.2e-2, + 8.96e-3, 1.539e-3, 5.9921e-1}); + testOps = new ThermodynamicOperations(wellFluid); + testOps.TPflash(); + assertEquals(1.4292538950216407, wellFluid.getPhase(0).getDensity(), 1e-5); + } +} From 39e0599967d51f25d301d384ef6bd73b23a0b952 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, 19 Jun 2022 19:00:39 +0200 Subject: [PATCH 2/2] refact: move implementation of initThermoProperties --- .../PhysicalPropertiesInterface.java | 2 +- .../neqsim/thermo/system/SystemInterface.java | 4949 ++++++++--------- .../neqsim/thermo/system/SystemThermo.java | 6 - 3 files changed, 2468 insertions(+), 2489 deletions(-) diff --git a/src/main/java/neqsim/physicalProperties/physicalPropertySystem/PhysicalPropertiesInterface.java b/src/main/java/neqsim/physicalProperties/physicalPropertySystem/PhysicalPropertiesInterface.java index da8c2dbbcc..f27feb65ea 100644 --- a/src/main/java/neqsim/physicalProperties/physicalPropertySystem/PhysicalPropertiesInterface.java +++ b/src/main/java/neqsim/physicalProperties/physicalPropertySystem/PhysicalPropertiesInterface.java @@ -219,7 +219,7 @@ public void setMixingRule( /** *

- * init. + * Initialize / calculate all physical properties of object. *

* * @param phase a {@link neqsim.thermo.phase.PhaseInterface} object diff --git a/src/main/java/neqsim/thermo/system/SystemInterface.java b/src/main/java/neqsim/thermo/system/SystemInterface.java index 563b8613a3..46c20a4e0d 100644 --- a/src/main/java/neqsim/thermo/system/SystemInterface.java +++ b/src/main/java/neqsim/thermo/system/SystemInterface.java @@ -15,2488 +15,2473 @@ * @version $Id: $Id */ public interface SystemInterface extends Cloneable, java.io.Serializable { - /** - *

- * saveFluid. - *

- * - * @param ID a int - */ - public void saveFluid(int ID); - - /** - *

- * getComponentNameTag. - *

- * - * @return a {@link java.lang.String} object - */ - public String getComponentNameTag(); - - /** - *

- * setComponentNameTagOnNormalComponents. - *

- * - * @param nameTag a {@link java.lang.String} object - */ - public void setComponentNameTagOnNormalComponents(String nameTag); - - /** - *

- * addPhaseFractionToPhase. - *

- * - * @param fraction a double - * @param specification a {@link java.lang.String} object - * @param fromPhaseName a {@link java.lang.String} object - * @param toPhaseName a {@link java.lang.String} object - */ - public void addPhaseFractionToPhase(double fraction, String specification, String fromPhaseName, - String toPhaseName); - - /** - *

- * addPhaseFractionToPhase. - *

- * - * @param fraction a double - * @param specification a {@link java.lang.String} object - * @param specifiedStream a {@link java.lang.String} object - * @param fromPhaseName a {@link java.lang.String} object - * @param toPhaseName a {@link java.lang.String} object - */ - public void addPhaseFractionToPhase(double fraction, String specification, - String specifiedStream, String fromPhaseName, String toPhaseName); - - /** - *

- * renameComponent. - *

- * - * @param oldName a {@link java.lang.String} object - * @param newName a {@link java.lang.String} object - */ - public void renameComponent(String oldName, String newName); - - /** - *

- * setComponentNameTag. - *

- * - * @param nameTag a {@link java.lang.String} object - */ - public void setComponentNameTag(String nameTag); - - /** - * Add named components to a System. Does nothing if components already exist in - * System. - * - * @param names Names of the components to be added. See NeqSim database for - * available components in the database. - */ - default public void addComponents(String[] names) { - for (int i = 0; i < names.length; i++) { - addComponent(names[i], 0.0); - } + /** + *

+ * saveFluid. + *

+ * + * @param id a int + */ + public void saveFluid(int id); + + /** + *

+ * getComponentNameTag. + *

+ * + * @return a {@link java.lang.String} object + */ + public String getComponentNameTag(); + + /** + *

+ * setComponentNameTagOnNormalComponents. + *

+ * + * @param nameTag a {@link java.lang.String} object + */ + public void setComponentNameTagOnNormalComponents(String nameTag); + + /** + *

+ * addPhaseFractionToPhase. + *

+ * + * @param fraction a double + * @param specification a {@link java.lang.String} object + * @param fromPhaseName a {@link java.lang.String} object + * @param toPhaseName a {@link java.lang.String} object + */ + public void addPhaseFractionToPhase(double fraction, String specification, String fromPhaseName, + String toPhaseName); + + /** + *

+ * addPhaseFractionToPhase. + *

+ * + * @param fraction a double + * @param specification a {@link java.lang.String} object + * @param specifiedStream a {@link java.lang.String} object + * @param fromPhaseName a {@link java.lang.String} object + * @param toPhaseName a {@link java.lang.String} object + */ + public void addPhaseFractionToPhase(double fraction, String specification, String specifiedStream, + String fromPhaseName, String toPhaseName); + + /** + *

+ * renameComponent. + *

+ * + * @param oldName a {@link java.lang.String} object + * @param newName a {@link java.lang.String} object + */ + public void renameComponent(String oldName, String newName); + + /** + *

+ * setComponentNameTag. + *

+ * + * @param nameTag a {@link java.lang.String} object + */ + public void setComponentNameTag(String nameTag); + + /** + * Add named components to a System. Does nothing if components already exist in System. + * + * @param names Names of the components to be added. See NeqSim database for available components + * in the database. + */ + public default void addComponents(String[] names) { + for (int i = 0; i < names.length; i++) { + addComponent(names[i], 0.0); } - - - /** - * Add named components to a System with a number of moles. - * If component already exists, the moles will be added to the component. - * - * @param names Names of the components to be added. See NeqSim database for - * available components in the database. - * @param moles Number of moles to add per component. - */ - default public void addComponents(String[] names, double[] moles) { - for (int i = 0; i < names.length; i++) { - addComponent(names[i], moles[i]); - } - } - - /** - *

- * calcResultTable. - *

- * - * @return an array of {@link java.lang.String} objects - */ - default public String[][] calcResultTable() { - return createTable(""); + } + + + /** + * Add named components to a System with a number of moles. If component already exists, the moles + * will be added to the component. + * + * @param names Names of the components to be added. See NeqSim database for available components + * in the database. + * @param moles Number of moles to add per component. + */ + public default void addComponents(String[] names, double[] moles) { + for (int i = 0; i < names.length; i++) { + addComponent(names[i], moles[i]); } - - /** - * method to return kinematic viscosity in a specified unit - * - * @param unit Supported units are m2/sec - * @return kinematic viscosity in specified unit - */ - public double getKinematicViscosity(String unit); - - /** - *

- * Get number of components added to System. - *

- * - * @return the number of components in System. - */ - public int getNumberOfComponents(); - - /** - * method to get molar mass of a fluid phase - * - * @param unit Supported units are kg/mol, gr/mol - * @return molar mass in specified unit - */ - public double getMolarMass(String unit); - - /** - * This method is used to set the total molar composition of a plus fluid. The total flow rate - * will be kept constant. The input mole fractions will be normalized. - * - * @param molefractions is a double array taking the molar fraction of the components in the - * fluid. THe last molfraction is the mole fraction of the plus component - */ - public void setMolarCompositionPlus(double[] molefractions); - - /** - *

- * saveFluid. - *

- * - * @param ID a int - * @param text a {@link java.lang.String} object - */ - public void saveFluid(int ID, String text); - - /** - * This method is used to set the total molar composition of a characterized fluid. The total - * flow rate will be kept constant. The input mole fractions will be normalized. - * - * @param molefractions is a double array taking the molar fraction of the components in the - * fluid. THe last fraction in the array is the total molefraction of the characterized - * components. - */ - public void setMolarCompositionOfPlusFluid(double[] molefractions); - - /** - * method to get the Joule Thomson Coefficient of a system. Based on a phase - * mole fraction basis - * average - * - * @param unit Supported units are K/bar, C/bar - * @return Joule Thomson coefficient in specified unit - */ - public double getJouleThomsonCoefficient(String unit); - - /** - * method to return exergy in a specified unit - * - * @param temperatureOfSurroundings in Kelvin - * @return exergy in specified unit - * @param exergyUnit a {@link java.lang.String} object - */ - public double getExergy(double temperatureOfSurroundings, String exergyUnit); - - /** - * method to return exergy defined as (h1-T0*s1) in a unit Joule - * - * @param temperatureOfSurroundings in Kelvin - * @return a double - */ - public double getExergy(double temperatureOfSurroundings); - - /** - * method to get the Joule Thomson Coefficient of a system. Based on a phase mole fraction basis - * average - * - * @return Joule Thomson coefficient in K/bar - */ - public double getJouleThomsonCoefficient(); - - /** - * method to return mass of fluid - * - * @param unit Supported units are kg, gr, tons - * @return mass in specified unit - */ - public double getMass(String unit); - - /** - *

- * getMoleFractionsSum. - *

- * - * @return a double - */ - public double getMoleFractionsSum(); - - /** - * 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 - * @return speed of sound in m/s - */ - public double getSoundSpeed(String unit); - - /** - * 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 - */ - public double getSoundSpeed(); - - /** - *

- * removePhaseKeepTotalComposition. - *

- * - * @param specPhase a int - */ - public void removePhaseKeepTotalComposition(int specPhase); - - /** - * Calculates thermodynamic and physical properties of a fluid using initThermoProperties() and - * initPhysicalProperties(); - */ - public void initProperties(); - - /** - * return two fluid added as a new fluid - * - * @param addFluid1 first fluid to add - * @param addFluid2 second fluid o add - * @return new fluid - */ - public static SystemInterface addFluids(SystemInterface addFluid1, SystemInterface addFluid2) { - SystemInterface newFluid = addFluid1.clone(); - newFluid.addFluid(addFluid2); - return newFluid; - } - - /** - *

- * getInterfacialTension. - *

- * - * @param phase1 a int - * @param phase2 a int - * @param unit a {@link java.lang.String} object - * @return a double - */ - public double getInterfacialTension(int phase1, int phase2, String unit); - - /** - * Calculates physical properties of type propertyName - * - * @param propertyName a {@link java.lang.String} object - */ - public void initPhysicalProperties(String propertyName); - - /** - * method to return heat capacity ratio calculated as Cp/(Cp-R) - * - * @return kappa - */ - public double getGamma2(); - - /** - * method to return heat capacity ratio/adiabatic index/Poisson constant - * - * @return kappa - */ - public double getGamma(); - - /** - * method to return fluid volume - * - * @param unit Supported units are m3, litre, m3/kg, m3/mol - * @return volume in specified unit - */ - public double getVolume(String unit); - - /** - * method to return flow rate of fluid - * - * @param flowunit Supported units are kg/sec, kg/min, kg/hr m3/sec, - * m3/min, m3/hr, mole/sec, mole/min, mole/hr, Sm3/hr, Sm3/day - * @return flow rate in specified unit - */ - public double getFlowRate(String flowunit); - - /** - * 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 - */ - public void setPressure(double newPressure, String unit); - - /** - * 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 (Celcius of Kelvin) - */ - public void setTemperature(double newTemperature, String unit); - - /** - * 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 - */ - public double getVolumeFraction(int phaseNumber); - - /** - * 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 - */ - public double getCorrectedVolumeFraction(int phaseNumber); - - /** - *

- * getHeatOfVaporization. - *

- * - * @return a double - */ - public double getHeatOfVaporization(); - - /** - * method to return total enthalpy in a specified unit - * - * - * @param unit Supported units are 'J', 'J/mol', 'J/kg' and 'kJ/kg' - * @return enthalpy in specified unit - */ - public double getEnthalpy(String unit); - - /** - * method to return internal energy (U) in a specified unit - * - * @param unit Supported units are 'J', 'J/mol', 'J/kg' and 'kJ/kg' - * @return enthalpy in specified unit - */ - public double getInternalEnergy(String unit); - - /** - *

- * isForcePhaseTypes. - *

- * - * @return a boolean - */ - public boolean isForcePhaseTypes(); - - /** - *

- * setForcePhaseTypes. - *

- * - * @param forcePhaseTypes a boolean - */ - public void setForcePhaseTypes(boolean forcePhaseTypes); - - /** - * Set the flow rate of all components to zero. - * - * @deprecated use {@link #setEmptyFluid()} instead. - */ - @Deprecated - default public void removeMoles() { - setEmptyFluid(); - } - - /** - * Set the flow rate of all components to zero. - */ - public void setEmptyFluid(); - - /** - *

- * setMolarFlowRates. - *

- * - * @param moles an array of {@link double} objects - */ - public void setMolarFlowRates(double[] moles); - - /** - *

- * setComponentNames. - *

- * - * @param componentNames an array of {@link java.lang.String} objects - */ - public void setComponentNames(String[] componentNames); - - /** - *

- * calc_x_y_nonorm. - *

- */ - public void calc_x_y_nonorm(); - - /** - *

- * saveObjectToFile. - *

- * - * @param filePath a {@link java.lang.String} object - * @param fluidName a {@link java.lang.String} object - */ - public void saveObjectToFile(String filePath, String fluidName); - - /** - *

- * readObjectFromFile. - *

- * - * @param filePath a {@link java.lang.String} object - * @param fluidName a {@link java.lang.String} object - * @return a {@link neqsim.thermo.system.SystemInterface} object - */ - public SystemInterface readObjectFromFile(String filePath, String fluidName); - - /** - *

- * getLiquidVolume. - *

- * - * @return a double - */ - public double getLiquidVolume(); - - /** - *

- * resetPhysicalProperties. - *

- */ - public void resetPhysicalProperties(); - - /** - *

- * phaseToSystem. - *

- * - * @param phaseNumber1 a int - * @param phaseNumber2 a int - * @return a {@link neqsim.thermo.system.SystemInterface} object - */ - public SystemInterface phaseToSystem(int phaseNumber1, int phaseNumber2); - - /** - *

- * changeComponentName. - *

- * - * @param name a {@link java.lang.String} object - * @param newName a {@link java.lang.String} object - */ - public void changeComponentName(String name, String newName); - - /** - *

- * getWaxModel. - *

- * - * @return a {@link neqsim.thermo.characterization.WaxModelInterface} object - */ - public WaxModelInterface getWaxModel(); - - /** - *

- * getWaxCharacterisation. - *

- * - * @return a {@link neqsim.thermo.characterization.WaxCharacterise} object - */ - public neqsim.thermo.characterization.WaxCharacterise getWaxCharacterisation(); - - /** - *

- * phaseToSystem. - *

- * - * @param phaseName a {@link java.lang.String} object - * @return a {@link neqsim.thermo.system.SystemInterface} object - */ - public SystemInterface phaseToSystem(String phaseName); - - /** - * method to get the total molar flow rate of individual components in a fluid - * - * @return molar flow of individual components in unit mol/sec - */ - public double[] getMolarRate(); - - - /** - * Returns true if phase exists and is not null - * - * @param i Phase number - * @return True if phase exists, false if not. - */ - public boolean IsPhase(int i); - - - /** - *

- * getPhase. - *

- * - * @param phaseTypeName a {@link java.lang.String} object - * @return a {@link neqsim.thermo.phase.PhaseInterface} object - */ - public PhaseInterface getPhase(String phaseTypeName); - - /** - *

- * getPhaseIndexOfPhase. - *

- * - * @param phaseTypeName a {@link java.lang.String} object - * @return a int - */ - public int getPhaseIndexOfPhase(String phaseTypeName); - - /** - *

- * setTotalFlowRate. - *

- * - * @param flowRate a double - * @param flowunit a {@link java.lang.String} object - */ - public void setTotalFlowRate(double flowRate, String flowunit); - - /** - *

- * Returns the overall mole composition vector in unit mole fraction - *

- * - * @return an array of {@link double} objects - */ - public double[] getMolarComposition(); - - /** - *

- * getNumberOfOilFractionComponents. - *

- * - * @return a int - */ - public int getNumberOfOilFractionComponents(); - - /** - *

- * setHeavyTBPfractionAsPlusFraction. - *

- * - * @return a boolean - */ - public boolean setHeavyTBPfractionAsPlusFraction(); - - /** - *

- * getCapeOpenProperties11. - *

- * - * @return an array of {@link java.lang.String} objects - */ - public String[] getCapeOpenProperties11(); - - /** - *

- * getCapeOpenProperties10. - *

- * - * @return an array of {@link java.lang.String} objects - */ - public String[] getCapeOpenProperties10(); - - /** - *

- * getLowestGibbsEnergyPhase. - *

- * - * @return a {@link neqsim.thermo.phase.PhaseInterface} object - */ - public PhaseInterface getLowestGibbsEnergyPhase(); - - /** - *

- * getOilFractionNormalBoilingPoints. - *

- * - * @return an array of {@link double} objects - */ - public double[] getOilFractionNormalBoilingPoints(); - - /** - *

- * getOilFractionLiquidDensityAt25C. - *

- * - * @return an array of {@link double} objects - */ - public double[] getOilFractionLiquidDensityAt25C(); - - /** - *

- * getOilFractionMolecularMass. - *

- * - * @return an array of {@link double} objects - */ - public double[] getOilFractionMolecularMass(); - - /** - *

- * getOilFractionIDs. - *

- * - * @return an array of {@link int} objects - */ - public int[] getOilFractionIDs(); - - /** - *

- * getMoleFraction. - *

- * - * @param phaseNumber a int - * @return a double - */ - public double getMoleFraction(int phaseNumber); - - /** - * method to return specific heat capacity (Cv) - * - * @return Cv in unit J/K - */ - public double getCv(); - - /** - * method to return specific heat capacity (Cp) in a specified unit - * - * @param unit Supported units are J/K, J/molK, J/kgK and kJ/kgK - * @return Cp in specified unit - */ - public double getCv(String unit); - - /** - *

- * Getter for property characterization. - *

- * - * @return a {@link neqsim.thermo.characterization.Characterise} object - */ - public neqsim.thermo.characterization.Characterise getCharacterization(); - - /** - *

- * readObject. - *

- * - * @param ID a int - * @return a {@link neqsim.thermo.system.SystemInterface} object - */ - public SystemInterface readObject(int ID); - - /** - *

- * getCompIDs. - *

- * - * @return an array of {@link java.lang.String} objects - */ - public String[] getCompIDs(); - - /** - *

- * isImplementedCompositionDeriativesofFugacity. - *

- * - * @param isImpl a boolean - */ - public void isImplementedCompositionDeriativesofFugacity(boolean isImpl); - - /** - *

- * saveObject. - *

- * - * @param ID a int - * @param text a {@link java.lang.String} object - */ - public void saveObject(int ID, String text); - - /** - * Set mole fractions of all components to 0. - */ - public void reset(); - - /** - *

- * getCASNumbers. - *

- * - * @return an array of {@link java.lang.String} objects - */ - public String[] getCASNumbers(); - - /** - *

- * getMolecularWeights. - *

- * - * @return an array of {@link double} objects - */ - public double[] getMolecularWeights(); - - /** - *

- * getNormalBoilingPointTemperatures. - *

- * - * @return an array of {@link double} objects - */ - public double[] getNormalBoilingPointTemperatures(); - - /** - * Get names of all components in System. - * - * @return an array of {@link java.lang.String} objects - */ - public String[] getCompNames(); - - /** - *

- * getCompFormulaes. - *

- * - * @return an array of {@link java.lang.String} objects - */ - public String[] getCompFormulaes(); - - /** - *

- * getWtFraction. - *

- * - * @param phaseNumber a int - * @return a double - */ - public double getWtFraction(int phaseNumber); - - /** - *

- * isMultiphaseWaxCheck. - *

- * - * @return a boolean - */ - public boolean isMultiphaseWaxCheck(); - - /** - *

- * setMultiphaseWaxCheck. - *

- * - * @param multiphaseWaxCheck a boolean - */ - public void setMultiphaseWaxCheck(boolean multiphaseWaxCheck); - - /** - *

- * 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. - *

- * - * @param moles an array of {@link double} objects - */ - public void setMolarComposition(double[] moles); - - /** - * 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) - * @return a {@link neqsim.thermo.phase.PhaseInterface} object - */ - public PhaseInterface getPhaseOfType(String phaseTypeName); - - /** - *

- * setUseTVasIndependentVariables. - *

- * - * @param useTVasIndependentVariables a boolean - */ - public void setUseTVasIndependentVariables(boolean useTVasIndependentVariables); - - /** - * method to add true boiling point fraction - * - * @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 - */ - public void addTBPfraction(String componentName, double numberOfMoles, double molarMass, - double density); - - /** - *

- * addTBPfraction. - *

- * - * @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 - */ - public void addTBPfraction(String componentName, double numberOfMoles, double molarMass, - double density, double criticalTemperature, double criticalPressure, - double acentricFactor); - - /** - *

- * addPlusFraction. - *

- * - * @param componentName a {@link java.lang.String} object - * @param numberOfMoles a double - * @param molarMass a double - * @param density a double - */ - public void addPlusFraction(String componentName, double numberOfMoles, double molarMass, - double density); - - /** - *

- * addSalt. - *

- * - * @param componentName a {@link java.lang.String} object - * @param value a double - */ - public void addSalt(String componentName, double value); - - /** - *

- * deleteFluidPhase. - *

- * - * @param phase a int - */ - public void deleteFluidPhase(int phase); - - /** - *

- * setBmixType. - *

- * - * @param bmixType a int - */ - public void setBmixType(int bmixType); - - /** - *

- * hasSolidPhase. - *

- * - * @return a boolean - */ - public boolean hasSolidPhase(); - - /** - *

- * addSolidComplexPhase. - *

- * - * @param type a {@link java.lang.String} object - */ - public void addSolidComplexPhase(String type); - - /** - *

- * resetCharacterisation. - *

- */ - public void resetCharacterisation(); - - /** - *

- * getMaxNumberOfPhases. - *

- * - * @return a int - */ - public int getMaxNumberOfPhases(); - - /** - *

- * setMaxNumberOfPhases. - *

- * - * @param maxNumberOfPhases a int - */ - public void setMaxNumberOfPhases(int maxNumberOfPhases); - - /** - *

- * getMixingRuleName. - *

- * - * @return a {@link java.lang.String} object - */ - public java.lang.String getMixingRuleName(); - - /** - *

- * Getter for property modelName. - *

- * - * @return a {@link java.lang.String} object - */ - public java.lang.String getModelName(); - - /** - *

- * tuneModel. - *

- * - * @param model a {@link java.lang.String} object - * @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 name already exists, it will be added to the - * component - * - * @param inComponent a {@link neqsim.thermo.component.ComponentInterface} object - */ - public void addComponent(ComponentInterface inComponent); - - /** - * add a component to a fluid. If component already exists, it will be added to the component - * - * @param name a {@link java.lang.String} object - */ - public void addComponent(String name); - - /** - * add a component to a fluid. If component already exists, it will be added to the component - * - * @param moles number of moles (per second) of the component to be added to the fluid - * @param name a {@link java.lang.String} object - */ - public void addComponent(String name, double moles); - - /** - * add a component to a fluid. If component already exists, it will be added to the component - * - * @param name Name of the component to be added. See NeqSim database for component in the - * database. - * @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 value a double - */ - public void addComponent(String name, double value, String unitName); - - /** - *

- * addComponent. - *

- * - * @param name a {@link java.lang.String} object - * @param moles a double - * @param TC a double - * @param PC a double - * @param acs a double - */ - public void addComponent(String name, double moles, double TC, double PC, double acs); - - /** - * add a component to a fluid. I component already exists, it will be added to the component - * - * @param name Name of the component to be added. 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 the phase 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 - * - * @param name Name of the component to be added. See NeqSim database for component in the - * database. - * @param value rate of the component to be added to the fluid - * @param unitName the unit of the flow rate (eg. mol/sec, kg/sec, etc.) - * @param phaseNumber the phase number of the phase to add the component to - */ - public void addComponent(String name, double value, String unitName, int phaseNumber); - - /** - *

- * addComponent. - *

- * - * @param index a int - * @param moles a double - */ - public void addComponent(int index, double moles); - - /** - *

- * addComponent. - *

- * - * @param index a int - * @param moles a double - * @param phaseNumber a int - */ - public void addComponent(int index, double moles, int phaseNumber); - - /** - *

- * getBeta. - *

- * - * @param phase a int - * @return a double - */ - public double getBeta(int phase); - - /** - *

- * save. - *

- * - * @param name a {@link java.lang.String} object - */ - public void save(String name); - - /** - *

- * setModel. - *

- * - * @param model a {@link java.lang.String} object - * @return a {@link neqsim.thermo.system.SystemInterface} object - */ - public SystemInterface setModel(String model); - - /** - *

- * removeComponent. - *

- * - * @param name a {@link java.lang.String} object - */ - public void removeComponent(String name); - - /** - *

- * setMixingRule. - *

- * - * @param typename a {@link java.lang.String} object - * @param GEmodel a {@link java.lang.String} object - */ - public void setMixingRule(String typename, String GEmodel); - - /** - *

- * normalizeBeta. - *

- */ - public void normalizeBeta(); - - /** - *

- * Indexed getter for property phaseIndex. - *

- * - * @param index a int - * @return a int - */ - public int getPhaseIndex(int index); - - /** - *

- * Setter for property initType. - *

- * - * @param initType a int - */ - public void setInitType(int initType); - - /** - *

- * checkStability. - *

- * - * @param val a boolean - */ - public void checkStability(boolean val); - - /** - *

- * hasPlusFraction. - *

- * - * @return a boolean - */ - public boolean hasPlusFraction(); - - /** - *

- * checkStability. - *

- * - * @return a boolean - */ - public boolean checkStability(); - - /** - *

- * Getter for property initType. - *

- * - * @return a int - */ - public int getInitType(); - - /** - *

- * invertPhaseTypes. - *

- */ - public void invertPhaseTypes(); - - /** - * method to return fluid volume with Peneloux volume correction - * - * @return volume in unit m3 - */ - public double getCorrectedVolume(); - - /** - *

- * readFluid. - *

- * - * @param fluidName a {@link java.lang.String} object - */ - public void readFluid(String fluidName); - - /** - *

- * calcKIJ. - *

- * - * @param ok a boolean - */ - public void calcKIJ(boolean ok); - - /** - *

- * write. - *

- * - * @param name a {@link java.lang.String} object - * @param filename a {@link java.lang.String} object - * @param newfile a boolean - */ - public void write(String name, String filename, boolean newfile); - - /** - *

- * useVolumeCorrection. - *

- * - * @param volcor a boolean - */ - public void useVolumeCorrection(boolean volcor); - - /** - * method to set the mixing rule for the fluid - * - * @param typename a {@link java.lang.String} object - */ - public void setMixingRule(String typename); - - /** - *

- * Getter for property numericDerivatives. - *

- * - * @return a boolean - */ - public boolean isNumericDerivatives(); - - /** - *

- * Setter for property numericDerivatives. - *

- * - * @param numericDerivatives a boolean - */ - public void setNumericDerivatives(boolean numericDerivatives); - - /** - *

- * Getter for property info. - *

- * - * @return a {@link java.lang.String} object - */ - public java.lang.String getFluidInfo(); - - /** - *

- * Setter for property info. - * . - *

- * - * @param info a {@link java.lang.String} object - */ - public void setFluidInfo(java.lang.String info); - - /** - *

- * setPhaseIndex. - *

- * - * @param index a int - * @param phaseIndex a int - */ - public void setPhaseIndex(int index, int phaseIndex); - - /** - *

- * Indexed setter for property phaseIndex. - *

- * - * @param phase a {@link neqsim.thermo.phase.PhaseInterface} object - * @param numb a int - */ - public void setPhase(PhaseInterface phase, int numb); - - /** - * method to read pure component and interaction parameters from the NeqSim database and create - * temporary tables with parameters for active fluid. - * - * @param reset If reset is set to true, new temporary tables with parameters for the added - * components will be created. When parameters are needed (eg. when adding components or - * when setting a mixing rule) it will try to find them in the temporary tables first eg. - * COMPTEMP (for pure component parameters) and INTERTEMP (for interaction parameters). - * If reset is set to false it will not create new temporary tables. If a fluid is - * created with the same components many times, performance improvements will be - * obtained, if temporary tables are created the first time (reset=true), and then the - * same tables is used when creating new fluids with the same temporary tables - * (reset=false) - */ - public void createDatabase(boolean reset); - - /** - *

- * resetDatabase. - *

- */ - public void resetDatabase(); - - /** - *

- * Setter for property solidPhaseCheck. - *

- * - * @param test a boolean - */ - public void setSolidPhaseCheck(boolean test); - - /** - *

- * doSolidPhaseCheck. - *

- * - * @return a boolean - */ - public boolean doSolidPhaseCheck(); - - /** - *

- * Getter for property multiPhaseCheck. - *

- * - * @return a boolean - */ - public boolean doMultiPhaseCheck(); - - /** - * method to specify if calculations should check for more than two fluid phases. - * - * @param doMultiPhaseCheck Specify if the calculations should check for more than two fluid - * phases. Default is two fluid phases (gas and liquid). If set to true the program will - * check for gas and multiple liquid phases (eg. gas-oil-aqueous). - */ - public void setMultiPhaseCheck(boolean doMultiPhaseCheck); - - /** - * Calculate thermodynamic properties of the fluid using the init type set in fluid. - * - * @see getInitType - */ - default public void init() { - this.init(this.getInitType()); - } - - /** - * method to calculate thermodynamic properties of the fluid. The temperature, pressure, number - * of phases and composition of the phases will be used as basis for calculation. - * - * - * @param number - The number can be 0, 1, 2 or 3. 0: Set feed composition for all phases. 1: - * Calculation of density, fugacities and Z-factor 2: 1 + calculation of enthalpy, - * entropy, Cp, Cv, and most other thermodynamic properties 3: 1+2 + Calculation of - * composition derivatives of fugacity coefficients. - */ - public void init(int number); - - /** - * method to calculate thermodynamic properties of the selected phase. The temperature, - * pressure, number of phases and composition of the phase will be used as basis for - * calculation. - * - * @param number - The number can be 0, 1, 2 or 3. 0: Set feed composition. 1: Calculation of - * density, fugacities and Z-factor 2: 1 + calculation of enthalpy, entropy, Cp, Cv, and - * most other thermodynamic properties 3: 1+2 + Calculation of composition derivatives of - * fugacity coefficients. - * @param phase a int - */ - public void init(int number, int phase); - - /** - * initNumeric. - */ - public void initNumeric(); - - /** - * Calculates thermodynamic properties of a fluid using the init(2) method - */ - public void initThermoProperties(); - - /** - *

- * display. - *

- */ - public void display(); - - /** - *

- * addFluid. - *

- * - * @param addSystem a {@link neqsim.thermo.system.SystemInterface} object - * @return SystemInterface - */ - public SystemInterface addFluid(SystemInterface addSystem); - - /** - *

- * display. - *

- * - * @param name a {@link java.lang.String} object - */ - public void display(String name); - - /** - *

- * Getter for property hydrateCheck. - *

- * - * @return a boolean - */ - @Deprecated - public boolean doHydrateCheck(); - - /** - *

- * Getter for property hydrateCheck. - *

- * - * @return a boolean - */ - public boolean getHydrateCheck(); - - /** - *

- * createTable. - *

- * - * @param name a {@link java.lang.String} object - * @return an array of {@link java.lang.String} objects - */ - public String[][] createTable(String name); - - /** - *

- * setHydrateCheck. - *

- * - * @param hydrateCheck a boolean - */ - public void setHydrateCheck(boolean hydrateCheck); - - /** - *

- * calcBeta. - *

- * - * @return a double - * @throws neqsim.util.exception.IsNaNException if any. - * @throws neqsim.util.exception.TooManyIterationsException if any. - */ - public double calcBeta() throws neqsim.util.exception.IsNaNException, - neqsim.util.exception.TooManyIterationsException; - - /** - *

- * setAllComponentsInPhase. - *

- * - * @param phase a int - */ - public void setAllComponentsInPhase(int phase); - - /** - *

- * initTotalNumberOfMoles. - *

- * - * @param change a double - */ - public void initTotalNumberOfMoles(double change); - - /** - *

- * calc_x_y. - *

- */ - public void calc_x_y(); - - /** - *

- * getPhase. - *

- * - * @param i a int - * @return a {@link neqsim.thermo.phase.PhaseInterface} object - */ - public PhaseInterface getPhase(int i); - - /** - *

- * reset_x_y. - *

- */ - public void reset_x_y(); - - /** - *

- * isChemicalSystem. - *

- * - * @param temp a boolean - */ - public void isChemicalSystem(boolean temp); - - /** - *

- * addPhase. - *

- */ - public void addPhase(); - - /** - *

- * setAttractiveTerm. - *

- * - * @param i a int - */ - public void setAttractiveTerm(int i); - - /** - *

- * setBeta. - *

- * - * @param phase a int - * @param b a double - */ - public void setBeta(int phase, double b); - - /** - *

- * removePhase. - *

- * - * @param specPhase a int - */ - public void removePhase(int specPhase); - - /** - *

- * phaseToSystem. - *

- * - * @param newPhase a {@link neqsim.thermo.phase.PhaseInterface} object - * @return a {@link neqsim.thermo.system.SystemInterface} object - */ - public SystemInterface phaseToSystem(PhaseInterface newPhase); - - /** - *

- * method to set the temperature of a fluid (same temperature for all phases) - *

- * - * @param temp a double - */ - public void setTemperature(double temp); - - /** - *

- * setTemperature. - *

- * - * @param newTemperature a double - * @param phaseNumber a int - */ - public void setTemperature(double newTemperature, int phaseNumber); - // public void setPressure(double newPressure, int phaseNumber); - - /** - * method to set the pressure of a fluid (same pressure for all phases) - * - * @param pres pressure in unit bara (absolute pressure in bar) - */ - public void setPressure(double pres); - - /** - * method to return pressure - * - * @return pressure in unit bara - */ - public double getPressure(); - - /** - * method to return pressure in a specified unit - * - * @param unit Supported units are bara, barg, Pa and MPa - * @return pressure in specified unit - */ - public double getPressure(String unit); - - /** - *

- * reInitPhaseType. - *

- */ - public void reInitPhaseType(); - - /** - * specify the type for the physical properties you want to use. - * Type - * 0 Orginal/default - * 1 Water - * 2 Glycol - * 3 Amine - * - * @param type a int - */ - public void setPhysicalPropertyModel(int type); - - /** - *

- * clearAll. - *

- */ - public void clearAll(); - - /** - *

- * method to return pressure of phase - *

- * - * @param phaseNumber a int - * @return a double - */ - public double getPressure(int phaseNumber); - - /** - * method to get density of a fluid note: without Peneloux volume correction - * - * @return density with unit kg/m3 - */ - public double getDensity(); - - /** - * method to get density of a fluid note: with Peneloux volume correction - * - * @param unit Supported units are kg/m3, mol/m3 - * @return density in specified unit - */ - public double getDensity(String unit); - - /** - * method to return fluid volume - * - * @return volume in unit m3*1e5 - */ - public double getVolume(); - - /** - *

- * getChemicalReactionOperations. - *

- * - * @return a {@link neqsim.chemicalReactions.ChemicalReactionOperations} object - */ - public ChemicalReactionOperations getChemicalReactionOperations(); - - /** - *

- * isChemicalSystem. - *

- * - * @return a boolean - */ - public boolean isChemicalSystem(); - - /** - * method to return molar volume of the fluid note: without Peneloux volume correction - * - * @return molar volume volume in unit m3/mol*1e5 - */ - public double getMolarVolume(); - - /** - * method to get the total molar mass of a fluid - * - * @return molar mass in unit kg/mol - */ - public double getMolarMass(); - - /** - * method to get the total enthalpy of a fluid - * - * @return molar mass in unit J (Joule) - */ - public double getEnthalpy(); - - /** - *

- * calcInterfaceProperties. - *

- */ - public void calcInterfaceProperties(); - - /** - *

- * getInterphaseProperties. - *

- * - * @return a {@link neqsim.physicalProperties.interfaceProperties.InterphasePropertiesInterface} - * object - */ - public InterphasePropertiesInterface getInterphaseProperties(); - - /** - *

- * initBeta. - *

- * - * @return a double - */ - public double initBeta(); - - /** - *

- * init_x_y. - *

- */ - public void init_x_y(); - - /** - * method to return total entropy of the fluid - * - * @return entropy in unit J/K (Joule/Kelvin) - */ - public double getEntropy(); - - /** - * method to return total entropy of the fluid - * - * @param unit unit supported units are J/K, J/molK, J/kgK and kJ/kgK - * @return entropy in specified unit - */ - public double getEntropy(String unit); - - /** - * method to return temperature - * - * @return temperature in unit Kelvin - */ - public double getTemperature(); - - /** - * method to return temperature in a specified unit - * - * @param unit Supported units are K, C, R - * @return temperature in specified unit - */ - public double getTemperature(String unit); - - /** - *

- * getTemperature. - *

- * - * @param phaseNumber a int - * @return a double - */ - public double getTemperature(int phaseNumber); - - /** - *

- * getBeta. - *

- * - * @return a double - */ - public double getBeta(); - - /** - *

- * chemicalReactionInit. - *

- */ - public void chemicalReactionInit(); - - /** - * Init physical properties for all phases and interfaces. - */ - public void initPhysicalProperties(); - - /** - *

- * setBeta. - *

- * - * @param b a double - */ - public void setBeta(double b); - // public double getdfugdt(int i, int j); - - /** - *

- * method to set the phase type of a given phase - *

- * - * @param phaseToChange a int - * @param newPhaseType a int - */ - public void setPhaseType(int phaseToChange, int newPhaseType); - - /** - *

- * setNumberOfPhases. - *

- * - * @param number a int - */ - public void setNumberOfPhases(int number); - - /** - *

- * getTC. - *

- * - * @return a double - */ - public double getTC(); - - /** - *

- * getPC. - *

- * - * @return a double - */ - public double getPC(); - - /** - *

- * setTC. - *

- * - * @param TC a double - */ - public void setTC(double TC); - - /** - *

- * setPC. - *

- * - * @param PC a double - */ - public void setPC(double PC); - - /** - *

- * getPhases. - *

- * - * @return an array of {@link neqsim.thermo.phase.PhaseInterface} objects - */ - public PhaseInterface[] getPhases(); - - /** - *

- * getNumberOfPhases. - *

- * - * @return a int - */ - public int getNumberOfPhases(); - - /** - *

- * getGibbsEnergy. - *

- * - * @return a double - */ - public double getGibbsEnergy(); - - /** - * method to return internal energy (U) in unit J - * - * @return internal energy in unit Joule (J) - */ - public double getInternalEnergy(); - - /** - *

- * getHelmholtzEnergy. - *

- * - * @return a double - */ - public double getHelmholtzEnergy(); - - /** - *

- * getComponent. - *

- * - * @param name a {@link java.lang.String} object - * @return a {@link neqsim.thermo.component.ComponentInterface} object - */ - public ComponentInterface getComponent(String name); - - /** - *

- * getComponent. - *

- * - * @param number a int - * @return a {@link neqsim.thermo.component.ComponentInterface} object - */ - public ComponentInterface getComponent(int number); - - /** - *

- * getNumberOfMoles. - *

- * - * @return a double - */ - public double getNumberOfMoles(); - - /** - *

- * clone. - *

- * - * @return a {@link neqsim.thermo.system.SystemInterface} object - */ - public SystemInterface clone(); - - /** - * method to set mixing rule used for the fluid - * - * @param type The type of mixing rule to be used for the fluid. 1 - classic mixing rule with - * all kij set to zero 2 -classic mixing rule with kij from NeqSim database 3- classic - * mixing rule with temperature dependent kij 4- Huron Vidal mixing rule with parameters - * from NeqSim database 7 -classic mixing rule with kij of CPA from NeqSim Database 9 - * -classicmixing rule with temperature dependent kij of CPA from NeqSim database - * 10-classic mixing rule with temperature and composition dependent kij of CPA from - * NeqSim database - */ - public void setMixingRule(int type); - - /** - *

- * getComponentNames. - *

- * - * @return an array of {@link java.lang.String} objects - */ - public String[] getComponentNames(); - - /** - *

- * getdVdPtn. - *

- * - * @return a double - */ - public double getdVdPtn(); - - /** - *

- * getdVdTpn. - *

- * - * @return a double - */ - public double getdVdTpn(); - - /** - * method to return specific heat capacity (Cp) - * - * @return Cp in unit J/K - */ - public double getCp(); - - /** - * method to return specific heat capacity (Cp) in a specified unit - * - * @param unit Supported units are J/K, J/molK, J/kgK and kJ/kgK - * @return Cp in specified unit - */ - public double getCp(String unit); - - /** - * method to return heat capacity ratio/adiabatic index/Poisson constant - * - * @return kappa - */ - public double getKappa(); - - /** - *

- * replacePhase. - *

- * - * @param repPhase a int - * @param newPhase a {@link neqsim.thermo.phase.PhaseInterface} object - */ - public void replacePhase(int repPhase, PhaseInterface newPhase); - - /** - *

- * getGasPhase. - *

- * - * @return a {@link neqsim.thermo.phase.PhaseInterface} object - */ - public PhaseInterface getGasPhase(); - - /** - *

- * getLiquidPhase. - *

- * - * @return a {@link neqsim.thermo.phase.PhaseInterface} object - */ - public PhaseInterface getLiquidPhase(); - - /** - * 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 - */ - public double getZ(); - - /** - * method to return viscosity of a fluid - * - * @return viscosity in unit kg/msec - */ - public double getViscosity(); - - /** - * method to return viscosity in a specified unit - * - * @param unit Supported units are kg/msec, cP (centipoise) - * @return viscosity in specified unit - */ - public double getViscosity(String unit); - - /** - * method to return thermal conductivity - * - * @return conductivity in unit W/mK - * @deprecated use {@link #getThermalConductivity()} instead. - */ - @Deprecated - public double getConductivity(); - - /** - * method to return thermal conductivity in a specified unit - * - * @param unit Supported units are W/mK, W/cmK - * @return conductivity in specified unit - * @deprecated use {@link #getThermalConductivity(String unit)} instead. - */ - @Deprecated - public double getConductivity(String unit); - - /** - * method to return conductivity of a fluid - * - * @return conductivity in unit W/mK - */ - public double getThermalConductivity(); - - /** - * method to return thermal conductivity in a specified unit - * - * @param unit Supported units are W/mK, W/cmK - * @return conductivity in specified unit - */ - public double getThermalConductivity(String unit); - - /** - * 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 - * will return NaN - */ - public double getInterfacialTension(String phase1, String phase2); - - /** - * method to return interfacial tension between two phases - * - * @param phase1 phase number of phase1 - * @param phase2 phase number of phase2 - * @return interfacial tension with unit N/m - */ - public double getInterfacialTension(int phase1, int phase2); - - /** - *

- * getKinematicViscosity. - *

- * - * @return a double - */ - public double getKinematicViscosity(); - - /** - *

- * initRefPhases. - *

- */ - public void initRefPhases(); - - /** - *

- * getFluidName. - *

- * - * @return a {@link java.lang.String} object - */ - public java.lang.String getFluidName(); - - /** - *

- * setFluidName. - *

- * - * @param fluidName a {@link java.lang.String} object - */ - public void setFluidName(java.lang.String fluidName); - - /** - *

- * setSolidPhaseCheck. - *

- * - * @param solidComponent a {@link java.lang.String} object - */ - public void setSolidPhaseCheck(String solidComponent); - - /** - *

- * Getter for property allowPhaseShift. - *

- * - * @return a boolean - */ - public boolean allowPhaseShift(); - - /** - *

- * Setter for property allowPhaseShift. - *

- * - * @param allowPhaseShift a boolean - */ - public void allowPhaseShift(boolean allowPhaseShift); - - /** - * method to return phase fraction of selected phase - * - * @param phaseTypeName: gas/oil/aqueous - * @param unit: mole/volume/weight - * @return phase: fraction in specified unit - */ - public double getPhaseFraction(String phaseTypeName, String unit); - - /** - *

- * setPhaseType. - *

- * - * @param phases a {@link java.lang.String} object - * @param newPhaseType a int - */ - public void setPhaseType(String phases, int newPhaseType); - - /** - * method to set the phase type of a given phase - * - * @param phaseToChange the phase number of the phase to set phase type - * @param phaseTypeName the phase type name (valid names are gas or liquid) - */ - public void setPhaseType(int phaseToChange, String phaseTypeName); - - - /** - *

- * getProperty. - *

- * - * @param prop a {@link java.lang.String} object - * @param compName a {@link java.lang.String} object - * @param phase a int - * @return a double - */ - public double getProperty(String prop, String compName, int phase); - - /** - *

- * getProperty. - *

- * - * @param prop a {@link java.lang.String} object - * @param phase a int - * @return a double - */ - public double getProperty(String prop, int phase); - - /** - *

- * getProperty. - *

- * - * @param prop a {@link java.lang.String} object - * @return a double - */ - public double getProperty(String prop); - - /** - *

- * Getter for property standard. - *

- * - * @return a {@link neqsim.standards.StandardInterface} object - */ - public neqsim.standards.StandardInterface getStandard(); - - /** - *

- * Getter for property standard. - *

- * - * @param standardName a {@link java.lang.String} object - * @return a {@link neqsim.standards.StandardInterface} object - */ - public neqsim.standards.StandardInterface getStandard(String standardName); - - /** - *

- * Setter for property standard. - *

- * - * @param standardName a {@link java.lang.String} object - */ - public void setStandard(String standardName); - - /** - *

- * saveToDataBase. - *

- */ - public void saveToDataBase(); - - /** - *

- * generatePDF. - *

- */ - public neqsim.dataPresentation.iTextPDF.PdfCreator generatePDF(); - - /** - *

- * displayPDF. - *

- */ - default public void displayPDF() { - generatePDF().openPDF(); - } - - /** - *

- * getMixingRule. - *

- * - * @return a int - */ - public int getMixingRule(); - - /** - *

- * getResultTable. - *

- * - * @return an array of {@link java.lang.String} objects - */ - public String[][] getResultTable(); - - /** - *

- * autoSelectModel. - *

- * - * @return a {@link neqsim.thermo.system.SystemInterface} object - */ - public SystemInterface autoSelectModel(); - - /** - *

- * autoSelectMixingRule. - *

- */ - public void autoSelectMixingRule(); - - /** - * Order phases by density. - */ - public void orderByDensity(); - - /** - *

- * addLiquidToGas. - *

- * - * @param fraction a double - */ - public void addLiquidToGas(double fraction); - - /** - *

- * addGasToLiquid. - *

- * - * @param fraction a double - */ - public void addGasToLiquid(double fraction); - - /** - * method to get the total molar flow rate of a fluid - * - * @return molar flow in unit mol/sec - */ - public double getTotalNumberOfMoles(); - - /** - *

- * setTotalNumberOfMoles. - *

- * - * @param totalNumberOfMoles a double - */ - public void setTotalNumberOfMoles(double totalNumberOfMoles); - - /** - *

- * phaseToSystem. - *

- * - * @param phaseNumber a int - * @return a {@link neqsim.thermo.system.SystemInterface} object - */ - public SystemInterface phaseToSystem(int phaseNumber); - - /** - *

- * hasPhaseType. - *

- * - * @param phaseTypeName a {@link java.lang.String} object - * @return a boolean - */ - public boolean hasPhaseType(String phaseTypeName); - - /** - *

- * getPhaseNumberOfPhase. - *

- * - * @param phaseTypeName a {@link java.lang.String} object - * @return a int - */ - public int getPhaseNumberOfPhase(String phaseTypeName); - - /** - *

- * getEmptySystemClone. - *

- * - * @return a {@link neqsim.thermo.system.SystemInterface} object - */ - public SystemInterface getEmptySystemClone(); - - /** - *

- * calcHenrysConstant. - *

- * - * @param component a {@link java.lang.String} object - * @return a double - */ - public double calcHenrysConstant(String component); - - /** - *

- * isImplementedTemperatureDeriativesofFugacity. - *

- * - * @return a boolean - */ - public boolean isImplementedTemperatureDeriativesofFugacity(); - - /** - *

- * setImplementedTemperatureDeriativesofFugacity. - *

- * - * @param implementedTemperatureDeriativesofFugacity a boolean - */ - public void setImplementedTemperatureDeriativesofFugacity( - boolean implementedTemperatureDeriativesofFugacity); - - /** - *

- * isImplementedPressureDeriativesofFugacity. - *

- * - * @return a boolean - */ - public boolean isImplementedPressureDeriativesofFugacity(); - - /** - *

- * setImplementedPressureDeriativesofFugacity. - *

- * - * @param implementedPressureDeriativesofFugacity a boolean - */ - public void setImplementedPressureDeriativesofFugacity( - boolean implementedPressureDeriativesofFugacity); - - /** - *

- * isImplementedCompositionDeriativesofFugacity. - *

- * - * @return a boolean - */ - public boolean isImplementedCompositionDeriativesofFugacity(); - - /** - *

- * setImplementedCompositionDeriativesofFugacity. - *

- * - * @param implementedCompositionDeriativesofFugacity a boolean - */ - public void setImplementedCompositionDeriativesofFugacity( - boolean implementedCompositionDeriativesofFugacity); - - /** - *

- * addCapeOpenProperty. - *

- * - * @param propertyName a {@link java.lang.String} object - */ - public void addCapeOpenProperty(String propertyName); - - /** - * Get physical properties of System. - * - * @return System properties - */ - public SystemProperties getProperties(); - - /** {@inheritDoc} */ - @Override - public boolean equals(Object o); - - /** {@inheritDoc} */ - @Override - public int hashCode(); - - /** {@inheritDoc} */ - public void addToComponentNames(java.lang.String name); + } + + /** + *

+ * calcResultTable. + *

+ * + * @return an array of {@link java.lang.String} objects + */ + public default String[][] calcResultTable() { + return createTable(""); + } + + /** + * method to return kinematic viscosity in a specified unit. + * + * @param unit Supported units are m2/sec + * @return kinematic viscosity in specified unit + */ + public double getKinematicViscosity(String unit); + + /** + *

+ * Get number of components added to System. + *

+ * + * @return the number of components in System. + */ + public int getNumberOfComponents(); + + /** + * method to get molar mass of a fluid phase. + * + * @param unit Supported units are kg/mol, gr/mol + * @return molar mass in specified unit + */ + public double getMolarMass(String unit); + + /** + * This method is used to set the total molar composition of a plus fluid. The total flow rate + * will be kept constant. The input mole fractions will be normalized. + * + * @param molefractions is a double array taking the molar fraction of the components in the + * fluid. THe last molfraction is the mole fraction of the plus component + */ + public void setMolarCompositionPlus(double[] molefractions); + + /** + *

+ * saveFluid. + *

+ * + * @param id a int + * @param text a {@link java.lang.String} object + */ + public void saveFluid(int id, String text); + + /** + * This method is used to set the total molar composition of a characterized fluid. The total flow + * rate will be kept constant. The input mole fractions will be normalized. + * + * @param molefractions is a double array taking the molar fraction of the components in the + * fluid. THe last fraction in the array is the total molefraction of the characterized + * components. + */ + public void setMolarCompositionOfPlusFluid(double[] molefractions); + + /** + * method to get the Joule Thomson Coefficient of a system. Based on a phase mole fraction basis + * average. + * + * @param unit Supported units are K/bar, C/bar + * @return Joule Thomson coefficient in specified unit + */ + public double getJouleThomsonCoefficient(String unit); + + /** + * method to return exergy in a specified unit. + * + * @param temperatureOfSurroundings in Kelvin + * @return exergy in specified unit + * @param exergyUnit a {@link java.lang.String} object + */ + public double getExergy(double temperatureOfSurroundings, String exergyUnit); + + /** + * method to return exergy defined as (h1-T0*s1) in a unit Joule. + * + * @param temperatureOfSurroundings in Kelvin + * @return a double + */ + public double getExergy(double temperatureOfSurroundings); + + /** + * method to get the Joule Thomson Coefficient of a system. Based on a phase mole fraction basis + * average + * + * @return Joule Thomson coefficient in K/bar + */ + public double getJouleThomsonCoefficient(); + + /** + * method to return mass of fluid. + * + * @param unit Supported units are kg, gr, tons + * @return mass in specified unit + */ + public double getMass(String unit); + + /** + *

+ * getMoleFractionsSum. + *

+ * + * @return a double + */ + public double getMoleFractionsSum(); + + /** + * 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 + * @return speed of sound in m/s + */ + public double getSoundSpeed(String unit); + + /** + * 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 + */ + public double getSoundSpeed(); + + /** + *

+ * removePhaseKeepTotalComposition. + *

+ * + * @param specPhase a int + */ + public void removePhaseKeepTotalComposition(int specPhase); + + /** + * Calculates thermodynamic and physical properties of a fluid using initThermoProperties() and + * initPhysicalProperties(). + */ + public void initProperties(); + + /** + * return two fluid added as a new fluid. + * + * @param addFluid1 first fluid to add + * @param addFluid2 second fluid o add + * @return new fluid + */ + public static SystemInterface addFluids(SystemInterface addFluid1, SystemInterface addFluid2) { + SystemInterface newFluid = addFluid1.clone(); + newFluid.addFluid(addFluid2); + return newFluid; + } + + /** + *

+ * getInterfacialTension. + *

+ * + * @param phase1 a int + * @param phase2 a int + * @param unit a {@link java.lang.String} object + * @return a double + */ + public double getInterfacialTension(int phase1, int phase2, String unit); + + /** + * Calculates physical properties of type propertyName. + * + * @param propertyName a {@link java.lang.String} object + */ + public void initPhysicalProperties(String propertyName); + + /** + * method to return heat capacity ratio calculated as Cp/(Cp-R). + * + * @return kappa + */ + public double getGamma2(); + + /** + * method to return heat capacity ratio/adiabatic index/Poisson constant. + * + * @return kappa + */ + public double getGamma(); + + /** + * method to return fluid volume. + * + * @param unit Supported units are m3, litre, m3/kg, m3/mol + * @return volume in specified unit + */ + public double getVolume(String unit); + + /** + * method to return flow rate of fluid. + * + * @param flowunit Supported units are kg/sec, kg/min, kg/hr m3/sec, m3/min, m3/hr, mole/sec, + * mole/min, mole/hr, Sm3/hr, Sm3/day + * @return flow rate in specified unit + */ + public double getFlowRate(String flowunit); + + /** + * 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 + */ + public void setPressure(double newPressure, String unit); + + /** + * 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 (Celcius of Kelvin) + */ + public void setTemperature(double newTemperature, String unit); + + /** + * 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 + */ + public double getVolumeFraction(int phaseNumber); + + /** + * 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 + */ + public double getCorrectedVolumeFraction(int phaseNumber); + + /** + *

+ * getHeatOfVaporization. + *

+ * + * @return a double + */ + public double getHeatOfVaporization(); + + /** + * method to return total enthalpy in a specified unit. + * + * @param unit Supported units are 'J', 'J/mol', 'J/kg' and 'kJ/kg' + * @return enthalpy in specified unit + */ + public double getEnthalpy(String unit); + + /** + * method to return internal energy (U) in a specified unit. + * + * @param unit Supported units are 'J', 'J/mol', 'J/kg' and 'kJ/kg' + * @return enthalpy in specified unit + */ + public double getInternalEnergy(String unit); + + /** + *

+ * isForcePhaseTypes. + *

+ * + * @return a boolean + */ + public boolean isForcePhaseTypes(); + + /** + *

+ * setForcePhaseTypes. + *

+ * + * @param forcePhaseTypes a boolean + */ + public void setForcePhaseTypes(boolean forcePhaseTypes); + + /** + * Set the flow rate of all components to zero. + * + * @deprecated use {@link #setEmptyFluid()} instead. + */ + @Deprecated + public default void removeMoles() { + setEmptyFluid(); + } + + /** + * Set the flow rate of all components to zero. + */ + public void setEmptyFluid(); + + /** + *

+ * setMolarFlowRates. + *

+ * + * @param moles an array of {@link double} objects + */ + public void setMolarFlowRates(double[] moles); + + /** + *

+ * setComponentNames. + *

+ * + * @param componentNames an array of {@link java.lang.String} objects + */ + public void setComponentNames(String[] componentNames); + + /** + *

+ * calc_x_y_nonorm. + *

+ */ + public void calc_x_y_nonorm(); + + /** + *

+ * saveObjectToFile. + *

+ * + * @param filePath a {@link java.lang.String} object + * @param fluidName a {@link java.lang.String} object + */ + public void saveObjectToFile(String filePath, String fluidName); + + /** + *

+ * readObjectFromFile. + *

+ * + * @param filePath a {@link java.lang.String} object + * @param fluidName a {@link java.lang.String} object + * @return a {@link neqsim.thermo.system.SystemInterface} object + */ + public SystemInterface readObjectFromFile(String filePath, String fluidName); + + /** + *

+ * getLiquidVolume. + *

+ * + * @return a double + */ + public double getLiquidVolume(); + + /** + *

+ * resetPhysicalProperties. + *

+ */ + public void resetPhysicalProperties(); + + /** + *

+ * phaseToSystem. + *

+ * + * @param phaseNumber1 a int + * @param phaseNumber2 a int + * @return a {@link neqsim.thermo.system.SystemInterface} object + */ + public SystemInterface phaseToSystem(int phaseNumber1, int phaseNumber2); + + /** + *

+ * changeComponentName. + *

+ * + * @param name a {@link java.lang.String} object + * @param newName a {@link java.lang.String} object + */ + public void changeComponentName(String name, String newName); + + /** + *

+ * getWaxModel. + *

+ * + * @return a {@link neqsim.thermo.characterization.WaxModelInterface} object + */ + public WaxModelInterface getWaxModel(); + + /** + *

+ * getWaxCharacterisation. + *

+ * + * @return a {@link neqsim.thermo.characterization.WaxCharacterise} object + */ + public neqsim.thermo.characterization.WaxCharacterise getWaxCharacterisation(); + + /** + *

+ * phaseToSystem. + *

+ * + * @param phaseName a {@link java.lang.String} object + * @return a {@link neqsim.thermo.system.SystemInterface} object + */ + public SystemInterface phaseToSystem(String phaseName); + + /** + * method to get the total molar flow rate of individual components in a fluid + * + * @return molar flow of individual components in unit mol/sec + */ + public double[] getMolarRate(); + + + /** + * Returns true if phase exists and is not null + * + * @param i Phase number + * @return True if phase exists, false if not. + */ + public boolean IsPhase(int i); + + + /** + *

+ * getPhase. + *

+ * + * @param phaseTypeName a {@link java.lang.String} object + * @return a {@link neqsim.thermo.phase.PhaseInterface} object + */ + public PhaseInterface getPhase(String phaseTypeName); + + /** + *

+ * getPhaseIndexOfPhase. + *

+ * + * @param phaseTypeName a {@link java.lang.String} object + * @return a int + */ + public int getPhaseIndexOfPhase(String phaseTypeName); + + /** + *

+ * setTotalFlowRate. + *

+ * + * @param flowRate a double + * @param flowunit a {@link java.lang.String} object + */ + public void setTotalFlowRate(double flowRate, String flowunit); + + /** + *

+ * Returns the overall mole composition vector in unit mole fraction + *

+ * + * @return an array of {@link double} objects + */ + public double[] getMolarComposition(); + + /** + *

+ * getNumberOfOilFractionComponents. + *

+ * + * @return a int + */ + public int getNumberOfOilFractionComponents(); + + /** + *

+ * setHeavyTBPfractionAsPlusFraction. + *

+ * + * @return a boolean + */ + public boolean setHeavyTBPfractionAsPlusFraction(); + + /** + *

+ * getCapeOpenProperties11. + *

+ * + * @return an array of {@link java.lang.String} objects + */ + public String[] getCapeOpenProperties11(); + + /** + *

+ * getCapeOpenProperties10. + *

+ * + * @return an array of {@link java.lang.String} objects + */ + public String[] getCapeOpenProperties10(); + + /** + *

+ * getLowestGibbsEnergyPhase. + *

+ * + * @return a {@link neqsim.thermo.phase.PhaseInterface} object + */ + public PhaseInterface getLowestGibbsEnergyPhase(); + + /** + *

+ * getOilFractionNormalBoilingPoints. + *

+ * + * @return an array of {@link double} objects + */ + public double[] getOilFractionNormalBoilingPoints(); + + /** + *

+ * getOilFractionLiquidDensityAt25C. + *

+ * + * @return an array of {@link double} objects + */ + public double[] getOilFractionLiquidDensityAt25C(); + + /** + *

+ * getOilFractionMolecularMass. + *

+ * + * @return an array of {@link double} objects + */ + public double[] getOilFractionMolecularMass(); + + /** + *

+ * getOilFractionIDs. + *

+ * + * @return an array of {@link int} objects + */ + public int[] getOilFractionIDs(); + + /** + *

+ * getMoleFraction. + *

+ * + * @param phaseNumber a int + * @return a double + */ + public double getMoleFraction(int phaseNumber); + + /** + * method to return specific heat capacity (Cv) + * + * @return Cv in unit J/K + */ + public double getCv(); + + /** + * method to return specific heat capacity (Cp) in a specified unit + * + * @param unit Supported units are J/K, J/molK, J/kgK and kJ/kgK + * @return Cp in specified unit + */ + public double getCv(String unit); + + /** + *

+ * Getter for property characterization. + *

+ * + * @return a {@link neqsim.thermo.characterization.Characterise} object + */ + public neqsim.thermo.characterization.Characterise getCharacterization(); + + /** + *

+ * readObject. + *

+ * + * @param ID a int + * @return a {@link neqsim.thermo.system.SystemInterface} object + */ + public SystemInterface readObject(int ID); + + /** + *

+ * getCompIDs. + *

+ * + * @return an array of {@link java.lang.String} objects + */ + public String[] getCompIDs(); + + /** + *

+ * isImplementedCompositionDeriativesofFugacity. + *

+ * + * @param isImpl a boolean + */ + public void isImplementedCompositionDeriativesofFugacity(boolean isImpl); + + /** + *

+ * saveObject. + *

+ * + * @param ID a int + * @param text a {@link java.lang.String} object + */ + public void saveObject(int ID, String text); + + /** + * Set mole fractions of all components to 0. + */ + public void reset(); + + /** + *

+ * getCASNumbers. + *

+ * + * @return an array of {@link java.lang.String} objects + */ + public String[] getCASNumbers(); + + /** + *

+ * getMolecularWeights. + *

+ * + * @return an array of {@link double} objects + */ + public double[] getMolecularWeights(); + + /** + *

+ * getNormalBoilingPointTemperatures. + *

+ * + * @return an array of {@link double} objects + */ + public double[] getNormalBoilingPointTemperatures(); + + /** + * Get names of all components in System. + * + * @return an array of {@link java.lang.String} objects + */ + public String[] getCompNames(); + + /** + *

+ * getCompFormulaes. + *

+ * + * @return an array of {@link java.lang.String} objects + */ + public String[] getCompFormulaes(); + + /** + *

+ * getWtFraction. + *

+ * + * @param phaseNumber a int + * @return a double + */ + public double getWtFraction(int phaseNumber); + + /** + *

+ * isMultiphaseWaxCheck. + *

+ * + * @return a boolean + */ + public boolean isMultiphaseWaxCheck(); + + /** + *

+ * setMultiphaseWaxCheck. + *

+ * + * @param multiphaseWaxCheck a boolean + */ + public void setMultiphaseWaxCheck(boolean multiphaseWaxCheck); + + /** + *

+ * 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. + *

+ * + * @param moles an array of {@link double} objects + */ + public void setMolarComposition(double[] moles); + + /** + * 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) + * @return a {@link neqsim.thermo.phase.PhaseInterface} object + */ + public PhaseInterface getPhaseOfType(String phaseTypeName); + + /** + *

+ * setUseTVasIndependentVariables. + *

+ * + * @param useTVasIndependentVariables a boolean + */ + public void setUseTVasIndependentVariables(boolean useTVasIndependentVariables); + + /** + * method to add true boiling point fraction + * + * @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 + */ + public void addTBPfraction(String componentName, double numberOfMoles, double molarMass, + double density); + + /** + *

+ * addTBPfraction. + *

+ * + * @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 + */ + public void addTBPfraction(String componentName, double numberOfMoles, double molarMass, + double density, double criticalTemperature, double criticalPressure, double acentricFactor); + + /** + *

+ * addPlusFraction. + *

+ * + * @param componentName a {@link java.lang.String} object + * @param numberOfMoles a double + * @param molarMass a double + * @param density a double + */ + public void addPlusFraction(String componentName, double numberOfMoles, double molarMass, + double density); + + /** + *

+ * addSalt. + *

+ * + * @param componentName a {@link java.lang.String} object + * @param value a double + */ + public void addSalt(String componentName, double value); + + /** + *

+ * deleteFluidPhase. + *

+ * + * @param phase a int + */ + public void deleteFluidPhase(int phase); + + /** + *

+ * setBmixType. + *

+ * + * @param bmixType a int + */ + public void setBmixType(int bmixType); + + /** + *

+ * hasSolidPhase. + *

+ * + * @return a boolean + */ + public boolean hasSolidPhase(); + + /** + *

+ * addSolidComplexPhase. + *

+ * + * @param type a {@link java.lang.String} object + */ + public void addSolidComplexPhase(String type); + + /** + *

+ * resetCharacterisation. + *

+ */ + public void resetCharacterisation(); + + /** + *

+ * getMaxNumberOfPhases. + *

+ * + * @return a int + */ + public int getMaxNumberOfPhases(); + + /** + *

+ * setMaxNumberOfPhases. + *

+ * + * @param maxNumberOfPhases a int + */ + public void setMaxNumberOfPhases(int maxNumberOfPhases); + + /** + *

+ * getMixingRuleName. + *

+ * + * @return a {@link java.lang.String} object + */ + public java.lang.String getMixingRuleName(); + + /** + *

+ * Getter for property modelName. + *

+ * + * @return a {@link java.lang.String} object + */ + public java.lang.String getModelName(); + + /** + *

+ * tuneModel. + *

+ * + * @param model a {@link java.lang.String} object + * @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 name already exists, it will be added to the component + * + * @param inComponent a {@link neqsim.thermo.component.ComponentInterface} object + */ + public void addComponent(ComponentInterface inComponent); + + /** + * add a component to a fluid. If component already exists, it will be added to the component + * + * @param name a {@link java.lang.String} object + */ + public void addComponent(String name); + + /** + * add a component to a fluid. If component already exists, it will be added to the component + * + * @param moles number of moles (per second) of the component to be added to the fluid + * @param name a {@link java.lang.String} object + */ + public void addComponent(String name, double moles); + + /** + * add a component to a fluid. If component already exists, it will be added to the component + * + * @param name Name of the component to be added. See NeqSim database for component in the + * database. + * @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 value a double + */ + public void addComponent(String name, double value, String unitName); + + /** + *

+ * addComponent. + *

+ * + * @param name a {@link java.lang.String} object + * @param moles a double + * @param TC a double + * @param PC a double + * @param acs a double + */ + public void addComponent(String name, double moles, double TC, double PC, double acs); + + /** + * add a component to a fluid. I component already exists, it will be added to the component + * + * @param name Name of the component to be added. 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 the phase 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 + * + * @param name Name of the component to be added. See NeqSim database for component in the + * database. + * @param value rate of the component to be added to the fluid + * @param unitName the unit of the flow rate (eg. mol/sec, kg/sec, etc.) + * @param phaseNumber the phase number of the phase to add the component to + */ + public void addComponent(String name, double value, String unitName, int phaseNumber); + + /** + *

+ * addComponent. + *

+ * + * @param index a int + * @param moles a double + */ + public void addComponent(int index, double moles); + + /** + *

+ * addComponent. + *

+ * + * @param index a int + * @param moles a double + * @param phaseNumber a int + */ + public void addComponent(int index, double moles, int phaseNumber); + + /** + *

+ * getBeta. + *

+ * + * @param phase a int + * @return a double + */ + public double getBeta(int phase); + + /** + *

+ * save. + *

+ * + * @param name a {@link java.lang.String} object + */ + public void save(String name); + + /** + *

+ * setModel. + *

+ * + * @param model a {@link java.lang.String} object + * @return a {@link neqsim.thermo.system.SystemInterface} object + */ + public SystemInterface setModel(String model); + + /** + *

+ * removeComponent. + *

+ * + * @param name a {@link java.lang.String} object + */ + public void removeComponent(String name); + + /** + *

+ * setMixingRule. + *

+ * + * @param typename a {@link java.lang.String} object + * @param GEmodel a {@link java.lang.String} object + */ + public void setMixingRule(String typename, String GEmodel); + + /** + *

+ * normalizeBeta. + *

+ */ + public void normalizeBeta(); + + /** + *

+ * Indexed getter for property phaseIndex. + *

+ * + * @param index a int + * @return a int + */ + public int getPhaseIndex(int index); + + /** + *

+ * Setter for property initType. + *

+ * + * @param initType a int + */ + public void setInitType(int initType); + + /** + *

+ * checkStability. + *

+ * + * @param val a boolean + */ + public void checkStability(boolean val); + + /** + *

+ * hasPlusFraction. + *

+ * + * @return a boolean + */ + public boolean hasPlusFraction(); + + /** + *

+ * checkStability. + *

+ * + * @return a boolean + */ + public boolean checkStability(); + + /** + *

+ * Getter for property initType. + *

+ * + * @return a int + */ + public int getInitType(); + + /** + *

+ * invertPhaseTypes. + *

+ */ + public void invertPhaseTypes(); + + /** + * method to return fluid volume with Peneloux volume correction + * + * @return volume in unit m3 + */ + public double getCorrectedVolume(); + + /** + *

+ * readFluid. + *

+ * + * @param fluidName a {@link java.lang.String} object + */ + public void readFluid(String fluidName); + + /** + *

+ * calcKIJ. + *

+ * + * @param ok a boolean + */ + public void calcKIJ(boolean ok); + + /** + *

+ * write. + *

+ * + * @param name a {@link java.lang.String} object + * @param filename a {@link java.lang.String} object + * @param newfile a boolean + */ + public void write(String name, String filename, boolean newfile); + + /** + *

+ * useVolumeCorrection. + *

+ * + * @param volcor a boolean + */ + public void useVolumeCorrection(boolean volcor); + + /** + * method to set the mixing rule for the fluid + * + * @param typename a {@link java.lang.String} object + */ + public void setMixingRule(String typename); + + /** + *

+ * Getter for property numericDerivatives. + *

+ * + * @return a boolean + */ + public boolean isNumericDerivatives(); + + /** + *

+ * Setter for property numericDerivatives. + *

+ * + * @param numericDerivatives a boolean + */ + public void setNumericDerivatives(boolean numericDerivatives); + + /** + *

+ * Getter for property info. + *

+ * + * @return a {@link java.lang.String} object + */ + public java.lang.String getFluidInfo(); + + /** + *

+ * Setter for property info. . + *

+ * + * @param info a {@link java.lang.String} object + */ + public void setFluidInfo(java.lang.String info); + + /** + *

+ * setPhaseIndex. + *

+ * + * @param index a int + * @param phaseIndex a int + */ + public void setPhaseIndex(int index, int phaseIndex); + + /** + *

+ * Indexed setter for property phaseIndex. + *

+ * + * @param phase a {@link neqsim.thermo.phase.PhaseInterface} object + * @param numb a int + */ + public void setPhase(PhaseInterface phase, int numb); + + /** + * method to read pure component and interaction parameters from the NeqSim database and create + * temporary tables with parameters for active fluid. + * + * @param reset If reset is set to true, new temporary tables with parameters for the added + * components will be created. When parameters are needed (eg. when adding components or + * when setting a mixing rule) it will try to find them in the temporary tables first eg. + * COMPTEMP (for pure component parameters) and INTERTEMP (for interaction parameters). If + * reset is set to false it will not create new temporary tables. If a fluid is created + * with the same components many times, performance improvements will be obtained, if + * temporary tables are created the first time (reset=true), and then the same tables is + * used when creating new fluids with the same temporary tables (reset=false) + */ + public void createDatabase(boolean reset); + + /** + *

+ * resetDatabase. + *

+ */ + public void resetDatabase(); + + /** + *

+ * Setter for property solidPhaseCheck. + *

+ * + * @param test a boolean + */ + public void setSolidPhaseCheck(boolean test); + + /** + *

+ * doSolidPhaseCheck. + *

+ * + * @return a boolean + */ + public boolean doSolidPhaseCheck(); + + /** + *

+ * Getter for property multiPhaseCheck. + *

+ * + * @return a boolean + */ + public boolean doMultiPhaseCheck(); + + /** + * method to specify if calculations should check for more than two fluid phases. + * + * @param doMultiPhaseCheck Specify if the calculations should check for more than two fluid + * phases. Default is two fluid phases (gas and liquid). If set to true the program will + * check for gas and multiple liquid phases (eg. gas-oil-aqueous). + */ + public void setMultiPhaseCheck(boolean doMultiPhaseCheck); + + /** + * Calculate thermodynamic properties of the fluid using the init type set in fluid. + * + * @see getInitType + */ + public default void init() { + this.init(this.getInitType()); + } + + /** + * method to calculate thermodynamic properties of the fluid. The temperature, pressure, number of + * phases and composition of the phases will be used as basis for calculation. + * + * + * @param number - The number can be 0, 1, 2 or 3. 0: Set feed composition for all phases. 1: + * Calculation of density, fugacities and Z-factor 2: 1 + calculation of enthalpy, entropy, + * Cp, Cv, and most other thermodynamic properties 3: 1+2 + Calculation of composition + * derivatives of fugacity coefficients. + */ + public void init(int number); + + /** + * method to calculate thermodynamic properties of the selected phase. The temperature, pressure, + * number of phases and composition of the phase will be used as basis for calculation. + * + * @param number - The number can be 0, 1, 2 or 3. 0: Set feed composition. 1: Calculation of + * density, fugacities and Z-factor 2: 1 + calculation of enthalpy, entropy, Cp, Cv, and + * most other thermodynamic properties 3: 1+2 + Calculation of composition derivatives of + * fugacity coefficients. + * @param phase a int + */ + public void init(int number, int phase); + + + /** + * Calculates thermodynamic properties of a fluid using the init(2) method. + */ + public default void initThermoProperties() { + init(2); + } + + /** + * initNumeric. + */ + public void initNumeric(); + + /** + *

+ * display. + *

+ */ + public void display(); + + /** + *

+ * addFluid. + *

+ * + * @param addSystem a {@link neqsim.thermo.system.SystemInterface} object + * @return SystemInterface + */ + public SystemInterface addFluid(SystemInterface addSystem); + + /** + *

+ * display. + *

+ * + * @param name a {@link java.lang.String} object + */ + public void display(String name); + + /** + *

+ * Getter for property hydrateCheck. + *

+ * + * @return a boolean + */ + @Deprecated + public boolean doHydrateCheck(); + + /** + *

+ * Getter for property hydrateCheck. + *

+ * + * @return a boolean + */ + public boolean getHydrateCheck(); + + /** + *

+ * createTable. + *

+ * + * @param name a {@link java.lang.String} object + * @return an array of {@link java.lang.String} objects + */ + public String[][] createTable(String name); + + /** + *

+ * setHydrateCheck. + *

+ * + * @param hydrateCheck a boolean + */ + public void setHydrateCheck(boolean hydrateCheck); + + /** + *

+ * calcBeta. + *

+ * + * @return a double + * @throws neqsim.util.exception.IsNaNException if any. + * @throws neqsim.util.exception.TooManyIterationsException if any. + */ + public double calcBeta() + throws neqsim.util.exception.IsNaNException, neqsim.util.exception.TooManyIterationsException; + + /** + *

+ * setAllComponentsInPhase. + *

+ * + * @param phase a int + */ + public void setAllComponentsInPhase(int phase); + + /** + *

+ * initTotalNumberOfMoles. + *

+ * + * @param change a double + */ + public void initTotalNumberOfMoles(double change); + + /** + *

+ * calc_x_y. + *

+ */ + public void calc_x_y(); + + /** + * Get phase number i from SystemInterface object. + * + * @param i a int + * @return a {@link neqsim.thermo.phase.PhaseInterface} object + */ + public PhaseInterface getPhase(int i); + + /** + *

+ * reset_x_y. + *

+ */ + public void reset_x_y(); + + /** + *

+ * isChemicalSystem. + *

+ * + * @param temp a boolean + */ + public void isChemicalSystem(boolean temp); + + /** + * Add phase to SystemInterface object. + */ + public void addPhase(); + + /** + *

+ * setAttractiveTerm. + *

+ * + * @param i a int + */ + public void setAttractiveTerm(int i); + + /** + *

+ * setBeta. + *

+ * + * @param phase a int + * @param b a double + */ + public void setBeta(int phase, double b); + + /** + *

+ * removePhase. + *

+ * + * @param specPhase a int + */ + public void removePhase(int specPhase); + + /** + *

+ * phaseToSystem. + *

+ * + * @param newPhase a {@link neqsim.thermo.phase.PhaseInterface} object + * @return a {@link neqsim.thermo.system.SystemInterface} object + */ + public SystemInterface phaseToSystem(PhaseInterface newPhase); + + /** + *

+ * method to set the temperature of a fluid (same temperature for all phases) + *

+ * + * @param temp a double + */ + public void setTemperature(double temp); + + /** + *

+ * setTemperature. + *

+ * + * @param newTemperature a double + * @param phaseNumber a int + */ + public void setTemperature(double newTemperature, int phaseNumber); + // public void setPressure(double newPressure, int phaseNumber); + + /** + * method to set the pressure of a fluid (same pressure for all phases) + * + * @param pres pressure in unit bara (absolute pressure in bar) + */ + public void setPressure(double pres); + + /** + * method to return pressure + * + * @return pressure in unit bara + */ + public double getPressure(); + + /** + * method to return pressure in a specified unit + * + * @param unit Supported units are bara, barg, Pa and MPa + * @return pressure in specified unit + */ + public double getPressure(String unit); + + /** + *

+ * reInitPhaseType. + *

+ */ + public void reInitPhaseType(); + + /** + * specify the type for the physical properties you want to use. Type 0 Orginal/default 1 Water 2 + * Glycol 3 Amine + * + * @param type a int + */ + public void setPhysicalPropertyModel(int type); + + /** + *

+ * clearAll. + *

+ */ + public void clearAll(); + + /** + *

+ * method to return pressure of phase + *

+ * + * @param phaseNumber a int + * @return a double + */ + public double getPressure(int phaseNumber); + + /** + * method to get density of a fluid note: without Peneloux volume correction + * + * @return density with unit kg/m3 + */ + public double getDensity(); + + /** + * method to get density of a fluid note: with Peneloux volume correction + * + * @param unit Supported units are kg/m3, mol/m3 + * @return density in specified unit + */ + public double getDensity(String unit); + + /** + * method to return fluid volume + * + * @return volume in unit m3*1e5 + */ + public double getVolume(); + + /** + *

+ * getChemicalReactionOperations. + *

+ * + * @return a {@link neqsim.chemicalReactions.ChemicalReactionOperations} object + */ + public ChemicalReactionOperations getChemicalReactionOperations(); + + /** + *

+ * isChemicalSystem. + *

+ * + * @return a boolean + */ + public boolean isChemicalSystem(); + + /** + * method to return molar volume of the fluid note: without Peneloux volume correction + * + * @return molar volume volume in unit m3/mol*1e5 + */ + public double getMolarVolume(); + + /** + * method to get the total molar mass of a fluid + * + * @return molar mass in unit kg/mol + */ + public double getMolarMass(); + + /** + * method to get the total enthalpy of a fluid + * + * @return molar mass in unit J (Joule) + */ + public double getEnthalpy(); + + /** + *

+ * calcInterfaceProperties. + *

+ */ + public void calcInterfaceProperties(); + + /** + *

+ * getInterphaseProperties. + *

+ * + * @return a {@link neqsim.physicalProperties.interfaceProperties.InterphasePropertiesInterface} + * object + */ + public InterphasePropertiesInterface getInterphaseProperties(); + + /** + *

+ * initBeta. + *

+ * + * @return a double + */ + public double initBeta(); + + /** + *

+ * init_x_y. + *

+ */ + public void init_x_y(); + + /** + * method to return total entropy of the fluid + * + * @return entropy in unit J/K (Joule/Kelvin) + */ + public double getEntropy(); + + /** + * method to return total entropy of the fluid + * + * @param unit unit supported units are J/K, J/molK, J/kgK and kJ/kgK + * @return entropy in specified unit + */ + public double getEntropy(String unit); + + /** + * method to return temperature + * + * @return temperature in unit Kelvin + */ + public double getTemperature(); + + /** + * method to return temperature in a specified unit + * + * @param unit Supported units are K, C, R + * @return temperature in specified unit + */ + public double getTemperature(String unit); + + /** + *

+ * getTemperature. + *

+ * + * @param phaseNumber a int + * @return a double + */ + public double getTemperature(int phaseNumber); + + /** + *

+ * getBeta. + *

+ * + * @return a double + */ + public double getBeta(); + + /** + *

+ * chemicalReactionInit. + *

+ */ + public void chemicalReactionInit(); + + /** + * Init physical properties for all phases and interfaces. + */ + public void initPhysicalProperties(); + + /** + *

+ * setBeta. + *

+ * + * @param b a double + */ + public void setBeta(double b); + // public double getdfugdt(int i, int j); + + /** + *

+ * method to set the phase type of a given phase + *

+ * + * @param phaseToChange a int + * @param newPhaseType a int + */ + public void setPhaseType(int phaseToChange, int newPhaseType); + + /** + *

+ * setNumberOfPhases. + *

+ * + * @param number a int + */ + public void setNumberOfPhases(int number); + + /** + *

+ * getTC. + *

+ * + * @return a double + */ + public double getTC(); + + /** + *

+ * getPC. + *

+ * + * @return a double + */ + public double getPC(); + + /** + *

+ * setTC. + *

+ * + * @param TC a double + */ + public void setTC(double TC); + + /** + *

+ * setPC. + *

+ * + * @param PC a double + */ + public void setPC(double PC); + + /** + *

+ * getPhases. + *

+ * + * @return an array of {@link neqsim.thermo.phase.PhaseInterface} objects + */ + public PhaseInterface[] getPhases(); + + /** + *

+ * getNumberOfPhases. + *

+ * + * @return a int + */ + public int getNumberOfPhases(); + + /** + *

+ * getGibbsEnergy. + *

+ * + * @return a double + */ + public double getGibbsEnergy(); + + /** + * method to return internal energy (U) in unit J + * + * @return internal energy in unit Joule (J) + */ + public double getInternalEnergy(); + + /** + *

+ * getHelmholtzEnergy. + *

+ * + * @return a double + */ + public double getHelmholtzEnergy(); + + /** + *

+ * getComponent. + *

+ * + * @param name a {@link java.lang.String} object + * @return a {@link neqsim.thermo.component.ComponentInterface} object + */ + public ComponentInterface getComponent(String name); + + /** + *

+ * getComponent. + *

+ * + * @param number a int + * @return a {@link neqsim.thermo.component.ComponentInterface} object + */ + public ComponentInterface getComponent(int number); + + /** + *

+ * getNumberOfMoles. + *

+ * + * @return a double + */ + public double getNumberOfMoles(); + + /** + *

+ * clone. + *

+ * + * @return a {@link neqsim.thermo.system.SystemInterface} object + */ + public SystemInterface clone(); + + /** + * method to set mixing rule used for the fluid + * + * @param type The type of mixing rule to be used for the fluid. 1 - classic mixing rule with all + * kij set to zero 2 -classic mixing rule with kij from NeqSim database 3- classic mixing + * rule with temperature dependent kij 4- Huron Vidal mixing rule with parameters from + * NeqSim database 7 -classic mixing rule with kij of CPA from NeqSim Database 9 + * -classicmixing rule with temperature dependent kij of CPA from NeqSim database + * 10-classic mixing rule with temperature and composition dependent kij of CPA from NeqSim + * database + */ + public void setMixingRule(int type); + + /** + *

+ * getComponentNames. + *

+ * + * @return an array of {@link java.lang.String} objects + */ + public String[] getComponentNames(); + + /** + *

+ * getdVdPtn. + *

+ * + * @return a double + */ + public double getdVdPtn(); + + /** + *

+ * getdVdTpn. + *

+ * + * @return a double + */ + public double getdVdTpn(); + + /** + * method to return specific heat capacity (Cp) + * + * @return Cp in unit J/K + */ + public double getCp(); + + /** + * method to return specific heat capacity (Cp) in a specified unit + * + * @param unit Supported units are J/K, J/molK, J/kgK and kJ/kgK + * @return Cp in specified unit + */ + public double getCp(String unit); + + /** + * method to return heat capacity ratio/adiabatic index/Poisson constant + * + * @return kappa + */ + public double getKappa(); + + /** + *

+ * replacePhase. + *

+ * + * @param repPhase a int + * @param newPhase a {@link neqsim.thermo.phase.PhaseInterface} object + */ + public void replacePhase(int repPhase, PhaseInterface newPhase); + + /** + *

+ * getGasPhase. + *

+ * + * @return a {@link neqsim.thermo.phase.PhaseInterface} object + */ + public PhaseInterface getGasPhase(); + + /** + *

+ * getLiquidPhase. + *

+ * + * @return a {@link neqsim.thermo.phase.PhaseInterface} object + */ + public PhaseInterface getLiquidPhase(); + + /** + * 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 + */ + public double getZ(); + + /** + * method to return viscosity of a fluid + * + * @return viscosity in unit kg/msec + */ + public double getViscosity(); + + /** + * method to return viscosity in a specified unit + * + * @param unit Supported units are kg/msec, cP (centipoise) + * @return viscosity in specified unit + */ + public double getViscosity(String unit); + + /** + * method to return thermal conductivity + * + * @return conductivity in unit W/mK + * @deprecated use {@link #getThermalConductivity()} instead. + */ + @Deprecated + public double getConductivity(); + + /** + * method to return thermal conductivity in a specified unit + * + * @param unit Supported units are W/mK, W/cmK + * @return conductivity in specified unit + * @deprecated use {@link #getThermalConductivity(String unit)} instead. + */ + @Deprecated + public double getConductivity(String unit); + + /** + * method to return conductivity of a fluid + * + * @return conductivity in unit W/mK + */ + public double getThermalConductivity(); + + /** + * method to return thermal conductivity in a specified unit + * + * @param unit Supported units are W/mK, W/cmK + * @return conductivity in specified unit + */ + public double getThermalConductivity(String unit); + + /** + * 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 + * will return NaN + */ + public double getInterfacialTension(String phase1, String phase2); + + /** + * method to return interfacial tension between two phases + * + * @param phase1 phase number of phase1 + * @param phase2 phase number of phase2 + * @return interfacial tension with unit N/m + */ + public double getInterfacialTension(int phase1, int phase2); + + /** + *

+ * getKinematicViscosity. + *

+ * + * @return a double + */ + public double getKinematicViscosity(); + + /** + *

+ * initRefPhases. + *

+ */ + public void initRefPhases(); + + /** + *

+ * getFluidName. + *

+ * + * @return a {@link java.lang.String} object + */ + public java.lang.String getFluidName(); + + /** + *

+ * setFluidName. + *

+ * + * @param fluidName a {@link java.lang.String} object + */ + public void setFluidName(java.lang.String fluidName); + + /** + *

+ * setSolidPhaseCheck. + *

+ * + * @param solidComponent a {@link java.lang.String} object + */ + public void setSolidPhaseCheck(String solidComponent); + + /** + *

+ * Getter for property allowPhaseShift. + *

+ * + * @return a boolean + */ + public boolean allowPhaseShift(); + + /** + *

+ * Setter for property allowPhaseShift. + *

+ * + * @param allowPhaseShift a boolean + */ + public void allowPhaseShift(boolean allowPhaseShift); + + /** + * method to return phase fraction of selected phase + * + * @param phaseTypeName: gas/oil/aqueous + * @param unit: mole/volume/weight + * @return phase: fraction in specified unit + */ + public double getPhaseFraction(String phaseTypeName, String unit); + + /** + *

+ * setPhaseType. + *

+ * + * @param phases a {@link java.lang.String} object + * @param newPhaseType a int + */ + public void setPhaseType(String phases, int newPhaseType); + + /** + * method to set the phase type of a given phase + * + * @param phaseToChange the phase number of the phase to set phase type + * @param phaseTypeName the phase type name (valid names are gas or liquid) + */ + public void setPhaseType(int phaseToChange, String phaseTypeName); + + + /** + *

+ * getProperty. + *

+ * + * @param prop a {@link java.lang.String} object + * @param compName a {@link java.lang.String} object + * @param phase a int + * @return a double + */ + public double getProperty(String prop, String compName, int phase); + + /** + *

+ * getProperty. + *

+ * + * @param prop a {@link java.lang.String} object + * @param phase a int + * @return a double + */ + public double getProperty(String prop, int phase); + + /** + *

+ * getProperty. + *

+ * + * @param prop a {@link java.lang.String} object + * @return a double + */ + public double getProperty(String prop); + + /** + *

+ * Getter for property standard. + *

+ * + * @return a {@link neqsim.standards.StandardInterface} object + */ + public neqsim.standards.StandardInterface getStandard(); + + /** + *

+ * Getter for property standard. + *

+ * + * @param standardName a {@link java.lang.String} object + * @return a {@link neqsim.standards.StandardInterface} object + */ + public neqsim.standards.StandardInterface getStandard(String standardName); + + /** + *

+ * Setter for property standard. + *

+ * + * @param standardName a {@link java.lang.String} object + */ + public void setStandard(String standardName); + + /** + *

+ * saveToDataBase. + *

+ */ + public void saveToDataBase(); + + /** + *

+ * generatePDF. + *

+ */ + public neqsim.dataPresentation.iTextPDF.PdfCreator generatePDF(); + + /** + *

+ * displayPDF. + *

+ */ + public default void displayPDF() { + generatePDF().openPDF(); + } + + /** + *

+ * getMixingRule. + *

+ * + * @return a int + */ + public int getMixingRule(); + + /** + *

+ * getResultTable. + *

+ * + * @return an array of {@link java.lang.String} objects + */ + public String[][] getResultTable(); + + /** + *

+ * autoSelectModel. + *

+ * + * @return a {@link neqsim.thermo.system.SystemInterface} object + */ + public SystemInterface autoSelectModel(); + + /** + *

+ * autoSelectMixingRule. + *

+ */ + public void autoSelectMixingRule(); + + /** + * Order phases by density. + */ + public void orderByDensity(); + + /** + *

+ * addLiquidToGas. + *

+ * + * @param fraction a double + */ + public void addLiquidToGas(double fraction); + + /** + *

+ * addGasToLiquid. + *

+ * + * @param fraction a double + */ + public void addGasToLiquid(double fraction); + + /** + * method to get the total molar flow rate of a fluid + * + * @return molar flow in unit mol/sec + */ + public double getTotalNumberOfMoles(); + + /** + *

+ * setTotalNumberOfMoles. + *

+ * + * @param totalNumberOfMoles a double + */ + public void setTotalNumberOfMoles(double totalNumberOfMoles); + + /** + *

+ * phaseToSystem. + *

+ * + * @param phaseNumber a int + * @return a {@link neqsim.thermo.system.SystemInterface} object + */ + public SystemInterface phaseToSystem(int phaseNumber); + + /** + *

+ * hasPhaseType. + *

+ * + * @param phaseTypeName a {@link java.lang.String} object + * @return a boolean + */ + public boolean hasPhaseType(String phaseTypeName); + + /** + *

+ * getPhaseNumberOfPhase. + *

+ * + * @param phaseTypeName a {@link java.lang.String} object + * @return a int + */ + public int getPhaseNumberOfPhase(String phaseTypeName); + + /** + *

+ * getEmptySystemClone. + *

+ * + * @return a {@link neqsim.thermo.system.SystemInterface} object + */ + public SystemInterface getEmptySystemClone(); + + /** + *

+ * calcHenrysConstant. + *

+ * + * @param component a {@link java.lang.String} object + * @return a double + */ + public double calcHenrysConstant(String component); + + /** + *

+ * isImplementedTemperatureDeriativesofFugacity. + *

+ * + * @return a boolean + */ + public boolean isImplementedTemperatureDeriativesofFugacity(); + + /** + *

+ * setImplementedTemperatureDeriativesofFugacity. + *

+ * + * @param implementedTemperatureDeriativesofFugacity a boolean + */ + public void setImplementedTemperatureDeriativesofFugacity( + boolean implementedTemperatureDeriativesofFugacity); + + /** + *

+ * isImplementedPressureDeriativesofFugacity. + *

+ * + * @return a boolean + */ + public boolean isImplementedPressureDeriativesofFugacity(); + + /** + *

+ * setImplementedPressureDeriativesofFugacity. + *

+ * + * @param implementedPressureDeriativesofFugacity a boolean + */ + public void setImplementedPressureDeriativesofFugacity( + boolean implementedPressureDeriativesofFugacity); + + /** + *

+ * isImplementedCompositionDeriativesofFugacity. + *

+ * + * @return a boolean + */ + public boolean isImplementedCompositionDeriativesofFugacity(); + + /** + *

+ * setImplementedCompositionDeriativesofFugacity. + *

+ * + * @param implementedCompositionDeriativesofFugacity a boolean + */ + public void setImplementedCompositionDeriativesofFugacity( + boolean implementedCompositionDeriativesofFugacity); + + /** + *

+ * addCapeOpenProperty. + *

+ * + * @param propertyName a {@link java.lang.String} object + */ + public void addCapeOpenProperty(String propertyName); + + /** + * Get physical properties of System. + * + * @return System properties + */ + public SystemProperties getProperties(); + + /** {@inheritDoc} */ + @Override + public boolean equals(Object o); + + /** {@inheritDoc} */ + @Override + public int hashCode(); + + /** {@inheritDoc} */ + public void addToComponentNames(java.lang.String name); } diff --git a/src/main/java/neqsim/thermo/system/SystemThermo.java b/src/main/java/neqsim/thermo/system/SystemThermo.java index 75f6e5e61b..c522c3437d 100644 --- a/src/main/java/neqsim/thermo/system/SystemThermo.java +++ b/src/main/java/neqsim/thermo/system/SystemThermo.java @@ -1695,12 +1695,6 @@ public void init(int type) { } } - /** {@inheritDoc} */ - @Override - public void initThermoProperties() { - init(2); - } - /** {@inheritDoc} */ @Override public void initProperties() {