Class Phase
- All Implemented Interfaces:
Serializable, Cloneable, PhaseInterface, ThermodynamicConstantsInterface
- Direct Known Subclasses:
PhaseDefault, PhaseEos, PhaseGE, PhaseHydrate, PhaseIdealGas
From wiki: A phase is a region of a space (a thermodynamic system), in neqsim named a SystemInterface, throughout which all physical properties of a material are essentially uniform. A SystemInterface can contain a single or multiple PhaseInterface objects. See PhaseType for the types of Phases that NeqSim is aware of. See also StateOfMatter. In NeqSim, there are multiple Phase classes, each representing a specific set of Equations Of State. Phases have corresponding Component classes and System classes to ensure same EoS is used throughout.
- Author:
- Even Solbraa
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) doubleMole fraction of this phase of system.booleanbooleanprivate String[]private booleanprotected doubleprivate intprivate static final doubleInverse of water molality (1/55.51 mol/kg).(package private) static org.apache.logging.log4j.LoggerLogger object for class.protected MixingRuleTypeInterfaceprotected doubleintdoubleNumber of moles in phase.protected doubleprivate PhysicalPropertyModel(package private) doublePressure of phase.protected PhaseTypeprotected PhaseInterface[]Reference phase per component.private static final longSerialization version UID.(package private) doubleTemperature of phase.protected boolean(package private) doubleFields inherited from interface ThermodynamicConstantsInterface
atm, avagadroNumber, boltzmannConstant, electronCharge, faradayConstant, gravity, molarMassAir, normalStateTemperature, pi, planckConstant, R, referencePressure, referenceTemperature, standardStateTemperature, vacumPermittivity -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddComponent(String name, double moles, int compNumber) Increase number of components and add moles to phase.voidaddMoles(int component, double dn) Change the number of moles of component of phase,i.e.,numberOfMolesInPhasebut do not change the total number of moles of component in system.voidaddMolesChemReac(int component, double dn, double totdn) Change the number of moles of component of phase, i.e.,numberOfMolesInPhaseandComponentproperties for the number of moles of component of phase, i.e.,numberOfMolesInPhase, and total number of moles of component in system, i.e.,numberOfMoleswith separate amounts.doublecalcA(int comp, PhaseInterface phase, double temperature, double pressure, int numbcomp) calcA.doublecalcA(PhaseInterface phase, double temperature, double pressure, int numbcomp) calcA.doublecalcAi(int comp, PhaseInterface phase, double temperature, double pressure, int numbcomp) calcAi.doublecalcAij(int compNumb, int j, PhaseInterface phase, double temperature, double pressure, int numbcomp) calcAij.doublecalcAiT(int comp, PhaseInterface phase, double temperature, double pressure, int numbcomp) calcAiT.doublecalcAT(int comp, PhaseInterface phase, double temperature, double pressure, int numbcomp) calcAT.doublecalcB(PhaseInterface phase, double temperature, double pressure, int numbcomp) calcB.doublecalcBi(int comp, PhaseInterface phase, double temperature, double pressure, int numbcomp) calcBi.doublecalcBij(int compNumb, int j, PhaseInterface phase, double temperature, double pressure, int numbcomp) calcBij.doublecalcDiElectricConstant(double temperature) calcDiElectricConstant.doublecalcDiElectricConstantdT(double temperature) calcDiElectricConstantdT.doublecalcDiElectricConstantdTdT(double temperature) calcDiElectricConstantdTdT.voidcalcMolarVolume(boolean test) calcMolarVolume.doublecalcR()calcR.clone()clone.doubledFdT()Calculate derivative of F per Temperature, i.e., dF/dT.doubledFdTdT()dFdTdT.doubledFdTdV()Calculate derivative of F per Temperature and Volume, i.e., dF/dT * 1/dV.doubledFdV()Calculate derivative of F per Volume, i.e., dF/dV.doubledFdVdV()dFdVdV.booleandoublefb()fb.doubleFB()FB.doublefBB()fBB.doubleFBB()FBB.doubleFBD()FBD.doubleFBT()FBT.doublefBV()fBV.doubleFBV()FBV.doubleFD()FD.doubleFDT()FDT.doubleFDV()FDV.doubleFn()Fn.doubleFnB()FnB.doubleFnV()FnV.doubleFT()FT.doubleFTT()FTT.doubleFTV()FTV.doublefv()fv.doubleFV()FV.doublefVV()fVV.doubleFVV()FVV.doublegb()gb.doublegBB()gBB.doublegBV()gBV.doublegeta(PhaseInterface phase, double temperature, double pressure, int numbcomp) geta.doublegetA()getA.doublegetActivityCoefficient(int k) getActivityCoefficient.doublegetActivityCoefficient(int k, int p) getActivityCoefficient.doublegetActivityCoefficient(int k, String scale) Get activity coefficient on a specified concentration scale.doublegetActivityCoefficientSymetric.doublegetActivityCoefficientUnSymetric.doublegetAiT()getAiT.org.netlib.util.doubleW[]Get EOS-CG ideal Helmholtz contribution and derivatives.org.netlib.util.doubleW[]Overloaded method to get the Leachman a0matrix with default hydrogen type ('normal').org.netlib.util.doubleW[]Overloaded method to get the Leachman a0matrix with default hydrogen type ('normal').org.netlib.util.doubleW[]getAlpha0_Leachman(String hydrogenType) method to get Leachman a0matrix of a phase using the Leachman EoS.org.netlib.util.doubleW[]Overloaded method to get the Leachman a0matrix with default hydrogen type ('normal').org.netlib.util.doubleW[][]Get EOS-CG residual Helmholtz contribution and derivatives.org.netlib.util.doubleW[][]Overloaded method to get the Leachman armatrix with default hydrogen type ('normal').org.netlib.util.doubleW[][]Overloaded method to get the Leachman armatrix with default hydrogen type ('normal').org.netlib.util.doubleW[][]getAlphares_Leachman(String hydrogenType) method to get Leachman armatrix of a phase using the Leachman EoS.org.netlib.util.doubleW[][]Overloaded method to get the Leachman armatrix with default hydrogen type ('normal').doublegetAntoineVaporPressure(double temp) getAntoineVaporPressure.doublegetAT()getAT.doublegetATT()getATT.doublegetb(PhaseInterface phase, double temperature, double pressure, int numbcomp) getb.doublegetB()getB.final doublegetBeta()Getter for propertybeta.doublegetBi()getBi.getComponent(int i) Get Component by index.getComponent(String name) Get Component by name.Get component array of Phase.String[]Get normalized names of components in phase.getComponents.getComponentWithIndex(int index) getComponentWithIndex.double[]getComposition(String unit) Returns the composition vector in unit molefraction/wtfraction/molespersec/volumefraction.doublegetCompressibilityX.doublegetCompressibilityY.doublemethod to return phase volume with Peneloux volume correction need to call initPhysicalProperties() before this method is called.doublegetCp()method to return specific heat capacity (Cp).doubleCalculates the heat capacity at constant pressure (Cp) in the specified units.doublegetCp0()getCp0.doublegetCpres()getCpres.doublegetCv()method to return specific heat capacity (Cv).doubleCalculates the heat capacity at constant volume (Cv) in the specified units.doublegetCvres()getCvres.doubleGet density of a phase note: does not use Peneloux volume correction.doublegetDensity(String unit) Get density of a fluid note: with Peneloux volume correction.doubleGet density of a phase using the AGA8-Detail EoS.doubleGet density of a phase using the EOS-CG EoS.doubleGet density of a phase using the GERG-2008 EoS.doubleOverloaded method to get the Leachman density with default hydrogen type ('normal').doublegetDensity_Leachman(String hydrogenType) method to get Leachman density of a phase using the Leachman EoS.doublemethod to get helium density of a phase using the Vega EoS.final doubleGetter for the fielddiElectricConstant.doublegetdPdrho.doublegetdPdTVn.doublegetdPdVTn.doublegetdrhodN.doublegetdrhodP.doublegetdrhodT.doublemethod to return enthalpy of a phase in unit Joule.doublegetEnthalpy(String unit) Calculates the enthalpy in the specified units.doublegetEnthalpydP.doublegetEnthalpydT.doublemethod to return entropy of the phase.doublegetEntropy(String unit) Calculates the entropy in the specified units.doublegetEntropydP.doublegetEntropydT.doublegetExcessGibbsEnergy.doublegetExcessGibbsEnergySymetric.doublegetFlowRate(String flowunit) method to return flow rate of a phase.doublegetFugacity(int compNumb) getFugacity.doublegetFugacity(String compName) getFugacity.doublegetg()getg.doublegetGamma()method to return heat capacity ratio/adiabatic index/Poisson constant.doublegetGibbsEnergy.doublegetGresTP.doublegetHelmholtzEnergy.doublegetHID()getHID.doublegetHresdP.doublegetHresTP.doublegetInfiniteDiluteFugacity(int k) getInfiniteDiluteFugacity.doublegetInfiniteDiluteFugacity(int k, int p) getInfiniteDiluteFugacity.intgetInitType.doublegetInternalEnergy.doublegetInternalEnergy(String unit) Calculates the internal energy in the specified units.doublegetIsobaricThermalExpansivity.doublegetIsothermalCompressibility.doubleGet the Joule Thomson Coefficient of a phase.doubleGet the Joule Thomson Coefficient of a phase.doublegetKappa()method to return real gas isentropic exponent (kappa = - Cp/Cv*(v/p)*dp/dv method to return heat capacity ratio/adiabatic index/Poisson constant.doublegetLogActivityCoefficient(int k, int p) getLogActivityCoefficient.doublegetLogInfiniteDiluteFugacity(int k) getLogInfiniteDiluteFugacity.doublegetLogInfiniteDiluteFugacity(int k, int p) getLogInfiniteDiluteFugacity.doublegetLogPureComponentFugacity(int p) getLogPureComponentFugacity.doublegetLogPureComponentFugacity(int k, boolean pure) getLogPureComponentFugacity.doublegetMass()getMass.doublegetMeanIonicActivity(int comp1, int comp2) getMeanIonicActivity.doublegetMixGibbsEnergy.Get mixing rule type.method to return name of thermodynamic model.doublegetMolalMeanIonicActivity(int comp1, int comp2) Calculates the mean ionic activity coefficient on the molality scale for an electrolyte defined by two ionic species.double[]Returns the mole composition vector in unit mole fraction.final doubleGet molar mass of phase.doublegetMolarMass(String unit) Get molar mass of a fluid phase.doublemethod to return molar volume of the phase note: without Peneloux volume correction.doublegetMolarVolume(String unit) method to return molar volume of the fluid: eventual volume correction included.doublegetMoleFraction.intGet number of components added to Phase.final intgetNumberOfIonicComponents.final intgetNumberOfMolecularComponents.doubleGet the number of moles the phase contains.doublegetOsmoticCoefficient(int watNumb) getOsmoticCoefficient.doublegetOsmoticCoefficientOfWater.doubleGet the osmotic coefficient of water on the molality scale.doublegetpH()Calculate pH of the aqueous phase using the IUPAC standard definition.doubleCalculate pH of the phase using specified method.private doubleCalculate pH based on activity (mole fraction * activity coefficient).private doubleCalculate pH based on molality (IUPAC standard: mol H3O+ / kg water) with molality-scale activity coefficient.private doubleCalculate pH based on molarity (mol/L) with molarity-scale activity coefficient.getPhase()getPhase.getPhysicalProperties.Getter for property ppm.doubleGet pressure of phase.final doublegetPressure(String unit) Get pressure of phase in a specified unit.double[]Get EOS-CG properties of a phase using the EOS-CG model.double[]Get GERG properties of a phase using the GERG-2008 EoS.double[]Overloaded method to get the Leachman properties with default hydrogen type ('normal').double[]getProperties_Leachman(String hydrogenType) method to get Leachman properties of a phase using the Leachman EoS.double[]method to get helium properties of a phase using the Vega EoS.doublegetPseudoCriticalPressure.doublegetPseudoCriticalTemperature.doublegetPureComponentFugacity(int p) getPureComponentFugacity.doublegetPureComponentFugacity(int p, boolean pure) getPureComponentFugacity.Getter for property refPhase.getRefPhase(int index) Indexed getter for property refPhase.abstract doubleGet the speed of sound of a phase note: implemented in phaseEos.doublegetSoundSpeed(String unit) Get the speed of sound of a system.doublegetSresTP.doublegetSresTV.doubleGet temperature of phase.doublegetTemperature(String unit) Get temperature in a specified unit.doublemethod to return conductivity of a phase.doublegetThermalConductivity(String unit) method to return conductivity in a specified unit.Getter for the fieldthermoPropertyModelName.doublemethod to return phase volume note: without Peneloux volume correction.final PhaseTypegetType()Getter for property pt.doublemethod to return viscosity of the phase.doublegetViscosity(String unit) method to return viscosity of the phase in a specified unit.doublemethod to return phase volume note: without Peneloux volume correction.doublemethod to return fluid volume.doublegetWaterDensity(String unit) method to get density of a water phase using specific water method.doublegetWtFrac(int component) getWtFrac.doublegetWtFrac.doublegetWtFraction(SystemInterface system) getWtFraction.doublegetWtFractionOfWaxFormingComponents.doublegetZ()getZ.doublemethod to return Z volume corrected gas compressibility.double[]groupTBPfractions.doublegV()gV.doublegVV()gVV.booleanhasComponent(String name, boolean normalized) Verify if phase has a component.booleanhasPlusFraction.booleanhasTBPFraction.voidinit.voidInit / calculate all physical properties of phase.voidInit / calculate specified physical property of phase.voidinitRefPhases(boolean onlyPure) initRefPhases.voidinitRefPhases(boolean onlyPure, String name) initRefPhases.booleanisConstantPhaseVolume.booleanCheck if mixing rule is defined.voidNormalize propertyx.voidremoveComponent(String name, double moles, double molesInPhase) Remove component from Phase.voidresetPhysicalProperties.voidsetAttractiveTerm(int i) setAttractiveTerm.final voidsetBeta(double b) Setter for propertybeta.voidsetComponentArray(ComponentInterface[] components) setComponentArray.voidsetConstantPhaseVolume(boolean constantPhaseVolume) setConstantPhaseVolume.voidSet the flow rate (moles) of all components to zero.voidsetInitType(int initType) setInitType.voidsetMolarVolume(double molarVolume) setMolarVolume.voidsetMoleFractions(double[] x) Setxand normalize for all Components in phase.voidsetNumberOfComponents(int numberOfComponents) setNumberOfComponents.voidsetParams(PhaseInterface phase, double[][] alpha, double[][] Dij, double[][] DijT, String[][] mixRule, double[][] intparam) setParams.voidSpecify the type of the physical properties.voidsetPhysicalPropertyModel.voidSetter for property ppm.voidsetPressure(double pres) Set the pressure in bara (absolute pressure in bar).voidsetProperties(PhaseInterface phase) setProperties.voidsetRefPhase(int index, PhaseInterface refPhase) Indexed setter for property refPhase.voidsetRefPhase(PhaseInterface[] refPhase) Setter for property refPhase.voidsetTemperature(double temp) Set the temperature of the phase.voidsetTotalVolume(double volume) setTotalVolume.final voidSetter for property pt.final booleanuseVolumeCorrection.voiduseVolumeCorrection(boolean volcor) useVolumeCorrection.Methods inherited from class Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PhaseInterface
addComponent, addMolesChemReac, getGamma2, getMixingRule, getPhaseFraction, getPhaseTypeName, hasComponent, init, init, initPhysicalProperties, isAsphalteneRich, molarVolume, resetMixingRule, setMixingRule, setMixingRule, setMixingRuleGEModel, setPhaseTypeName, setPhysicalProperties
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerialization version UID.- See Also:
-
logger
static org.apache.logging.log4j.Logger loggerLogger object for class. -
INV_WATER_MOLALITY
private static final double INV_WATER_MOLALITYInverse of water molality (1/55.51 mol/kg). Used for converting activity coefficients from mole fraction scale to molality scale: γ_m = γ_x * x_w / 55.51- See Also:
-
numberOfComponents
public int numberOfComponents -
componentArray
-
componentNames
-
calcMolarVolume
public boolean calcMolarVolume -
constantPhaseVolume
private boolean constantPhaseVolume -
ppm
-
physicalPropertyHandler
-
useVolumeCorrection
protected boolean useVolumeCorrection -
molarVolume
protected double molarVolume -
phaseVolume
protected double phaseVolume -
chemSyst
public boolean chemSyst -
diElectricConstant
protected double diElectricConstant -
Z
double Z -
thermoPropertyModelName
-
beta
double betaMole fraction of this phase of system.beta = numberOfMolesInPhase/numberOfMolesInSystem. NB! numberOfMolesInSystem is not known to the phase. -
numberOfMolesInPhase
public double numberOfMolesInPhaseNumber of moles in phase.numberOfMolesInPhase = numberOfMolesInSystem*beta. NB! numberOfMolesInSystem is not known to the phase. -
initType
private int initType -
mixingRuleType
-
temperature
double temperatureTemperature of phase. -
pressure
double pressurePressure of phase. -
refPhase
Reference phase per component. Relevant for solids and chemicalreactions. -
pt
-
-
Constructor Details
-
Phase
public Phase()Constructor for Phase.
-
-
Method Details
-
clone
clone.
- Specified by:
clonein interfacePhaseInterface- Overrides:
clonein classObject- Returns:
- a
PhaseInterfaceobject
-
addComponent
Increase number of components and add moles to phase. NB! Does not actually add component to componentarray.
- Parameters:
name- Name of component to add.moles- Number of moles of component to add to phase.compNumber- component number in fluid
-
removeComponent
Remove component from Phase.
- Specified by:
removeComponentin interfacePhaseInterface- Parameters:
name- Name of component.moles- Total number of moles of component.molesInPhase- Number of moles in phase.
-
setEmptyFluid
public void setEmptyFluid()Set the flow rate (moles) of all components to zero.
- Specified by:
setEmptyFluidin interfacePhaseInterface
-
addMoles
public void addMoles(int component, double dn) Change the number of moles of component of phase,i.e.,
numberOfMolesInPhasebut do not change the total number of moles of component in system. NB! Phase fractionbetais not updated by this method. Must be done separately to keep consistency between phase and component calculation of total number of moles in system.- Specified by:
addMolesin interfacePhaseInterface- Parameters:
component- Component number to changedn- Number of moles of component added to phase
-
addMolesChemReac
public void addMolesChemReac(int component, double dn, double totdn) Change the number of moles of component of phase, i.e.,
numberOfMolesInPhaseandComponentproperties for the number of moles of component of phase, i.e.,numberOfMolesInPhase, and total number of moles of component in system, i.e.,numberOfMoleswith separate amounts. NB! Phase fractionbetais not updated by this method. Must be done separately to keep consistency between phase and component calculation of total number of moles in system.- Specified by:
addMolesChemReacin interfacePhaseInterface- Parameters:
component- Component number to changedn- Number of moles of component to add to phasetotdn- Number of moles of component to add to system
-
setProperties
setProperties. Transfer properties from another phase object.
- Specified by:
setPropertiesin interfacePhaseInterface- Parameters:
phase- aPhaseInterfaceobject
-
getcomponentArray
Get component array of Phase.
- Specified by:
getcomponentArrayin interfacePhaseInterface- Returns:
- an array of
ComponentInterfaceobjects
-
getAntoineVaporPressure
public double getAntoineVaporPressure(double temp) getAntoineVaporPressure.
- Specified by:
getAntoineVaporPressurein interfacePhaseInterface- Parameters:
temp- a double- Returns:
- a double
-
getWtFrac
getWtFrac.
- Specified by:
getWtFracin interfacePhaseInterface- Parameters:
componentName- aStringobject- Returns:
- a double
-
getWtFrac
public double getWtFrac(int component) getWtFrac.
- Specified by:
getWtFracin interfacePhaseInterface- Parameters:
component- a int- Returns:
- a double
-
getPseudoCriticalTemperature
public double getPseudoCriticalTemperature()getPseudoCriticalTemperature.
- Specified by:
getPseudoCriticalTemperaturein interfacePhaseInterface- Returns:
- a double
-
getPseudoCriticalPressure
public double getPseudoCriticalPressure()getPseudoCriticalPressure.
- Specified by:
getPseudoCriticalPressurein interfacePhaseInterface- Returns:
- a double
-
normalize
public void normalize()Normalize propertyx.Property
xis the mole fraction of a component in a specific phase. Normalizing, means that the sum ofxfor all Components in a phase equal 1.0.- Specified by:
normalizein interfacePhaseInterface
-
setMoleFractions
public void setMoleFractions(double[] x) Set
xand normalize for all Components in phase.- Specified by:
setMoleFractionsin interfacePhaseInterface- Parameters:
x- Mole fractions of component in a phase.
-
getTemperature
public double getTemperature()Get temperature of phase.- Specified by:
getTemperaturein interfacePhaseInterface- Returns:
- temperature in unit K
-
getTemperature
Get temperature in a specified unit.- Specified by:
getTemperaturein interfacePhaseInterface- Parameters:
unit- Supported units are K, C, R- Returns:
- temperature in specified unit
-
getPressure
public double getPressure()Get pressure of phase.- Specified by:
getPressurein interfacePhaseInterface- Returns:
- pressure in unit bara
-
getPressure
Get pressure of phase in a specified unit.- Specified by:
getPressurein interfacePhaseInterface- Parameters:
unit- Supported units are bara, barg, Pa, MPa, psi, psia, psig- Returns:
- pressure in specified unit
-
getInitType
public int getInitType()getInitType.
- Specified by:
getInitTypein interfacePhaseInterface- Returns:
- a int
-
getMolarComposition
public double[] getMolarComposition()Returns the mole composition vector in unit mole fraction.- Specified by:
getMolarCompositionin interfacePhaseInterface- Returns:
- an array of type double
-
getComposition
Returns the composition vector in unit molefraction/wtfraction/molespersec/volumefraction.
- Specified by:
getCompositionin interfacePhaseInterface- Parameters:
unit- Supported units are molefraction, wtfraction, molespersec, volumefraction- Returns:
- composition array with unit
-
getMixGibbsEnergy
public double getMixGibbsEnergy()getMixGibbsEnergy.
- Specified by:
getMixGibbsEnergyin interfacePhaseInterface- Returns:
- a double
-
getExcessGibbsEnergy
public double getExcessGibbsEnergy()getExcessGibbsEnergy.
- Specified by:
getExcessGibbsEnergyin interfacePhaseInterface- Returns:
- a double
-
getExcessGibbsEnergySymetric
public double getExcessGibbsEnergySymetric()getExcessGibbsEnergySymetric.
- Specified by:
getExcessGibbsEnergySymetricin interfacePhaseInterface- Returns:
- a double
-
getZ
-
getZvolcorr
public double getZvolcorr()method to return Z volume corrected gas compressibility.- Specified by:
getZvolcorrin interfacePhaseInterface- Returns:
- double Z volume corrected
-
setPressure
public void setPressure(double pres) Set the pressure in bara (absolute pressure in bar).
- Specified by:
setPressurein interfacePhaseInterface- Parameters:
pres- a double
-
setTemperature
public void setTemperature(double temp) Set the temperature of the phase.- Specified by:
setTemperaturein interfacePhaseInterface- Parameters:
temp- in unit Kelvin
-
getPhysicalProperties
getPhysicalProperties.
- Specified by:
getPhysicalPropertiesin interfacePhaseInterface- Returns:
- a
PhysicalPropertiesobject
-
init
public void init(double totalNumberOfMoles, int numberOfComponents, int initType, PhaseType pt, double beta) init.
initType used in component.init()
- Specified by:
initin interfacePhaseInterface- Parameters:
totalNumberOfMoles- Total number of moles in all phases of Stream.numberOfComponents- Number of components in system.initType- a int. Use 0 to init, and 1 to reset.pt- Type of phase.beta- Mole fraction of this phase in system.
-
setPpm
Setter for property ppm.
- Specified by:
setPpmin interfacePhaseInterface- Parameters:
ppm- PhysicalPropertyModel enum object
-
getPhysicalPropertyModel
Getter for property ppm.
- Specified by:
getPhysicalPropertyModelin interfacePhaseInterface- Returns:
- a
PhysicalPropertyModelobject
-
setPhysicalPropertyModel
setPhysicalPropertyModel.
- Specified by:
setPhysicalPropertyModelin interfacePhaseInterface- Parameters:
ppm- aPhysicalPropertyModelobject
-
resetPhysicalProperties
public void resetPhysicalProperties()resetPhysicalProperties.
- Specified by:
resetPhysicalPropertiesin interfacePhaseInterface
-
initPhysicalProperties
public void initPhysicalProperties()Init / calculate all physical properties of phase.
- Specified by:
initPhysicalPropertiesin interfacePhaseInterface
-
initPhysicalProperties
Init / calculate specified physical property of phase.
- Specified by:
initPhysicalPropertiesin interfacePhaseInterface- Parameters:
ppt- PhysicalPropertyType enum object.
-
setPhysicalProperties
Specify the type of the physical properties.
- Specified by:
setPhysicalPropertiesin interfacePhaseInterface- Parameters:
ppm- PhysicalPropertyModel enum object
-
geta
geta.
- Specified by:
getain interfacePhaseInterface- Parameters:
phase- aPhaseInterfaceobjecttemperature- a doublepressure- a doublenumbcomp- a int- Returns:
- a double
-
calcA
calcA.
- Specified by:
calcAin interfacePhaseInterface- Parameters:
phase- aPhaseInterfaceobjecttemperature- a doublepressure- a doublenumbcomp- a int- Returns:
- a double
-
calcA
public double calcA(int comp, PhaseInterface phase, double temperature, double pressure, int numbcomp) calcA.
- Parameters:
comp- a intphase- aPhaseInterfaceobjecttemperature- a doublepressure- a doublenumbcomp- a int- Returns:
- a double
-
calcAi
public double calcAi(int comp, PhaseInterface phase, double temperature, double pressure, int numbcomp) calcAi.
- Specified by:
calcAiin interfacePhaseInterface- Parameters:
comp- a intphase- aPhaseInterfaceobjecttemperature- a doublepressure- a doublenumbcomp- a int- Returns:
- a double
-
calcAiT
public double calcAiT(int comp, PhaseInterface phase, double temperature, double pressure, int numbcomp) calcAiT.
- Specified by:
calcAiTin interfacePhaseInterface- Parameters:
comp- a intphase- aPhaseInterfaceobjecttemperature- a doublepressure- a doublenumbcomp- a int- Returns:
- a double
-
calcAT
public double calcAT(int comp, PhaseInterface phase, double temperature, double pressure, int numbcomp) calcAT.
- Specified by:
calcATin interfacePhaseInterface- Parameters:
comp- a intphase- aPhaseInterfaceobjecttemperature- a doublepressure- a doublenumbcomp- a int- Returns:
- a double
-
calcAij
public double calcAij(int compNumb, int j, PhaseInterface phase, double temperature, double pressure, int numbcomp) calcAij.
- Specified by:
calcAijin interfacePhaseInterface- Parameters:
compNumb- a intj- a intphase- aPhaseInterfaceobjecttemperature- a doublepressure- a doublenumbcomp- a int- Returns:
- a double
-
getb
getb.
- Specified by:
getbin interfacePhaseInterface- Parameters:
phase- aPhaseInterfaceobjecttemperature- a doublepressure- a doublenumbcomp- a int- Returns:
- a double
-
calcB
calcB.
- Specified by:
calcBin interfacePhaseInterface- Parameters:
phase- aPhaseInterfaceobjecttemperature- a doublepressure- a doublenumbcomp- a int- Returns:
- a double
-
getg
-
calcBij
public double calcBij(int compNumb, int j, PhaseInterface phase, double temperature, double pressure, int numbcomp) calcBij.
- Specified by:
calcBijin interfacePhaseInterface- Parameters:
compNumb- a intj- a intphase- aPhaseInterfaceobjecttemperature- a doublepressure- a doublenumbcomp- a int- Returns:
- a double
-
calcBi
public double calcBi(int comp, PhaseInterface phase, double temperature, double pressure, int numbcomp) calcBi.
- Specified by:
calcBiin interfacePhaseInterface- Parameters:
comp- a intphase- aPhaseInterfaceobjecttemperature- a doublepressure- a doublenumbcomp- a int- Returns:
- a double
-
setAttractiveTerm
public void setAttractiveTerm(int i) setAttractiveTerm.
- Specified by:
setAttractiveTermin interfacePhaseInterface- Parameters:
i- a int
-
getMolarVolume
public double getMolarVolume()method to return molar volume of the phase note: without Peneloux volume correction.- Specified by:
getMolarVolumein interfacePhaseInterface- Returns:
- molar volume volume in unit m3/mol*1e5
-
getMolarVolume
method to return molar volume of the fluid: eventual volume correction included.- Specified by:
getMolarVolumein interfacePhaseInterface- Parameters:
unit- Supported units are m3/mol, litre/mol- Returns:
- molar volume volume in unit
-
getNumberOfComponents
public int getNumberOfComponents()Get number of components added to Phase.
- Specified by:
getNumberOfComponentsin interfacePhaseInterface- Returns:
- the number of components in Phase.
-
getA
-
getB
-
getBi
public double getBi()getBi.
- Returns:
- a double
-
getAT
-
getATT
-
getAiT
public double getAiT()getAiT.
- Returns:
- a double
-
getPhase
getPhase.
- Specified by:
getPhasein interfacePhaseInterface- Returns:
- a
PhaseInterfaceobject
-
getNumberOfMolesInPhase
public double getNumberOfMolesInPhase()Get the number of moles the phase contains.
- Specified by:
getNumberOfMolesInPhasein interfacePhaseInterface- Returns:
- The number of moles in the phase.
-
getComponents
getComponents.
- Specified by:
getComponentsin interfacePhaseInterface- Returns:
- an array of
ComponentInterfaceobjects
-
setComponentArray
setComponentArray.
- Specified by:
setComponentArrayin interfacePhaseInterface- Parameters:
components- an array ofComponentInterfaceobjects
-
calcR
-
Fn
-
FT
-
FV
-
FD
-
FB
-
gb
-
fb
-
gV
-
fv
-
FnV
-
FnB
-
FTT
-
FBT
-
FDT
-
FBV
-
FBB
-
FDV
-
FBD
-
FTV
-
FVV
-
gVV
-
gBV
-
gBB
-
fVV
-
fBV
-
fBB
-
dFdT
public double dFdT()Calculate derivative of F per Temperature, i.e., dF/dT.
- Specified by:
dFdTin interfacePhaseInterface- Returns:
- a double
-
dFdV
public double dFdV()Calculate derivative of F per Volume, i.e., dF/dV.
- Specified by:
dFdVin interfacePhaseInterface- Returns:
- a double
-
dFdTdV
public double dFdTdV()Calculate derivative of F per Temperature and Volume, i.e., dF/dT * 1/dV.
- Specified by:
dFdTdVin interfacePhaseInterface- Returns:
- a double
-
dFdVdV
-
dFdTdT
-
getCpres
public double getCpres()getCpres.
- Specified by:
getCpresin interfacePhaseInterface- Returns:
- a double
-
getCvres
public double getCvres()getCvres.
- Returns:
- a double
-
getHresTP
public double getHresTP()getHresTP.
- Specified by:
getHresTPin interfacePhaseInterface- Returns:
- a double
-
getHresdP
public double getHresdP()getHresdP.
- Returns:
- a double
-
getGresTP
public double getGresTP()getGresTP.
- Specified by:
getGresTPin interfacePhaseInterface- Returns:
- a double
-
getSresTV
public double getSresTV()getSresTV.
- Returns:
- a double
-
getSresTP
public double getSresTP()getSresTP.
- Specified by:
getSresTPin interfacePhaseInterface- Returns:
- a double
-
getCp0
-
getHID
public double getHID()getHID.
- Returns:
- a double
-
getCp
public double getCp()method to return specific heat capacity (Cp).- Specified by:
getCpin interfacePhaseInterface- Returns:
- Cp in unit J/K
-
getCp
Calculates the heat capacity at constant pressure (Cp) in the specified units. method to return specific heat capacity (Cp) in a specified unit.- Specified by:
getCpin interfacePhaseInterface- Parameters:
unit- Supported units are J/K, J/molK, J/kgK and kJ/kgK- Returns:
- Cp in specified unit
-
getCv
public double getCv()method to return specific heat capacity (Cv).- Specified by:
getCvin interfacePhaseInterface- Returns:
- Cv in unit J/K
-
getCv
Calculates the heat capacity at constant volume (Cv) in the specified units. method to return specific heat capacity (Cv) in a specified unit.- Specified by:
getCvin interfacePhaseInterface- Parameters:
unit- Supported units are J/K, J/molK, J/kgK and kJ/kgK- Returns:
- Cv in specified unit
-
getKappa
public double getKappa()method to return real gas isentropic exponent (kappa = - Cp/Cv*(v/p)*dp/dv method to return heat capacity ratio/adiabatic index/Poisson constant.- Specified by:
getKappain interfacePhaseInterface- Returns:
- kappa
-
getGamma
public double getGamma()method to return heat capacity ratio/adiabatic index/Poisson constant. The method calculates it as Cp (real) /Cv (real).- Specified by:
getGammain interfacePhaseInterface- Returns:
- gamma
-
getEnthalpy
public double getEnthalpy()method to return enthalpy of a phase in unit Joule.- Specified by:
getEnthalpyin interfacePhaseInterface- Returns:
- a double
-
getEnthalpy
Calculates the enthalpy in the specified units. method to return phase enthalpy in a specified unit.- Specified by:
getEnthalpyin interfacePhaseInterface- Parameters:
unit- Supported units are J, J/mol, kJ/kmol, J/kg and kJ/kg- Returns:
- enthalpy in specified unit
-
getInternalEnergy
Calculates the internal energy in the specified units.getInternalEnergy.
- Specified by:
getInternalEnergyin interfacePhaseInterface- Parameters:
unit- aStringobject- Returns:
- a double
-
getEnthalpydP
public double getEnthalpydP()getEnthalpydP.
- Specified by:
getEnthalpydPin interfacePhaseInterface- Returns:
- a double
-
getEnthalpydT
public double getEnthalpydT()getEnthalpydT.
- Specified by:
getEnthalpydTin interfacePhaseInterface- Returns:
- a double
-
setNumberOfComponents
public void setNumberOfComponents(int numberOfComponents) setNumberOfComponents.
- Specified by:
setNumberOfComponentsin interfacePhaseInterface- Parameters:
numberOfComponents- a int
-
getNumberOfMolecularComponents
public final int getNumberOfMolecularComponents()getNumberOfMolecularComponents.
- Specified by:
getNumberOfMolecularComponentsin interfacePhaseInterface- Returns:
- a int
-
getNumberOfIonicComponents
public final int getNumberOfIonicComponents()getNumberOfIonicComponents.
- Specified by:
getNumberOfIonicComponentsin interfacePhaseInterface- Returns:
- a int
-
getEntropy
public double getEntropy()method to return entropy of the phase.- Specified by:
getEntropyin interfacePhaseInterface- Returns:
- a double
-
getEntropy
Calculates the entropy in the specified units. method to return entropy of the phase.- Specified by:
getEntropyin interfacePhaseInterface- Parameters:
unit- Supported units are J/K, J/moleK, J/kgK and kJ/kgK- Returns:
- entropy in specified unit
-
getEntropydP
public double getEntropydP()getEntropydP.
- Specified by:
getEntropydPin interfacePhaseInterface- Returns:
- a double
-
getEntropydT
public double getEntropydT()getEntropydT.
- Specified by:
getEntropydTin interfacePhaseInterface- Returns:
- a double
-
getViscosity
public double getViscosity()method to return viscosity of the phase.- Specified by:
getViscosityin interfacePhaseInterface- Returns:
- viscosity in unit kg/msec
-
getViscosity
method to return viscosity of the phase in a specified unit.- Specified by:
getViscosityin interfacePhaseInterface- Parameters:
unit- Supported units are kg/msec, Pas, cP (centipoise)- Returns:
- viscosity in specified unit
-
getThermalConductivity
public double getThermalConductivity()method to return conductivity of a phase.- Specified by:
getThermalConductivityin interfacePhaseInterface- Returns:
- conductivity in unit W/m*K
-
getThermalConductivity
method to return conductivity in a specified unit.- Specified by:
getThermalConductivityin interfacePhaseInterface- Parameters:
unit- Supported units are W/mK, W/cmK- Returns:
- conductivity in specified unit
-
initRefPhases
public void initRefPhases(boolean onlyPure) initRefPhases.
- Specified by:
initRefPhasesin interfacePhaseInterface- Parameters:
onlyPure- a boolean
-
initRefPhases
-
getLogPureComponentFugacity
public double getLogPureComponentFugacity(int k, boolean pure) getLogPureComponentFugacity.
- Parameters:
k- a intpure- a boolean- Returns:
- a double
-
getLogPureComponentFugacity
public double getLogPureComponentFugacity(int p) getLogPureComponentFugacity.
- Specified by:
getLogPureComponentFugacityin interfacePhaseInterface- Parameters:
p- a int- Returns:
- a double
-
getPureComponentFugacity
public double getPureComponentFugacity(int p) getPureComponentFugacity.
- Specified by:
getPureComponentFugacityin interfacePhaseInterface- Parameters:
p- a int- Returns:
- a double
-
getPureComponentFugacity
public double getPureComponentFugacity(int p, boolean pure) getPureComponentFugacity.
- Specified by:
getPureComponentFugacityin interfacePhaseInterface- Parameters:
p- a intpure- a boolean- Returns:
- a double
-
getLogInfiniteDiluteFugacity
public double getLogInfiniteDiluteFugacity(int k, int p) getLogInfiniteDiluteFugacity.
- Specified by:
getLogInfiniteDiluteFugacityin interfacePhaseInterface- Parameters:
k- a intp- a int- Returns:
- a double
-
getLogInfiniteDiluteFugacity
public double getLogInfiniteDiluteFugacity(int k) getLogInfiniteDiluteFugacity.
- Specified by:
getLogInfiniteDiluteFugacityin interfacePhaseInterface- Parameters:
k- a int- Returns:
- a double
-
getInfiniteDiluteFugacity
public double getInfiniteDiluteFugacity(int k, int p) getInfiniteDiluteFugacity.
- Specified by:
getInfiniteDiluteFugacityin interfacePhaseInterface- Parameters:
k- a intp- a int- Returns:
- a double
-
getInfiniteDiluteFugacity
public double getInfiniteDiluteFugacity(int k) getInfiniteDiluteFugacity.
- Parameters:
k- a int- Returns:
- a double
-
getLogActivityCoefficient
public double getLogActivityCoefficient(int k, int p) getLogActivityCoefficient.
- Specified by:
getLogActivityCoefficientin interfacePhaseInterface- Parameters:
k- a intp- a int- Returns:
- a double
-
getActivityCoefficient
public double getActivityCoefficient(int k, int p) getActivityCoefficient.
- Specified by:
getActivityCoefficientin interfacePhaseInterface- Parameters:
k- a intp- a int- Returns:
- a double
-
getActivityCoefficient
public double getActivityCoefficient(int k) getActivityCoefficient.
- Specified by:
getActivityCoefficientin interfacePhaseInterface- Parameters:
k- a int- Returns:
- a double
-
getActivityCoefficientSymetric
public double getActivityCoefficientSymetric(int k) getActivityCoefficientSymetric.
- Specified by:
getActivityCoefficientSymetricin interfacePhaseInterface- Parameters:
k- a int- Returns:
- a double
-
getActivityCoefficient
Get activity coefficient on a specified concentration scale.- Specified by:
getActivityCoefficientin interfacePhaseInterface- Parameters:
k- component indexscale- concentration scale: "molefraction" (default), "molality" (mol/kg solvent), or "molarity" (mol/L solution)- Returns:
- activity coefficient on the specified scale
-
getActivityCoefficientUnSymetric
public double getActivityCoefficientUnSymetric(int k) getActivityCoefficientUnSymetric.
- Specified by:
getActivityCoefficientUnSymetricin interfacePhaseInterface- Parameters:
k- a int- Returns:
- a double
-
getMolalMeanIonicActivity
public double getMolalMeanIonicActivity(int comp1, int comp2) Calculates the mean ionic activity coefficient on the molality scale for an electrolyte defined by two ionic species. The conversion from mole fraction scale (γ±,x) to molality scale (γ±,m) follows: γ±,m = γ±,x * x_waterReference: Robinson, R.A. and Stokes, R.H. "Electrolyte Solutions", 2nd ed., Butterworths, London, 1965.
Calculates the mean ionic activity coefficient on the molality scale. NeqSim uses the unsymmetric convention for ions (γ → 1 as x → 0, i.e., infinite dilution reference state). The conversion from unsymmetric mole fraction scale (γ±,x) to molality scale (γ±,m) is:
γ±,m = γ±,x * x_water
This relationship arises because the unsymmetric standard state (infinite dilution) already incorporates the 1/55.51 factor that would appear in the symmetric convention. For the symmetric convention (γ → 1 as x → 1), the full formula would be: γ±,m = γ±,x(sym) * x_water / 55.51
Reference: Robinson, R.A. and Stokes, R.H. "Electrolyte Solutions", 2nd ed., Butterworths, London, 1965, Appendix 8.10.
- Specified by:
getMolalMeanIonicActivityin interfacePhaseInterface- Parameters:
comp1- component index of the first ion (e.g., cation)comp2- component index of the second ion (e.g., anion)- Returns:
- mean ionic activity coefficient on the molality scale
-
getOsmoticCoefficientOfWater
public double getOsmoticCoefficientOfWater()getOsmoticCoefficientOfWater.
- Specified by:
getOsmoticCoefficientOfWaterin interfacePhaseInterface- Returns:
- a double
-
getOsmoticCoefficient
public double getOsmoticCoefficient(int watNumb) getOsmoticCoefficient.
Calculates the osmotic coefficient using the Robinson & Stokes (1965) definition on the molality scale. The formula used is mathematically equivalent to:
φ = -ln(a_w) / (M_w * Σm_i)
but is expressed in terms of mole fractions for computational convenience:
φ = -x_w * ln(a_w) / Σx_i
where a_w is water activity, x_w is water mole fraction, and Σx_i is sum of ion mole fractions.
- Specified by:
getOsmoticCoefficientin interfacePhaseInterface- Parameters:
watNumb- a int- Returns:
- a double
-
getOsmoticCoefficientOfWaterMolality
public double getOsmoticCoefficientOfWaterMolality()Get the osmotic coefficient of water on the molality scale. This is the definition used by Robinson and Stokes (1965):φ = -ln(a_w) / (M_w * Σm_i)
where:- a_w = water activity
- M_w = molar mass of water (kg/mol)
- Σm_i = sum of ion molalities (mol/kg solvent)
- Specified by:
getOsmoticCoefficientOfWaterMolalityin interfacePhaseInterface- Returns:
- osmotic coefficient on molality scale
-
getMeanIonicActivity
public double getMeanIonicActivity(int comp1, int comp2) getMeanIonicActivity.
- Specified by:
getMeanIonicActivityin interfacePhaseInterface- Parameters:
comp1- a intcomp2- a int- Returns:
- a double
-
getGibbsEnergy
public double getGibbsEnergy()getGibbsEnergy.
- Specified by:
getGibbsEnergyin interfacePhaseInterface- Returns:
- a double
-
getInternalEnergy
public double getInternalEnergy()getInternalEnergy.
- Specified by:
getInternalEnergyin interfacePhaseInterface- Returns:
- a double
-
getHelmholtzEnergy
public double getHelmholtzEnergy()getHelmholtzEnergy.
- Specified by:
getHelmholtzEnergyin interfacePhaseInterface- Returns:
- a double
-
getMolarMass
public final double getMolarMass()Get molar mass of phase.- Specified by:
getMolarMassin interfacePhaseInterface- Returns:
- molar mass in unit kg/mol
-
getMolarMass
Get molar mass of a fluid phase.- Specified by:
getMolarMassin interfacePhaseInterface- Parameters:
unit- Supported units are kg/mol, gr/mol- Returns:
- molar mass in specified unit
-
getJouleThomsonCoefficient
Get the Joule Thomson Coefficient of a phase.- Specified by:
getJouleThomsonCoefficientin interfacePhaseInterface- Parameters:
unit- Supported units are K/bar, C/bar- Returns:
- Joule Thomson coefficient in specified unit
-
getJouleThomsonCoefficient
public double getJouleThomsonCoefficient()Get the Joule Thomson Coefficient of a phase.- Specified by:
getJouleThomsonCoefficientin interfacePhaseInterface- Returns:
- Joule Thomson coefficient in K/bar
-
getDensity
public double getDensity()Get density of a phase note: does not use Peneloux volume correction.- Specified by:
getDensityin interfacePhaseInterface- Returns:
- density with unit kg/m3
-
getDensity
Get density of a fluid note: with Peneloux volume correction.- Specified by:
getDensityin interfacePhaseInterface- Parameters:
unit- Supported units are kg/m3, mol/m3- Returns:
- density in specified unit
-
getWaterDensity
method to get density of a water phase using specific water method.- Specified by:
getWaterDensityin interfacePhaseInterface- Parameters:
unit- Supported units are kg/m3, mol/m3- Returns:
- density in specified unit
-
getdPdrho
public double getdPdrho()getdPdrho.
- Specified by:
getdPdrhoin interfacePhaseInterface- Returns:
- a double
-
getdrhodP
public double getdrhodP()getdrhodP.
- Specified by:
getdrhodPin interfacePhaseInterface- Returns:
- a double
-
getdrhodT
public double getdrhodT()getdrhodT.
- Specified by:
getdrhodTin interfacePhaseInterface- Returns:
- a double
-
getdrhodN
public double getdrhodN()getdrhodN.
- Specified by:
getdrhodNin interfacePhaseInterface- Returns:
- a double
-
getMixingRuleType
Get mixing rule type.- Specified by:
getMixingRuleTypein interfacePhaseInterface- Returns:
- a MixingRuleTypeInterface
-
calcDiElectricConstant
public double calcDiElectricConstant(double temperature) calcDiElectricConstant.
- Parameters:
temperature- a double- Returns:
- a double
-
calcDiElectricConstantdT
public double calcDiElectricConstantdT(double temperature) calcDiElectricConstantdT.
- Parameters:
temperature- a double- Returns:
- a double
-
calcDiElectricConstantdTdT
public double calcDiElectricConstantdTdT(double temperature) calcDiElectricConstantdTdT.
- Parameters:
temperature- a double- Returns:
- a double
-
getDiElectricConstant
public final double getDiElectricConstant()Getter for the field
diElectricConstant.- Returns:
- a double
-
getdPdTVn
public double getdPdTVn()getdPdTVn.
- Specified by:
getdPdTVnin interfacePhaseInterface- Returns:
- a double
-
getdPdVTn
public double getdPdVTn()getdPdVTn.
- Specified by:
getdPdVTnin interfacePhaseInterface- Returns:
- a double
-
getpH
public double getpH()Calculate pH of the aqueous phase using the IUPAC standard definition.Uses activity-based pH calculation since NeqSim's chemical reaction equilibrium constants are defined on the mole fraction scale: pH = -log10(gamma_x * x_H3O+) where gamma_x is the activity coefficient and x_H3O+ is the mole fraction of H3O+.
Default uses activity-based pH since NeqSim's chemical reaction equilibrium constants are defined on the mole fraction scale.
- Specified by:
getpHin interfacePhaseInterface- Returns:
- pH value
-
getpH
Calculate pH of the phase using specified method.Available methods:
- activity (default): pH = -log10(gamma_x * x_H3O+) - consistent with mole fraction-based equilibrium constants
- molality (IUPAC standard): pH = -log10(gamma_m * m_H3O+) - correct for all concentrations
- molarity: pH = -log10([H3O+]) where [H3O+] is in mol/L - ignores activity coefficient
- Specified by:
getpHin interfacePhaseInterface- Parameters:
method- The calculation method: "activity" (default), "molality", or "molarity"- Returns:
- pH value
-
getpH_molarity
private double getpH_molarity()Calculate pH based on molarity (mol/L) with molarity-scale activity coefficient.- Returns:
- pH value: -log10(gamma_c * [H3O+]) where [H3O+] is in mol/L
-
getpH_molality
private double getpH_molality()Calculate pH based on molality (IUPAC standard: mol H3O+ / kg water) with molality-scale activity coefficient.- Returns:
- pH value: -log10(gamma_m * m_H3O+ / m_standard) where m_standard = 1 mol/kg
-
getpH_activity
private double getpH_activity()Calculate pH based on activity (mole fraction * activity coefficient).- Returns:
- pH value based on H3O+ activity, or NaN if result is physically unrealistic
-
getComponent
Get Component by index.
- Specified by:
getComponentin interfacePhaseInterface- Parameters:
i- Component index- Returns:
- a
ComponentInterfaceobject
-
getComponent
Get Component by name.
- Specified by:
getComponentin interfacePhaseInterface- Parameters:
name- Name of component- Returns:
- a
ComponentInterfaceobject
-
getComponentNames
Get normalized names of components in phase.- Specified by:
getComponentNamesin interfacePhaseInterface- Returns:
- Array of names of components in phase.
-
hasComponent
Verify if phase has a component.- Specified by:
hasComponentin interfacePhaseInterface- Parameters:
name- Name of component to look for.normalized- Set true to convert input name to normalized component name.- Returns:
- True if component is found.
-
getRefPhase
Indexed getter for property refPhase.
- Specified by:
getRefPhasein interfacePhaseInterface- Parameters:
index- a int- Returns:
- a
PhaseInterfaceobject
-
getRefPhase
Getter for property refPhase.
- Specified by:
getRefPhasein interfacePhaseInterface- Returns:
- an array of
PhaseInterfaceobjects
-
setRefPhase
Indexed setter for property refPhase.
- Specified by:
setRefPhasein interfacePhaseInterface- Parameters:
index- a intrefPhase- aPhaseInterfaceobject
-
setRefPhase
Setter for property refPhase.
- Specified by:
setRefPhasein interfacePhaseInterface- Parameters:
refPhase- an array ofPhaseInterfaceobjects
-
setParams
public void setParams(PhaseInterface phase, double[][] alpha, double[][] Dij, double[][] DijT, String[][] mixRule, double[][] intparam) setParams.
- Specified by:
setParamsin interfacePhaseInterface- Parameters:
phase- aPhaseInterfaceobjectalpha- an array of type doubleDij- an array of type doubleDijT- an array of type doublemixRule- an array ofStringobjectsintparam- an array of type double
-
useVolumeCorrection
public final boolean useVolumeCorrection()useVolumeCorrection.
- Specified by:
useVolumeCorrectionin interfacePhaseInterface- Returns:
- a boolean
-
useVolumeCorrection
public void useVolumeCorrection(boolean volcor) useVolumeCorrection.
- Specified by:
useVolumeCorrectionin interfacePhaseInterface- Parameters:
volcor- a boolean
-
getFugacity
public double getFugacity(int compNumb) getFugacity.
- Specified by:
getFugacityin interfacePhaseInterface- Parameters:
compNumb- a int- Returns:
- a double
-
getFugacity
getFugacity.
- Specified by:
getFugacityin interfacePhaseInterface- Parameters:
compName- aStringobject- Returns:
- a double
-
groupTBPfractions
public double[] groupTBPfractions()groupTBPfractions.
- Returns:
- an array of type double
-
getBeta
public final double getBeta()Getter for property
beta. Beta is the mole fraction of a phase of all the moles of a system.- Specified by:
getBetain interfacePhaseInterface- Returns:
- Beta value
-
setBeta
public final void setBeta(double b) Setter for property
beta. Beta is the mole fraction of a phase of all the moles of a system.- Specified by:
setBetain interfacePhaseInterface- Parameters:
b- Beta value to set.
-
isMixingRuleDefined
public boolean isMixingRuleDefined()Check if mixing rule is defined.
- Specified by:
isMixingRuleDefinedin interfacePhaseInterface- Returns:
- Returns true if MixingRule is defined and false if not.
-
getType
Getter for property pt.- Specified by:
getTypein interfacePhaseInterface- Returns:
- PhaseType enum object.
-
setType
Setter for property pt.- Specified by:
setTypein interfacePhaseInterface- Parameters:
pt- PhaseType to set.
-
setMolarVolume
public void setMolarVolume(double molarVolume) setMolarVolume.
- Specified by:
setMolarVolumein interfacePhaseInterface- Parameters:
molarVolume- a double
-
calcMolarVolume
public void calcMolarVolume(boolean test) calcMolarVolume.
- Specified by:
calcMolarVolumein interfacePhaseInterface- Parameters:
test- a boolean
-
setTotalVolume
public void setTotalVolume(double volume) setTotalVolume.
- Specified by:
setTotalVolumein interfacePhaseInterface- Parameters:
volume- a double
-
getTotalVolume
public double getTotalVolume()method to return phase volume note: without Peneloux volume correction.- Specified by:
getTotalVolumein interfacePhaseInterface- Returns:
- volume in unit m3*1e5
-
getVolume
public double getVolume()method to return phase volume note: without Peneloux volume correction.- Specified by:
getVolumein interfacePhaseInterface- Returns:
- volume in unit m3*1e5
-
getVolume
method to return fluid volume.- Specified by:
getVolumein interfacePhaseInterface- Parameters:
unit- Supported units are m3, litre- Returns:
- volume in specified unit
-
getCorrectedVolume
public double getCorrectedVolume()method to return phase volume with Peneloux volume correction need to call initPhysicalProperties() before this method is called.- Specified by:
getCorrectedVolumein interfacePhaseInterface- Returns:
- volume in unit m3
-
hasPlusFraction
public boolean hasPlusFraction()hasPlusFraction.
- Specified by:
hasPlusFractionin interfacePhaseInterface- Returns:
- a boolean
-
hasTBPFraction
public boolean hasTBPFraction()hasTBPFraction.
- Specified by:
hasTBPFractionin interfacePhaseInterface- Returns:
- a boolean
-
isConstantPhaseVolume
public boolean isConstantPhaseVolume()isConstantPhaseVolume.
- Specified by:
isConstantPhaseVolumein interfacePhaseInterface- Returns:
- a boolean
-
setConstantPhaseVolume
public void setConstantPhaseVolume(boolean constantPhaseVolume) setConstantPhaseVolume.
- Specified by:
setConstantPhaseVolumein interfacePhaseInterface- Parameters:
constantPhaseVolume- a boolean
-
getMass
public double getMass()getMass.
- Specified by:
getMassin interfacePhaseInterface- Returns:
- a double
-
getSoundSpeed
public abstract double getSoundSpeed()Get the speed of sound of a phase note: implemented in phaseEos.- Specified by:
getSoundSpeedin interfacePhaseInterface- Returns:
- speed of sound in m/s
-
getSoundSpeed
Get the speed of sound of a system. The sound speed is implemented based on a molar average over the phases- Specified by:
getSoundSpeedin interfacePhaseInterface- Parameters:
unit- Supported units are m/s, km/h- Returns:
- speed of sound in m/s
-
getComponentWithIndex
getComponentWithIndex.
- Specified by:
getComponentWithIndexin interfacePhaseInterface- Parameters:
index- a int- Returns:
- a
ComponentInterfaceobject
-
getWtFraction
getWtFraction.
- Specified by:
getWtFractionin interfacePhaseInterface- Parameters:
system- aSystemInterfaceobject- Returns:
- a double
-
getMoleFraction
public double getMoleFraction()getMoleFraction.
- Specified by:
getMoleFractionin interfacePhaseInterface- Returns:
- a double
-
setInitType
public void setInitType(int initType) setInitType.
- Specified by:
setInitTypein interfacePhaseInterface- Parameters:
initType- a int
-
getWtFractionOfWaxFormingComponents
public double getWtFractionOfWaxFormingComponents()getWtFractionOfWaxFormingComponents.
- Specified by:
getWtFractionOfWaxFormingComponentsin interfacePhaseInterface- Returns:
- a double
-
getDensity_GERG2008
public double getDensity_GERG2008()Get density of a phase using the GERG-2008 EoS.- Specified by:
getDensity_GERG2008in interfacePhaseInterface- Returns:
- density with unit kg/m3
-
getDensity_EOSCG
public double getDensity_EOSCG()Get density of a phase using the EOS-CG EoS.- Specified by:
getDensity_EOSCGin interfacePhaseInterface- Returns:
- density with unit kg/m3
-
getProperties_GERG2008
public double[] getProperties_GERG2008()Get GERG properties of a phase using the GERG-2008 EoS.
- Specified by:
getProperties_GERG2008in interfacePhaseInterface- Returns:
- an array of type double
-
getProperties_EOSCG
public double[] getProperties_EOSCG()Get EOS-CG properties of a phase using the EOS-CG model.- Specified by:
getProperties_EOSCGin interfacePhaseInterface- Returns:
- an array of type double
-
getAlpha0_GERG2008
public org.netlib.util.doubleW[] getAlpha0_GERG2008()Overloaded method to get the Leachman a0matrix with default hydrogen type ('normal').- Specified by:
getAlpha0_GERG2008in interfacePhaseInterface- Returns:
- matrix of the reduced ideal helmholtz free energy and its derivatives
-
getAlpha0_EOSCG
public org.netlib.util.doubleW[] getAlpha0_EOSCG()Get EOS-CG ideal Helmholtz contribution and derivatives.- Specified by:
getAlpha0_EOSCGin interfacePhaseInterface- Returns:
- matrix of the reduced ideal helmholtz free energy and its derivatives
-
getAlphares_GERG2008
public org.netlib.util.doubleW[][] getAlphares_GERG2008()Overloaded method to get the Leachman armatrix with default hydrogen type ('normal').- Specified by:
getAlphares_GERG2008in interfacePhaseInterface- Returns:
- matrix of the reduced residual helmholtz free energy and its derivatives
-
getAlphares_EOSCG
public org.netlib.util.doubleW[][] getAlphares_EOSCG()Get EOS-CG residual Helmholtz contribution and derivatives.- Specified by:
getAlphares_EOSCGin interfacePhaseInterface- Returns:
- matrix of the reduced residual helmholtz free energy and its derivatives
-
getDensity_Vega
public double getDensity_Vega()method to get helium density of a phase using the Vega EoS.- Specified by:
getDensity_Vegain interfacePhaseInterface- Returns:
- density with unit kg/m3
-
getProperties_Vega
public double[] getProperties_Vega()method to get helium properties of a phase using the Vega EoS.
- Specified by:
getProperties_Vegain interfacePhaseInterface- Returns:
- an array of type double
-
getAlpha0_Vega
public org.netlib.util.doubleW[] getAlpha0_Vega()Overloaded method to get the Leachman a0matrix with default hydrogen type ('normal').- Specified by:
getAlpha0_Vegain interfacePhaseInterface- Returns:
- matrix of the reduced ideal helmholtz free energy and its derivatives
-
getAlphares_Vega
public org.netlib.util.doubleW[][] getAlphares_Vega()Overloaded method to get the Leachman armatrix with default hydrogen type ('normal').- Specified by:
getAlphares_Vegain interfacePhaseInterface- Returns:
- matrix of the reduced residual helmholtz free energy and its derivatives
-
getDensity_Leachman
method to get Leachman density of a phase using the Leachman EoS.- Specified by:
getDensity_Leachmanin interfacePhaseInterface- Parameters:
hydrogenType- Supported types are 'normal', 'para', 'ortho'- Returns:
- density with unit kg/m3
-
getDensity_Leachman
public double getDensity_Leachman()Overloaded method to get the Leachman density with default hydrogen type ('normal').If no hydrogenType is specified it checks the component name and chooses the correct hydrogen. Checks for other components in the phase and throws an exception if the phase is not pure.
- Specified by:
getDensity_Leachmanin interfacePhaseInterface- Returns:
- density with unit kg/m3
-
getProperties_Leachman
method to get Leachman properties of a phase using the Leachman EoS.
- Specified by:
getProperties_Leachmanin interfacePhaseInterface- Parameters:
hydrogenType- aStringobject- Returns:
- an array of type double
-
getProperties_Leachman
public double[] getProperties_Leachman()Overloaded method to get the Leachman properties with default hydrogen type ('normal').If no hydrogentype is specified it checks the component name and chooses the correct hydrogen. Checks for other components in the phase and throws an exception if the phase is not pure.
- Specified by:
getProperties_Leachmanin interfacePhaseInterface- Returns:
- density with unit kg/m3
-
getAlpha0_Leachman
method to get Leachman a0matrix of a phase using the Leachman EoS.
- Specified by:
getAlpha0_Leachmanin interfacePhaseInterface- Parameters:
hydrogenType- Supported types are 'normal', 'para', 'ortho'- Returns:
- matrix of the reduced ideal helmholtz free energy and its derivatives
-
getAlpha0_Leachman
public org.netlib.util.doubleW[] getAlpha0_Leachman()Overloaded method to get the Leachman a0matrix with default hydrogen type ('normal').If no hydrogentype is specified it checks the component name and chooses the correct hydrogen. Checks for other components in the phase and throws an exception if the phase is not pure.
- Specified by:
getAlpha0_Leachmanin interfacePhaseInterface- Returns:
- matrix of the reduced ideal helmholtz free energy and its derivatives
-
getAlphares_Leachman
method to get Leachman armatrix of a phase using the Leachman EoS.
- Specified by:
getAlphares_Leachmanin interfacePhaseInterface- Parameters:
hydrogenType- Supported types are 'normal', 'para', 'ortho'- Returns:
- matrix of the reduced residual helmholtz free energy and its derivatives
-
getAlphares_Leachman
public org.netlib.util.doubleW[][] getAlphares_Leachman()Overloaded method to get the Leachman armatrix with default hydrogen type ('normal').If no hydrogentype is specified it checks the component name and chooses the correct hydrogen. Checks for other components in the phase and throws an exception if the phase is not pure.
- Specified by:
getAlphares_Leachmanin interfacePhaseInterface- Returns:
- matrix of the reduced residual helmholtz free energy and its derivatives
-
getDensity_AGA8
public double getDensity_AGA8()Get density of a phase using the AGA8-Detail EoS.- Specified by:
getDensity_AGA8in interfacePhaseInterface- Returns:
- density with unit kg/m3
-
getFlowRate
method to return flow rate of a phase.- Specified by:
getFlowRatein interfacePhaseInterface- Parameters:
flowunit- Supported units are kg/sec, kg/min, kg/hr, m3/sec, m3/min, m3/hr, ft3/sec, mole/sec, mole/min, mole/hr- Returns:
- flow rate in specified unit
-
getThermoPropertyModelName
-
getCompressibilityX
public double getCompressibilityX()getCompressibilityX.
- Specified by:
getCompressibilityXin interfacePhaseInterface- Returns:
- a double
-
getCompressibilityY
public double getCompressibilityY()getCompressibilityY.
- Specified by:
getCompressibilityYin interfacePhaseInterface- Returns:
- a double
-
getIsothermalCompressibility
public double getIsothermalCompressibility()getIsothermalCompressibility.
- Specified by:
getIsothermalCompressibilityin interfacePhaseInterface- Returns:
- a double
-
getIsobaricThermalExpansivity
public double getIsobaricThermalExpansivity()getIsobaricThermalExpansivity.
- Specified by:
getIsobaricThermalExpansivityin interfacePhaseInterface- Returns:
- a double
-
getModelName
method to return name of thermodynamic model.- Specified by:
getModelNamein interfacePhaseInterface- Returns:
- String model name
-
equals
-