Interface PhaseInterface
- All Superinterfaces:
Cloneable, Serializable, ThermodynamicConstantsInterface
- All Known Subinterfaces:
PhaseCPAInterface, PhaseEosInterface
- All Known Implementing Classes:
Phase, PhaseAmmoniaEos, PhaseBNS, PhaseBWRSEos, PhaseCSPsrkEos, PhaseDefault, PhaseDesmukhMather, PhaseDuanSun, PhaseElectrolyteCPA, PhaseElectrolyteCPAMM, PhaseElectrolyteCPAOld, PhaseElectrolyteCPAstatoil, PhaseEos, PhaseEOSCGEos, PhaseGE, PhaseGENRTL, PhaseGENRTLmodifiedHV, PhaseGENRTLmodifiedWS, PhaseGERG2004Eos, PhaseGERG2008Eos, PhaseGEUnifac, PhaseGEUnifacPSRK, PhaseGEUnifacUMRPRU, PhaseGEUniquac, PhaseGEUniquacmodifiedHV, PhaseGEWilson, PhaseHydrate, PhaseIdealGas, PhaseKentEisenberg, PhaseLeachmanEos, PhaseModifiedFurstElectrolyteEos, PhaseModifiedFurstElectrolyteEosMod2004, PhasePCSAFT, PhasePCSAFTa, PhasePCSAFTRahmat, PhasePitzer, PhasePrCPA, PhasePrEos, PhasePrEosvolcor, PhasePureComponentSolid, PhaseRK, PhaseSolid, PhaseSolidComplex, PhaseSoreideWhitson, PhaseSpanWagnerEos, PhaseSrkCPA, PhaseSrkCPAs, PhaseSrkEos, PhaseSrkEosvolcor, PhaseSrkPenelouxEos, PhaseTSTEos, PhaseUMRCPA, PhaseVegaEos, PhaseWaterIAPWS, PhaseWax
PhaseInterface interface.
- Version:
- $Id: $Id
- Author:
- Even Solbraa
-
Field Summary
Fields inherited from interface ThermodynamicConstantsInterface
atm, avagadroNumber, boltzmannConstant, electronCharge, faradayConstant, gravity, molarMassAir, normalStateTemperature, pi, planckConstant, R, referencePressure, referenceTemperature, standardStateTemperature, vacumPermittivity -
Method Summary
Modifier and TypeMethodDescriptionvoidaddComponent(String name, double moles, double molesInPhase, int compIndex) Add component to component array and update moles variables.default 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.default voidaddMolesChemReac(int component, double dn) Change the number of moles of component of phase, i.e.,numberOfMolesInPhase, and total number of moles of component in system, i.e.,numberOfMoleswith the same amount.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(PhaseInterface phase, double temperature, double pressure, int numbcomp) calcA.doublecalcAi(int compNumb, 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 compNumb, PhaseInterface phase, double temperature, double pressure, int numbcomp) calcAiT.doublecalcAT(int compNumb, PhaseInterface phase, double temperature, double pressure, int numbcomp) calcAT.doublecalcB(PhaseInterface phase, double temperature, double pressure, int numbcomp) calcB.doublecalcBi(int compNumb, PhaseInterface phase, double temperature, double pressure, int numbcomp) calcBi.doublecalcBij(int compNumb, int j, PhaseInterface phase, double temperature, double pressure, int numbcomp) calcBij.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.doublefb()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.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.doublegetBeta()Getter for propertybeta.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).doublemethod to return specific heat capacity (Cp) in a specified unit.doublegetCp0()getCp0.doublegetCpres()getCpres.doublegetCv()method to return specific heat capacity (Cv).doublemethod to return specific heat capacity (Cv) in a specified unit.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.doublegetdPdrho.doublegetdPdTVn.doublegetdPdVTn.doublegetdrhodN.doublegetdrhodP.doublegetdrhodT.doublemethod to return enthalpy of a phase in unit Joule.doublegetEnthalpy(String unit) method to return phase enthalpy in a specified unit.doublegetEnthalpydP.doublegetEnthalpydT.doublemethod to return entropy of the phase.doublegetEntropy(String unit) method to return entropy of the phase.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.default doublemethod to return heat capacity ratio calculated as Cp/(Cp-R*getNumberOfMolesInPhase).doublegetGibbsEnergy.doublegetGresTP.doublegetHelmholtzEnergy.doublegetHresTP.doublegetInfiniteDiluteFugacity(int k, int p) getInfiniteDiluteFugacity.intgetInitType.doublegetInternalEnergy.doublegetInternalEnergy(String unit) getInternalEnergy.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 k) getLogPureComponentFugacity.doublegetMass()getMass.doublegetMeanIonicActivity(int comp1, int comp2) getMeanIonicActivity.doublegetMixGibbsEnergy.Get mixing rule.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.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.intgetNumberOfIonicComponents.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.getPhase()getPhase.default doublegetPhaseFraction.default StringGetter for property phaseTypeName.getPhysicalProperties.Getter for property ppm.doubleGet pressure of phase.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 k) getPureComponentFugacity.doublegetPureComponentFugacity(int k, boolean pure) getPureComponentFugacity.Getter for property refPhase.getRefPhase(int index) Indexed getter for property refPhase.doubleGet the speed of sound of a phase note: implemented in phaseEos.doublegetSoundSpeed(String unit) Get the speed of sound of a system.doublegetSresTP.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.doublemethod to return phase volume note: without Peneloux volume correction.getType()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.doublegV()gV.doublegVV()gVV.default booleanhasComponent(String name) Verify if phase has a component.booleanhasComponent(String name, boolean normalized) Verify if phase has a component.booleanhasPlusFraction.booleanhasTBPFraction.default voidinit()Init using current phase properties.default voidinit(double totalNumberOfMoles, int numberOfComponents, int initType, double beta) init.voidinit.voidInit / calculate all physical properties of phase.default voidinitPhysicalProperties(String name) Initialize / calculate a specified physical properties for all phases and interfaces.voidInit / calculate specified physical property of phase.voidinitRefPhases(boolean onlyPure) initRefPhases.default booleanCheck if this phase is rich in asphaltene components.booleanisConstantPhaseVolume.booleanCheck if mixing rule is defined.doublemolarVolume(double pressure, double temperature, double A, double B, PhaseType pt) molarVolume.voidNormalize propertyx.voidremoveComponent(String name, double moles, double molesInPhase) Remove component from Phase.voidresetMixingRule.voidresetPhysicalProperties.voidsetAttractiveTerm(int i) setAttractiveTerm.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.default voidsetMixingRule(int mr) setMixingRule.voidsetMixingRule.voidsetMixingRuleGEModel(String name) setMixingRuleGEModel.voidsetMolarVolume(double molarVolume) setMolarVolume.voidsetMoleFractions(double[] x) Setxand normalize for all Components in phase.voidsetNumberOfComponents(int k) setNumberOfComponents.voidsetParams(PhaseInterface phase, double[][] alpha, double[][] Dij, double[][] DijT, String[][] mixRule, double[][] intparam) setParams.default voidsetPhaseTypeName(String phaseTypeName) Setter for property phaseTypeName.default voidSpecify the type of the physical properties.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 temperature) Set the temperature of the phase.voidsetTotalVolume(double volume) setTotalVolume.voidSetter for property pt.booleanuseVolumeCorrection.voiduseVolumeCorrection(boolean volcor) useVolumeCorrection.
-
Method Details
-
addComponent
Add component to component array and update moles variables.
- Parameters:
name- Name of component.moles- Total number of moles of component.molesInPhase- Number of moles in phase.compIndex- Index number of component in phase object component array.
-
setMoleFractions
void setMoleFractions(double[] x) Set
xand normalize for all Components in phase.- Parameters:
x- Mole fractions of component in a phase.
-
getPhaseFraction
default double getPhaseFraction()getPhaseFraction. Alias for getBeta()
- Returns:
- Beta value
-
getComposition
Returns the composition vector in unit molefraction/wtfraction/molespersec/volumefraction.
- Parameters:
unit- Supported units are molefraction, wtfraction, molespersec, volumefraction- Returns:
- composition array with unit
-
getCp0
double getCp0()getCp0.
- Returns:
- a double
-
getDensity_AGA8
double getDensity_AGA8()Get density of a phase using the AGA8-Detail EoS.- Returns:
- density with unit kg/m3
-
getJouleThomsonCoefficient
double getJouleThomsonCoefficient()Get the Joule Thomson Coefficient of a phase.- Returns:
- Joule Thomson coefficient in K/bar
-
getJouleThomsonCoefficient
Get the Joule Thomson Coefficient of a phase.- Parameters:
unit- Supported units are K/bar, C/bar- Returns:
- Joule Thomson coefficient in specified unit
-
getMolarComposition
double[] getMolarComposition()Returns the mole composition vector in unit mole fraction.- Returns:
- an array of type double
-
getVolume
double getVolume()method to return phase volume note: without Peneloux volume correction.- Returns:
- volume in unit m3*1e5
-
getVolume
method to return fluid volume.- Parameters:
unit- Supported units are m3, litre- Returns:
- volume in specified unit
-
getGamma
double getGamma()method to return heat capacity ratio/adiabatic index/Poisson constant. The method calculates it as Cp (real) /Cv (real).- Returns:
- gamma
-
getGamma2
default double getGamma2()method to return heat capacity ratio calculated as Cp/(Cp-R*getNumberOfMolesInPhase).- Returns:
- kappa
-
getComponentWithIndex
getComponentWithIndex.
- Parameters:
index- a int- Returns:
- a
ComponentInterfaceobject
-
getWtFractionOfWaxFormingComponents
double getWtFractionOfWaxFormingComponents()getWtFractionOfWaxFormingComponents.
- Returns:
- a double
-
getCompressibilityX
double getCompressibilityX()getCompressibilityX.
- Returns:
- a double
-
getCompressibilityY
double getCompressibilityY()getCompressibilityY.
- Returns:
- a double
-
getIsothermalCompressibility
double getIsothermalCompressibility()getIsothermalCompressibility.
- Returns:
- a double
-
getIsobaricThermalExpansivity
double getIsobaricThermalExpansivity()getIsobaricThermalExpansivity.
- Returns:
- a double
-
getdrhodN
double getdrhodN()getdrhodN.
- Returns:
- a double
-
setInitType
void setInitType(int initType) setInitType.
- Parameters:
initType- a int
-
init
default void init()Init using current phase properties.
-
init
default void init(double totalNumberOfMoles, int numberOfComponents, int initType, double beta) init. Uses existing phase type.
- 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.beta- Mole fraction of this phase in system.
-
init
void init(double totalNumberOfMoles, int numberOfComponents, int initType, PhaseType pt, double beta) init.
- 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.
-
initPhysicalProperties
void initPhysicalProperties()Init / calculate all physical properties of phase.
-
initPhysicalProperties
Init / calculate specified physical property of phase.
- Parameters:
ppt- PhysicalPropertyType enum object.
-
initPhysicalProperties
Initialize / calculate a specified physical properties for all phases and interfaces.- Parameters:
name- Name of physical property.
-
getdrhodP
double getdrhodP()getdrhodP.
- Returns:
- a double
-
getdrhodT
double getdrhodT()getdrhodT.
- Returns:
- a double
-
getEnthalpydP
double getEnthalpydP()getEnthalpydP.
- Returns:
- a double
-
getEnthalpydT
double getEnthalpydT()getEnthalpydT.
- Returns:
- a double
-
getEntropydP
double getEntropydP()getEntropydP.
- Returns:
- a double
-
getEntropydT
double getEntropydT()getEntropydT.
- Returns:
- a double
-
getMoleFraction
double getMoleFraction()getMoleFraction.
- Returns:
- a double
-
getcomponentArray
ComponentInterface[] getcomponentArray()Get component array of Phase.
- Returns:
- an array of
ComponentInterfaceobjects
-
getComponentNames
String[] getComponentNames()Get normalized names of components in phase.- Returns:
- Array of names of components in phase.
-
getMass
double getMass()getMass.
- Returns:
- a double
-
getWtFraction
getWtFraction.
- Parameters:
system- aSystemInterfaceobject- Returns:
- a double
-
getMolarVolume
double getMolarVolume()method to return molar volume of the phase note: without Peneloux volume correction.- Returns:
- molar volume volume in unit m3/mol*1e5
-
getMolarVolume
method to return molar volume of the fluid: eventual volume correction included.- Parameters:
unit- Supported units are m3/mol, litre/mol- Returns:
- molar volume volume in unit
-
getFlowRate
method to return flow rate of a phase.- 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
-
setComponentArray
setComponentArray.
- Parameters:
components- an array ofComponentInterfaceobjects
-
getDensity_GERG2008
double getDensity_GERG2008()Get density of a phase using the GERG-2008 EoS.- Returns:
- density with unit kg/m3
-
getProperties_GERG2008
double[] getProperties_GERG2008()Get GERG properties of a phase using the GERG-2008 EoS.
- Returns:
- an array of type double
-
getAlpha0_GERG2008
org.netlib.util.doubleW[] getAlpha0_GERG2008()Overloaded method to get the Leachman a0matrix with default hydrogen type ('normal').- Returns:
- matrix of the reduced ideal helmholtz free energy and its derivatives
-
getAlphares_GERG2008
org.netlib.util.doubleW[][] getAlphares_GERG2008()Overloaded method to get the Leachman armatrix with default hydrogen type ('normal').- Returns:
- matrix of the reduced residual helmholtz free energy and its derivatives
-
getDensity_EOSCG
double getDensity_EOSCG()Get density of a phase using the EOS-CG EoS.- Returns:
- density with unit kg/m3
-
getProperties_EOSCG
double[] getProperties_EOSCG()Get EOS-CG properties of a phase using the EOS-CG model.- Returns:
- an array of type double
-
getAlpha0_EOSCG
org.netlib.util.doubleW[] getAlpha0_EOSCG()Get EOS-CG ideal Helmholtz contribution and derivatives.- Returns:
- matrix of the reduced ideal helmholtz free energy and its derivatives
-
getAlphares_EOSCG
org.netlib.util.doubleW[][] getAlphares_EOSCG()Get EOS-CG residual Helmholtz contribution and derivatives.- 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.- Parameters:
hydrogenType- Supported types are 'normal', 'para', 'ortho'- Returns:
- density with unit kg/m3
-
getDensity_Leachman
double getDensity_Leachman()Overloaded method to get the Leachman density with default hydrogen type ('normal').- Returns:
- density with unit kg/m3
-
getProperties_Leachman
-
getProperties_Leachman
double[] getProperties_Leachman()Overloaded method to get the Leachman properties with default hydrogen type ('normal').- Returns:
- density with unit kg/m3
-
getAlpha0_Leachman
org.netlib.util.doubleW[] getAlpha0_Leachman()Overloaded method to get the Leachman a0matrix with default hydrogen type ('normal').- Returns:
- matrix of the reduced ideal helmholtz free energy and its derivatives
-
getAlpha0_Leachman
method to get Leachman a0matrix of a phase using the Leachman EoS.
- Parameters:
hydrogenType- Supported types are 'normal', 'para', 'ortho'- 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.
- Parameters:
hydrogenType- Supported types are 'normal', 'para', 'ortho'- Returns:
- matrix of the reduced residual helmholtz free energy and its derivatives
-
getAlphares_Leachman
org.netlib.util.doubleW[][] getAlphares_Leachman()Overloaded method to get the Leachman armatrix with default hydrogen type ('normal').- Returns:
- matrix of the reduced residual helmholtz free energy and its derivatives
-
getDensity_Vega
double getDensity_Vega()method to get helium density of a phase using the Vega EoS.- Returns:
- density with unit kg/m3
-
getProperties_Vega
double[] getProperties_Vega()method to get helium properties of a phase using the Vega EoS.
- Returns:
- an array of type double
-
getAlpha0_Vega
org.netlib.util.doubleW[] getAlpha0_Vega()Overloaded method to get the Leachman a0matrix with default hydrogen type ('normal').- Returns:
- matrix of the reduced ideal helmholtz free energy and its derivatives
-
getAlphares_Vega
org.netlib.util.doubleW[][] getAlphares_Vega()Overloaded method to get the Leachman armatrix with default hydrogen type ('normal').- Returns:
- matrix of the reduced residual helmholtz free energy and its derivatives
-
getDensity
double getDensity()Get density of a phase note: does not use Peneloux volume correction.- Returns:
- density with unit kg/m3
-
getDensity
Get density of a fluid note: with Peneloux volume correction.- 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.- Parameters:
unit- Supported units are kg/m3, mol/m3- Returns:
- density in specified unit
-
removeComponent
Remove component from Phase.
- Parameters:
name- Name of component.moles- Total number of moles of component.molesInPhase- Number of moles in phase.
-
getFugacity
double getFugacity(int compNumb) getFugacity.
- Parameters:
compNumb- a int- Returns:
- a double
-
getFugacity
-
getTotalVolume
double getTotalVolume()method to return phase volume note: without Peneloux volume correction.- Returns:
- volume in unit m3*1e5
-
getCorrectedVolume
double getCorrectedVolume()method to return phase volume with Peneloux volume correction need to call initPhysicalProperties() before this method is called.- Returns:
- volume in unit m3
-
hasTBPFraction
boolean hasTBPFraction()hasTBPFraction.
- Returns:
- a boolean
-
getMolalMeanIonicActivity
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.
- 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
-
getGibbsEnergy
double getGibbsEnergy()getGibbsEnergy.
- Returns:
- a double
-
getMixGibbsEnergy
double getMixGibbsEnergy()getMixGibbsEnergy.
- Returns:
- a double
-
getExcessGibbsEnergy
double getExcessGibbsEnergy()getExcessGibbsEnergy.
- Returns:
- a double
-
getExcessGibbsEnergySymetric
double getExcessGibbsEnergySymetric()getExcessGibbsEnergySymetric.
- Returns:
- a double
-
hasPlusFraction
boolean hasPlusFraction()hasPlusFraction.
- Returns:
- a boolean
-
getSresTP
double getSresTP()getSresTP.
- Returns:
- a double
-
setProperties
setProperties. Transfer properties from another phase object.
- Parameters:
phase- aPhaseInterfaceobject
-
useVolumeCorrection
void useVolumeCorrection(boolean volcor) useVolumeCorrection.
- Parameters:
volcor- a boolean
-
useVolumeCorrection
boolean useVolumeCorrection()useVolumeCorrection.
- Returns:
- a boolean
-
getBeta
double getBeta()Getter for property
beta. Beta is the mole fraction of a phase of all the moles of a system.- Returns:
- Beta value
-
setBeta
void setBeta(double b) Setter for property
beta. Beta is the mole fraction of a phase of all the moles of a system.- Parameters:
b- Beta value to set.
-
getWtFrac
double getWtFrac(int component) getWtFrac.
- Parameters:
component- a int- Returns:
- a double
-
getWtFrac
-
setMixingRuleGEModel
-
getComponent
Get Component by name.
- Parameters:
name- Name of component- Returns:
- a
ComponentInterfaceobject
-
getComponent
Get Component by index.
- Parameters:
i- Component index- Returns:
- a
ComponentInterfaceobject
-
getActivityCoefficient
double getActivityCoefficient(int k) getActivityCoefficient.
- Parameters:
k- a int- Returns:
- a double
-
getActivityCoefficient
double getActivityCoefficient(int k, int p) getActivityCoefficient.
- Parameters:
k- a intp- a int- Returns:
- a double
-
getActivityCoefficient
Get activity coefficient on a specified concentration scale.- Parameters:
k- component indexscale- concentration scale: "molefraction" (default), "molality" (mol/kg solvent), or "molarity" (mol/L solution)- Returns:
- activity coefficient on the specified scale
-
setPressure
void setPressure(double pres) Set the pressure in bara (absolute pressure in bar).
- Parameters:
pres- a double
-
getpH
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+.
- 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
- Parameters:
method- The calculation method: "activity" (default), "molality", or "molarity"- Returns:
- pH value
-
normalize
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. -
getLogPureComponentFugacity
double getLogPureComponentFugacity(int k) getLogPureComponentFugacity.
- Parameters:
k- a int- Returns:
- a double
-
getPureComponentFugacity
double getPureComponentFugacity(int k) getPureComponentFugacity.
- Parameters:
k- a int- Returns:
- a double
-
getPureComponentFugacity
double getPureComponentFugacity(int k, boolean pure) getPureComponentFugacity.
- Parameters:
k- a intpure- a boolean- Returns:
- a double
-
addMoles
default 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.- Parameters:
component- Component number to changedn- Number of moles of component added to phase
-
addMolesChemReac
default void addMolesChemReac(int component, double dn) Change the number of moles of component of phase, i.e.,
numberOfMolesInPhase, and total number of moles of component in system, i.e.,numberOfMoleswith the same amount. 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.- Parameters:
component- Component number to changedn- Number of moles of component added to phase and system
-
addMolesChemReac
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.- Parameters:
component- Component number to changedn- Number of moles of component to add to phasetotdn- Number of moles of component to add to system
-
setEmptyFluid
void setEmptyFluid()Set the flow rate (moles) of all components to zero.
-
getPhysicalProperties
PhysicalProperties getPhysicalProperties()getPhysicalProperties.
- Returns:
- a
PhysicalPropertiesobject
-
resetPhysicalProperties
void resetPhysicalProperties()resetPhysicalProperties.
-
setPhysicalProperties
default void setPhysicalProperties()Specify the type of the physical properties.
-
setPhysicalProperties
Specify the type of the physical properties.
- Parameters:
ppm- PhysicalPropertyModel enum object
-
getPhysicalPropertyModel
PhysicalPropertyModel getPhysicalPropertyModel()Getter for property ppm.
- Returns:
- a
PhysicalPropertyModelobject
-
setPpm
Setter for property ppm.
- Parameters:
ppm- PhysicalPropertyModel enum object
-
setPhysicalPropertyModel
setPhysicalPropertyModel.
- Parameters:
ppm- aPhysicalPropertyModelobject
-
getInitType
int getInitType()getInitType.
- Returns:
- a int
-
setAttractiveTerm
void setAttractiveTerm(int i) setAttractiveTerm.
- Parameters:
i- a int
-
setMixingRule
setMixingRule.
- Parameters:
mr- a MixingRuleTypeInterface
-
setMixingRule
default void setMixingRule(int mr) setMixingRule.
- Parameters:
mr- a int
-
resetMixingRule
-
setTemperature
void setTemperature(double temperature) Set the temperature of the phase.- Parameters:
temperature- in unit Kelvin
-
molarVolume
double molarVolume(double pressure, double temperature, double A, double B, PhaseType pt) throws IsNaNException, TooManyIterationsException molarVolume.
- Parameters:
pressure- a doubletemperature- a doubleA- a doubleB- a doublept- the PhaseType of the phase- Returns:
- a double
- Throws:
IsNaNException- if any.TooManyIterationsException- if any.
-
geta
geta.
- Parameters:
phase- aPhaseInterfaceobjecttemperature- a doublepressure- a doublenumbcomp- a int- Returns:
- a double
-
getb
getb.
- Parameters:
phase- aPhaseInterfaceobjecttemperature- a doublepressure- a doublenumbcomp- a int- Returns:
- a double
-
getAntoineVaporPressure
double getAntoineVaporPressure(double temp) getAntoineVaporPressure.
- Parameters:
temp- a double- Returns:
- a double
-
calcA
calcA.
- Parameters:
phase- aPhaseInterfaceobjecttemperature- a doublepressure- a doublenumbcomp- a int- Returns:
- a double
-
calcB
calcB.
- Parameters:
phase- aPhaseInterfaceobjecttemperature- a doublepressure- a doublenumbcomp- a int- Returns:
- a double
-
calcAi
double calcAi(int compNumb, PhaseInterface phase, double temperature, double pressure, int numbcomp) calcAi.
- Parameters:
compNumb- a intphase- aPhaseInterfaceobjecttemperature- a doublepressure- a doublenumbcomp- a int- Returns:
- a double
-
calcAiT
double calcAiT(int compNumb, PhaseInterface phase, double temperature, double pressure, int numbcomp) calcAiT.
- Parameters:
compNumb- a intphase- aPhaseInterfaceobjecttemperature- a doublepressure- a doublenumbcomp- a int- Returns:
- a double
-
calcAij
double calcAij(int compNumb, int j, PhaseInterface phase, double temperature, double pressure, int numbcomp) calcAij.
- Parameters:
compNumb- a intj- a intphase- aPhaseInterfaceobjecttemperature- a doublepressure- a doublenumbcomp- a int- Returns:
- a double
-
calcBij
double calcBij(int compNumb, int j, PhaseInterface phase, double temperature, double pressure, int numbcomp) calcBij.
- Parameters:
compNumb- a intj- a intphase- aPhaseInterfaceobjecttemperature- a doublepressure- a doublenumbcomp- a int- Returns:
- a double
-
calcAT
double calcAT(int compNumb, PhaseInterface phase, double temperature, double pressure, int numbcomp) calcAT.
- Parameters:
compNumb- a intphase- aPhaseInterfaceobjecttemperature- a doublepressure- a doublenumbcomp- a int- Returns:
- a double
-
calcBi
double calcBi(int compNumb, PhaseInterface phase, double temperature, double pressure, int numbcomp) calcBi.
- Parameters:
compNumb- a intphase- aPhaseInterfaceobjecttemperature- a doublepressure- a doublenumbcomp- a int- Returns:
- a double
-
calcR
double calcR()calcR.
- Returns:
- a double
-
getg
double getg()getg.
- Returns:
- a double
-
getEnthalpy
double getEnthalpy()method to return enthalpy of a phase in unit Joule.- Returns:
- a double
-
getEnthalpy
method to return phase enthalpy in a specified unit.- Parameters:
unit- Supported units are J, J/mol, kJ/kmol, J/kg and kJ/kg- Returns:
- enthalpy in specified unit
-
getEntropy
double getEntropy()method to return entropy of the phase.- Returns:
- a double
-
getEntropy
method to return entropy of the phase.- Parameters:
unit- Supported units are J/K, J/moleK, J/kgK and kJ/kgK- Returns:
- entropy in specified unit
-
getViscosity
double getViscosity()method to return viscosity of the phase.- Returns:
- viscosity in unit kg/msec
-
getViscosity
method to return viscosity of the phase in a specified unit.- Parameters:
unit- Supported units are kg/msec, Pas, cP (centipoise)- Returns:
- viscosity in specified unit
-
getThermalConductivity
double getThermalConductivity()method to return conductivity of a phase.- Returns:
- conductivity in unit W/m*K
-
getThermalConductivity
method to return conductivity in a specified unit.- Parameters:
unit- Supported units are W/mK, W/cmK- Returns:
- conductivity in specified unit
-
getCp
double getCp()method to return specific heat capacity (Cp).- Returns:
- Cp in unit J/K
-
getCp
method to return specific heat capacity (Cp) in a specified unit.- Parameters:
unit- Supported units are J/K, J/molK, J/kgK and kJ/kgK- Returns:
- Cp in specified unit
-
getHresTP
double getHresTP()getHresTP.
- Returns:
- a double
-
getGresTP
double getGresTP()getGresTP.
- Returns:
- a double
-
getCv
double getCv()method to return specific heat capacity (Cv).- Returns:
- Cv in unit J/K
-
getCv
method to return specific heat capacity (Cv) in a specified unit.- Parameters:
unit- Supported units are J/K, J/molK, J/kgK and kJ/kgK- Returns:
- Cv in specified unit
-
getKappa
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.- Returns:
- kappa
-
getCpres
double getCpres()getCpres.
- Returns:
- a double
-
getZ
double getZ()getZ.
- Returns:
- a double
-
getPseudoCriticalPressure
double getPseudoCriticalPressure()getPseudoCriticalPressure.
- Returns:
- a double
-
getPseudoCriticalTemperature
double getPseudoCriticalTemperature()getPseudoCriticalTemperature.
- Returns:
- a double
-
getPhase
-
getNumberOfComponents
int getNumberOfComponents()Get number of components added to Phase.
- Returns:
- the number of components in Phase.
-
setNumberOfComponents
void setNumberOfComponents(int k) setNumberOfComponents.
- Parameters:
k- a int
-
getComponents
-
getNumberOfMolesInPhase
double getNumberOfMolesInPhase()Get the number of moles the phase contains.
- Returns:
- The number of moles in the phase.
-
calcMolarVolume
void calcMolarVolume(boolean test) calcMolarVolume.
- Parameters:
test- a boolean
-
setTotalVolume
void setTotalVolume(double volume) setTotalVolume.
- Parameters:
volume- a double
-
setMolarVolume
void setMolarVolume(double molarVolume) setMolarVolume.
- Parameters:
molarVolume- a double
-
getInfiniteDiluteFugacity
double getInfiniteDiluteFugacity(int k, int p) getInfiniteDiluteFugacity.
- Parameters:
k- a intp- a int- Returns:
- a double
-
getHelmholtzEnergy
double getHelmholtzEnergy()getHelmholtzEnergy.
- Returns:
- a double
-
getNumberOfMolecularComponents
int getNumberOfMolecularComponents()getNumberOfMolecularComponents.
- Returns:
- a int
-
getNumberOfIonicComponents
int getNumberOfIonicComponents()getNumberOfIonicComponents.
- Returns:
- a int
-
getA
double getA()getA.
- Returns:
- a double
-
getB
double getB()getB.
- Returns:
- a double
-
getAT
double getAT()getAT.
- Returns:
- a double
-
getATT
double getATT()getATT.
- Returns:
- a double
-
clone
-
getTemperature
double getTemperature()Get temperature of phase.- Returns:
- temperature in unit K
-
getTemperature
Get temperature in a specified unit.- Parameters:
unit- Supported units are K, C, R- Returns:
- temperature in specified unit
-
getPressure
double getPressure()Get pressure of phase.- Returns:
- pressure in unit bara
-
getPressure
Get pressure of phase in a specified unit.- Parameters:
unit- Supported units are bara, barg, Pa, MPa, psi, psia, psig- Returns:
- pressure in specified unit
-
getMolarMass
double getMolarMass()Get molar mass of phase.- Returns:
- molar mass in unit kg/mol
-
getMolarMass
Get molar mass of a fluid phase.- Parameters:
unit- Supported units are kg/mol, gr/mol- Returns:
- molar mass in specified unit
-
getInternalEnergy
double getInternalEnergy()getInternalEnergy.
- Returns:
- a double
-
getInternalEnergy
-
getdPdrho
double getdPdrho()getdPdrho.
- Returns:
- a double
-
getdPdTVn
double getdPdTVn()getdPdTVn.
- Returns:
- a double
-
getdPdVTn
double getdPdVTn()getdPdVTn.
- Returns:
- a double
-
Fn
double Fn()Fn.
- Returns:
- a double
-
FT
double FT()FT.
- Returns:
- a double
-
FV
double FV()FV.
- Returns:
- a double
-
FD
double FD()FD.
- Returns:
- a double
-
FB
double FB()FB.
- Returns:
- a double
-
gb
double gb()gb.
- Returns:
- a double
-
fb
double fb()fb.
- Returns:
- a double
-
gV
double gV()gV.
- Returns:
- a double
-
fv
double fv()fv.
- Returns:
- a double
-
FnV
double FnV()FnV.
- Returns:
- a double
-
FnB
double FnB()FnB.
- Returns:
- a double
-
FTT
double FTT()FTT.
- Returns:
- a double
-
FBT
double FBT()FBT.
- Returns:
- a double
-
FDT
double FDT()FDT.
- Returns:
- a double
-
FBV
double FBV()FBV.
- Returns:
- a double
-
FBB
double FBB()FBB.
- Returns:
- a double
-
FDV
double FDV()FDV.
- Returns:
- a double
-
FBD
double FBD()FBD.
- Returns:
- a double
-
FTV
double FTV()FTV.
- Returns:
- a double
-
FVV
double FVV()FVV.
- Returns:
- a double
-
gVV
double gVV()gVV.
- Returns:
- a double
-
gBV
double gBV()gBV.
- Returns:
- a double
-
gBB
double gBB()gBB.
- Returns:
- a double
-
fVV
double fVV()fVV.
- Returns:
- a double
-
fBV
double fBV()fBV.
- Returns:
- a double
-
fBB
double fBB()fBB.
- Returns:
- a double
-
dFdT
double dFdT()Calculate derivative of F per Temperature, i.e., dF/dT.
- Returns:
- a double
-
dFdV
double dFdV()Calculate derivative of F per Volume, i.e., dF/dV.
- Returns:
- a double
-
dFdTdV
double dFdTdV()Calculate derivative of F per Temperature and Volume, i.e., dF/dT * 1/dV.
- Returns:
- a double
-
dFdVdV
double dFdVdV()dFdVdV.
- Returns:
- a double
-
dFdTdT
double dFdTdT()dFdTdT.
- Returns:
- a double
-
getOsmoticCoefficientOfWater
double getOsmoticCoefficientOfWater()getOsmoticCoefficientOfWater.
- Returns:
- a double
-
getOsmoticCoefficient
double getOsmoticCoefficient(int watNumb) getOsmoticCoefficient.
- Parameters:
watNumb- a int- Returns:
- a double
-
getOsmoticCoefficientOfWaterMolality
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)
- Returns:
- osmotic coefficient on molality scale
-
getMeanIonicActivity
double getMeanIonicActivity(int comp1, int comp2) getMeanIonicActivity.
- Parameters:
comp1- a intcomp2- a int- Returns:
- a double
-
getLogInfiniteDiluteFugacity
double getLogInfiniteDiluteFugacity(int k, int p) getLogInfiniteDiluteFugacity.
- Parameters:
k- a intp- a int- Returns:
- a double
-
getLogInfiniteDiluteFugacity
double getLogInfiniteDiluteFugacity(int k) getLogInfiniteDiluteFugacity.
- Parameters:
k- a int- Returns:
- a double
-
getMixingRule
-
getMixingRuleType
MixingRuleTypeInterface getMixingRuleType()Get mixing rule type.- Returns:
- a MixingRuleTypeInterface
-
initRefPhases
void initRefPhases(boolean onlyPure) initRefPhases.
- Parameters:
onlyPure- a boolean
-
getRefPhase
Indexed getter for property refPhase.
- Parameters:
index- a int- Returns:
- a
PhaseInterfaceobject
-
getRefPhase
PhaseInterface[] getRefPhase()Getter for property refPhase.
- Returns:
- an array of
PhaseInterfaceobjects
-
setRefPhase
Indexed setter for property refPhase.
- Parameters:
index- a intrefPhase- aPhaseInterfaceobject
-
setRefPhase
Setter for property refPhase.
- Parameters:
refPhase- an array ofPhaseInterfaceobjects
-
setParams
void setParams(PhaseInterface phase, double[][] alpha, double[][] Dij, double[][] DijT, String[][] mixRule, double[][] intparam) setParams.
- 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
-
getType
-
setType
-
getPhaseTypeName
-
setPhaseTypeName
-
isMixingRuleDefined
boolean isMixingRuleDefined()Check if mixing rule is defined.
- Returns:
- Returns true if MixingRule is defined and false if not.
-
getActivityCoefficientSymetric
double getActivityCoefficientSymetric(int k) getActivityCoefficientSymetric.
- Parameters:
k- a int- Returns:
- a double
-
getActivityCoefficientUnSymetric
double getActivityCoefficientUnSymetric(int k) getActivityCoefficientUnSymetric.
- Parameters:
k- a int- Returns:
- a double
-
hasComponent
Verify if phase has a component.- Parameters:
name- Name of component to look for. NB! Converts name to normalized name.- Returns:
- True if component is found.
-
hasComponent
Verify if phase has a component.- 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.
-
isAsphalteneRich
default boolean isAsphalteneRich()Check if this phase is rich in asphaltene components.This method detects asphaltene-rich phases regardless of whether the phase is modeled as solid (PhaseType.ASPHALTENE) or liquid (PhaseType.LIQUID_ASPHALTENE, Pedersen's liquid-liquid approach). A phase is considered asphaltene-rich if:
- The phase type is ASPHALTENE or LIQUID_ASPHALTENE, or
- The total mole fraction of asphaltene components exceeds 0.5
Asphaltene components are identified by name containing "asphaltene" (case-insensitive).
- Returns:
- true if the phase is asphaltene-rich
-
getLogActivityCoefficient
double getLogActivityCoefficient(int k, int p) getLogActivityCoefficient.
- Parameters:
k- a intp- a int- Returns:
- a double
-
isConstantPhaseVolume
boolean isConstantPhaseVolume()isConstantPhaseVolume.
- Returns:
- a boolean
-
setConstantPhaseVolume
void setConstantPhaseVolume(boolean constantPhaseVolume) setConstantPhaseVolume.
- Parameters:
constantPhaseVolume- a boolean
-
getSoundSpeed
double getSoundSpeed()Get the speed of sound of a phase note: implemented in phaseEos.- 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- Parameters:
unit- Supported units are m/s, km/h- Returns:
- speed of sound in m/s
-
getModelName
-
getZvolcorr
double getZvolcorr()method to return Z volume corrected gas compressibility.- Returns:
- double Z volume corrected
-