Class Phase

java.lang.Object
neqsim.thermo.phase.Phase
All Implemented Interfaces:
Serializable, Cloneable, PhaseInterface, ThermodynamicConstantsInterface
Direct Known Subclasses:
PhaseDefault, PhaseEos, PhaseGE, PhaseHydrate, PhaseIdealGas

public abstract class Phase extends Object implements PhaseInterface
Abstract Phase class. All Phase classes shall subclass this class.

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 Details

    • serialVersionUID

      private static final long serialVersionUID
      Serialization version UID.
      See Also:
    • logger

      static org.apache.logging.log4j.Logger logger
      Logger object for class.
    • INV_WATER_MOLALITY

      private static final double INV_WATER_MOLALITY
      Inverse 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

      public ComponentInterface[] componentArray
    • componentNames

      private transient String[] componentNames
    • calcMolarVolume

      public boolean calcMolarVolume
    • constantPhaseVolume

      private boolean constantPhaseVolume
    • ppm

      private PhysicalPropertyModel ppm
    • physicalPropertyHandler

      public PhysicalPropertyHandler 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

      public String thermoPropertyModelName
    • beta

      double beta
      Mole fraction of this phase of system. beta = numberOfMolesInPhase/numberOfMolesInSystem. NB! numberOfMolesInSystem is not known to the phase.
    • numberOfMolesInPhase

      public double numberOfMolesInPhase
      Number of moles in phase. numberOfMolesInPhase = numberOfMolesInSystem*beta. NB! numberOfMolesInSystem is not known to the phase.
    • initType

      private int initType
    • mixingRuleType

      protected MixingRuleTypeInterface mixingRuleType
    • temperature

      double temperature
      Temperature of phase.
    • pressure

      double pressure
      Pressure of phase.
    • refPhase

      protected PhaseInterface[] refPhase
      Reference phase per component. Relevant for solids and chemicalreactions.
    • pt

      protected PhaseType pt
  • Constructor Details

    • Phase

      public Phase()

      Constructor for Phase.

  • Method Details

    • clone

      public Phase clone()

      clone.

      Specified by:
      clone in interface PhaseInterface
      Overrides:
      clone in class Object
      Returns:
      a PhaseInterface object
    • addComponent

      public void addComponent(String name, double moles, int compNumber)

      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

      public void removeComponent(String name, double moles, double molesInPhase)

      Remove component from Phase.

      Specified by:
      removeComponent in interface PhaseInterface
      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:
      setEmptyFluid in interface PhaseInterface
    • addMoles

      public void addMoles(int component, double dn)

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

      Specified by:
      addMoles in interface PhaseInterface
      Parameters:
      component - Component number to change
      dn - 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., numberOfMolesInPhase and Component properties for the number of moles of component of phase, i.e., numberOfMolesInPhase, and total number of moles of component in system, i.e., numberOfMoles with separate amounts. NB! Phase fraction beta is not updated by this method. Must be done separately to keep consistency between phase and component calculation of total number of moles in system.

      Specified by:
      addMolesChemReac in interface PhaseInterface
      Parameters:
      component - Component number to change
      dn - Number of moles of component to add to phase
      totdn - Number of moles of component to add to system
    • setProperties

      public void setProperties(PhaseInterface phase)

      setProperties. Transfer properties from another phase object.

      Specified by:
      setProperties in interface PhaseInterface
      Parameters:
      phase - a PhaseInterface object
    • getcomponentArray

      public ComponentInterface[] getcomponentArray()

      Get component array of Phase.

      Specified by:
      getcomponentArray in interface PhaseInterface
      Returns:
      an array of ComponentInterface objects
    • getAntoineVaporPressure

      public double getAntoineVaporPressure(double temp)

      getAntoineVaporPressure.

      Specified by:
      getAntoineVaporPressure in interface PhaseInterface
      Parameters:
      temp - a double
      Returns:
      a double
    • getWtFrac

      public double getWtFrac(String componentName)

      getWtFrac.

      Specified by:
      getWtFrac in interface PhaseInterface
      Parameters:
      componentName - a String object
      Returns:
      a double
    • getWtFrac

      public double getWtFrac(int component)

      getWtFrac.

      Specified by:
      getWtFrac in interface PhaseInterface
      Parameters:
      component - a int
      Returns:
      a double
    • getPseudoCriticalTemperature

      public double getPseudoCriticalTemperature()

      getPseudoCriticalTemperature.

      Specified by:
      getPseudoCriticalTemperature in interface PhaseInterface
      Returns:
      a double
    • getPseudoCriticalPressure

      public double getPseudoCriticalPressure()

      getPseudoCriticalPressure.

      Specified by:
      getPseudoCriticalPressure in interface PhaseInterface
      Returns:
      a double
    • normalize

      public void normalize()
      Normalize property x.

      Property x is the mole fraction of a component in a specific phase. Normalizing, means that the sum of x for all Components in a phase equal 1.0.

      Specified by:
      normalize in interface PhaseInterface
    • setMoleFractions

      public void setMoleFractions(double[] x)

      Set x and normalize for all Components in phase.

      Specified by:
      setMoleFractions in interface PhaseInterface
      Parameters:
      x - Mole fractions of component in a phase.
    • getTemperature

      public double getTemperature()
      Get temperature of phase.
      Specified by:
      getTemperature in interface PhaseInterface
      Returns:
      temperature in unit K
    • getTemperature

      public double getTemperature(String unit)
      Get temperature in a specified unit.
      Specified by:
      getTemperature in interface PhaseInterface
      Parameters:
      unit - Supported units are K, C, R
      Returns:
      temperature in specified unit
    • getPressure

      public double getPressure()
      Get pressure of phase.
      Specified by:
      getPressure in interface PhaseInterface
      Returns:
      pressure in unit bara
    • getPressure

      public final double getPressure(String unit)
      Get pressure of phase in a specified unit.
      Specified by:
      getPressure in interface PhaseInterface
      Parameters:
      unit - Supported units are bara, barg, Pa, MPa, psi, psia, psig
      Returns:
      pressure in specified unit
    • getInitType

      public int getInitType()

      getInitType.

      Specified by:
      getInitType in interface PhaseInterface
      Returns:
      a int
    • getMolarComposition

      public double[] getMolarComposition()
      Returns the mole composition vector in unit mole fraction.
      Specified by:
      getMolarComposition in interface PhaseInterface
      Returns:
      an array of type double
    • getComposition

      public double[] getComposition(String unit)

      Returns the composition vector in unit molefraction/wtfraction/molespersec/volumefraction.

      Specified by:
      getComposition in interface PhaseInterface
      Parameters:
      unit - Supported units are molefraction, wtfraction, molespersec, volumefraction
      Returns:
      composition array with unit
    • getMixGibbsEnergy

      public double getMixGibbsEnergy()

      getMixGibbsEnergy.

      Specified by:
      getMixGibbsEnergy in interface PhaseInterface
      Returns:
      a double
    • getExcessGibbsEnergy

      public double getExcessGibbsEnergy()

      getExcessGibbsEnergy.

      Specified by:
      getExcessGibbsEnergy in interface PhaseInterface
      Returns:
      a double
    • getExcessGibbsEnergySymetric

      public double getExcessGibbsEnergySymetric()

      getExcessGibbsEnergySymetric.

      Specified by:
      getExcessGibbsEnergySymetric in interface PhaseInterface
      Returns:
      a double
    • getZ

      public double getZ()

      getZ.

      Specified by:
      getZ in interface PhaseInterface
      Returns:
      a double
    • getZvolcorr

      public double getZvolcorr()
      method to return Z volume corrected gas compressibility.
      Specified by:
      getZvolcorr in interface PhaseInterface
      Returns:
      double Z volume corrected
    • setPressure

      public void setPressure(double pres)

      Set the pressure in bara (absolute pressure in bar).

      Specified by:
      setPressure in interface PhaseInterface
      Parameters:
      pres - a double
    • setTemperature

      public void setTemperature(double temp)
      Set the temperature of the phase.
      Specified by:
      setTemperature in interface PhaseInterface
      Parameters:
      temp - in unit Kelvin
    • getPhysicalProperties

      public PhysicalProperties getPhysicalProperties()

      getPhysicalProperties.

      Specified by:
      getPhysicalProperties in interface PhaseInterface
      Returns:
      a PhysicalProperties object
    • init

      public void init(double totalNumberOfMoles, int numberOfComponents, int initType, PhaseType pt, double beta)

      init.

      initType used in component.init()

      Specified by:
      init in interface PhaseInterface
      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

      public void setPpm(PhysicalPropertyModel ppm)

      Setter for property ppm.

      Specified by:
      setPpm in interface PhaseInterface
      Parameters:
      ppm - PhysicalPropertyModel enum object
    • getPhysicalPropertyModel

      public PhysicalPropertyModel getPhysicalPropertyModel()

      Getter for property ppm.

      Specified by:
      getPhysicalPropertyModel in interface PhaseInterface
      Returns:
      a PhysicalPropertyModel object
    • setPhysicalPropertyModel

      public void setPhysicalPropertyModel(PhysicalPropertyModel ppm)

      setPhysicalPropertyModel.

      Specified by:
      setPhysicalPropertyModel in interface PhaseInterface
      Parameters:
      ppm - a PhysicalPropertyModel object
    • resetPhysicalProperties

      public void resetPhysicalProperties()

      resetPhysicalProperties.

      Specified by:
      resetPhysicalProperties in interface PhaseInterface
    • initPhysicalProperties

      public void initPhysicalProperties()

      Init / calculate all physical properties of phase.

      Specified by:
      initPhysicalProperties in interface PhaseInterface
    • initPhysicalProperties

      public void initPhysicalProperties(PhysicalPropertyType ppt)

      Init / calculate specified physical property of phase.

      Specified by:
      initPhysicalProperties in interface PhaseInterface
      Parameters:
      ppt - PhysicalPropertyType enum object.
    • setPhysicalProperties

      public void setPhysicalProperties(PhysicalPropertyModel ppm)

      Specify the type of the physical properties.

      Specified by:
      setPhysicalProperties in interface PhaseInterface
      Parameters:
      ppm - PhysicalPropertyModel enum object
    • geta

      public double geta(PhaseInterface phase, double temperature, double pressure, int numbcomp)

      geta.

      Specified by:
      geta in interface PhaseInterface
      Parameters:
      phase - a PhaseInterface object
      temperature - a double
      pressure - a double
      numbcomp - a int
      Returns:
      a double
    • calcA

      public double calcA(PhaseInterface phase, double temperature, double pressure, int numbcomp)

      calcA.

      Specified by:
      calcA in interface PhaseInterface
      Parameters:
      phase - a PhaseInterface object
      temperature - a double
      pressure - a double
      numbcomp - a int
      Returns:
      a double
    • calcA

      public double calcA(int comp, PhaseInterface phase, double temperature, double pressure, int numbcomp)

      calcA.

      Parameters:
      comp - a int
      phase - a PhaseInterface object
      temperature - a double
      pressure - a double
      numbcomp - a int
      Returns:
      a double
    • calcAi

      public double calcAi(int comp, PhaseInterface phase, double temperature, double pressure, int numbcomp)

      calcAi.

      Specified by:
      calcAi in interface PhaseInterface
      Parameters:
      comp - a int
      phase - a PhaseInterface object
      temperature - a double
      pressure - a double
      numbcomp - a int
      Returns:
      a double
    • calcAiT

      public double calcAiT(int comp, PhaseInterface phase, double temperature, double pressure, int numbcomp)

      calcAiT.

      Specified by:
      calcAiT in interface PhaseInterface
      Parameters:
      comp - a int
      phase - a PhaseInterface object
      temperature - a double
      pressure - a double
      numbcomp - a int
      Returns:
      a double
    • calcAT

      public double calcAT(int comp, PhaseInterface phase, double temperature, double pressure, int numbcomp)

      calcAT.

      Specified by:
      calcAT in interface PhaseInterface
      Parameters:
      comp - a int
      phase - a PhaseInterface object
      temperature - a double
      pressure - a double
      numbcomp - a int
      Returns:
      a double
    • calcAij

      public double calcAij(int compNumb, int j, PhaseInterface phase, double temperature, double pressure, int numbcomp)

      calcAij.

      Specified by:
      calcAij in interface PhaseInterface
      Parameters:
      compNumb - a int
      j - a int
      phase - a PhaseInterface object
      temperature - a double
      pressure - a double
      numbcomp - a int
      Returns:
      a double
    • getb

      public double getb(PhaseInterface phase, double temperature, double pressure, int numbcomp)

      getb.

      Specified by:
      getb in interface PhaseInterface
      Parameters:
      phase - a PhaseInterface object
      temperature - a double
      pressure - a double
      numbcomp - a int
      Returns:
      a double
    • calcB

      public double calcB(PhaseInterface phase, double temperature, double pressure, int numbcomp)

      calcB.

      Specified by:
      calcB in interface PhaseInterface
      Parameters:
      phase - a PhaseInterface object
      temperature - a double
      pressure - a double
      numbcomp - a int
      Returns:
      a double
    • getg

      public double getg()

      getg.

      Specified by:
      getg in interface PhaseInterface
      Returns:
      a double
    • calcBij

      public double calcBij(int compNumb, int j, PhaseInterface phase, double temperature, double pressure, int numbcomp)

      calcBij.

      Specified by:
      calcBij in interface PhaseInterface
      Parameters:
      compNumb - a int
      j - a int
      phase - a PhaseInterface object
      temperature - a double
      pressure - a double
      numbcomp - a int
      Returns:
      a double
    • calcBi

      public double calcBi(int comp, PhaseInterface phase, double temperature, double pressure, int numbcomp)

      calcBi.

      Specified by:
      calcBi in interface PhaseInterface
      Parameters:
      comp - a int
      phase - a PhaseInterface object
      temperature - a double
      pressure - a double
      numbcomp - a int
      Returns:
      a double
    • setAttractiveTerm

      public void setAttractiveTerm(int i)

      setAttractiveTerm.

      Specified by:
      setAttractiveTerm in interface PhaseInterface
      Parameters:
      i - a int
    • getMolarVolume

      public double getMolarVolume()
      method to return molar volume of the phase note: without Peneloux volume correction.
      Specified by:
      getMolarVolume in interface PhaseInterface
      Returns:
      molar volume volume in unit m3/mol*1e5
    • getMolarVolume

      public double getMolarVolume(String unit)
      method to return molar volume of the fluid: eventual volume correction included.
      Specified by:
      getMolarVolume in interface PhaseInterface
      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:
      getNumberOfComponents in interface PhaseInterface
      Returns:
      the number of components in Phase.
    • getA

      public double getA()

      getA.

      Specified by:
      getA in interface PhaseInterface
      Returns:
      a double
    • getB

      public double getB()

      getB.

      Specified by:
      getB in interface PhaseInterface
      Returns:
      a double
    • getBi

      public double getBi()

      getBi.

      Returns:
      a double
    • getAT

      public double getAT()

      getAT.

      Specified by:
      getAT in interface PhaseInterface
      Returns:
      a double
    • getATT

      public double getATT()

      getATT.

      Specified by:
      getATT in interface PhaseInterface
      Returns:
      a double
    • getAiT

      public double getAiT()

      getAiT.

      Returns:
      a double
    • getPhase

      public PhaseInterface getPhase()

      getPhase.

      Specified by:
      getPhase in interface PhaseInterface
      Returns:
      a PhaseInterface object
    • getNumberOfMolesInPhase

      public double getNumberOfMolesInPhase()

      Get the number of moles the phase contains.

      Specified by:
      getNumberOfMolesInPhase in interface PhaseInterface
      Returns:
      The number of moles in the phase.
    • getComponents

      public ComponentInterface[] getComponents()

      getComponents.

      Specified by:
      getComponents in interface PhaseInterface
      Returns:
      an array of ComponentInterface objects
    • setComponentArray

      public void setComponentArray(ComponentInterface[] components)

      setComponentArray.

      Specified by:
      setComponentArray in interface PhaseInterface
      Parameters:
      components - an array of ComponentInterface objects
    • calcR

      public double calcR()

      calcR.

      Specified by:
      calcR in interface PhaseInterface
      Returns:
      a double
    • Fn

      public double Fn()

      Fn.

      Specified by:
      Fn in interface PhaseInterface
      Returns:
      a double
    • FT

      public double FT()

      FT.

      Specified by:
      FT in interface PhaseInterface
      Returns:
      a double
    • FV

      public double FV()

      FV.

      Specified by:
      FV in interface PhaseInterface
      Returns:
      a double
    • FD

      public double FD()

      FD.

      Specified by:
      FD in interface PhaseInterface
      Returns:
      a double
    • FB

      public double FB()

      FB.

      Specified by:
      FB in interface PhaseInterface
      Returns:
      a double
    • gb

      public double gb()

      gb.

      Specified by:
      gb in interface PhaseInterface
      Returns:
      a double
    • fb

      public double fb()

      fb.

      Specified by:
      fb in interface PhaseInterface
      Returns:
      a double
    • gV

      public double gV()

      gV.

      Specified by:
      gV in interface PhaseInterface
      Returns:
      a double
    • fv

      public double fv()

      fv.

      Specified by:
      fv in interface PhaseInterface
      Returns:
      a double
    • FnV

      public double FnV()

      FnV.

      Specified by:
      FnV in interface PhaseInterface
      Returns:
      a double
    • FnB

      public double FnB()

      FnB.

      Specified by:
      FnB in interface PhaseInterface
      Returns:
      a double
    • FTT

      public double FTT()

      FTT.

      Specified by:
      FTT in interface PhaseInterface
      Returns:
      a double
    • FBT

      public double FBT()

      FBT.

      Specified by:
      FBT in interface PhaseInterface
      Returns:
      a double
    • FDT

      public double FDT()

      FDT.

      Specified by:
      FDT in interface PhaseInterface
      Returns:
      a double
    • FBV

      public double FBV()

      FBV.

      Specified by:
      FBV in interface PhaseInterface
      Returns:
      a double
    • FBB

      public double FBB()

      FBB.

      Specified by:
      FBB in interface PhaseInterface
      Returns:
      a double
    • FDV

      public double FDV()

      FDV.

      Specified by:
      FDV in interface PhaseInterface
      Returns:
      a double
    • FBD

      public double FBD()

      FBD.

      Specified by:
      FBD in interface PhaseInterface
      Returns:
      a double
    • FTV

      public double FTV()

      FTV.

      Specified by:
      FTV in interface PhaseInterface
      Returns:
      a double
    • FVV

      public double FVV()

      FVV.

      Specified by:
      FVV in interface PhaseInterface
      Returns:
      a double
    • gVV

      public double gVV()

      gVV.

      Specified by:
      gVV in interface PhaseInterface
      Returns:
      a double
    • gBV

      public double gBV()

      gBV.

      Specified by:
      gBV in interface PhaseInterface
      Returns:
      a double
    • gBB

      public double gBB()

      gBB.

      Specified by:
      gBB in interface PhaseInterface
      Returns:
      a double
    • fVV

      public double fVV()

      fVV.

      Specified by:
      fVV in interface PhaseInterface
      Returns:
      a double
    • fBV

      public double fBV()

      fBV.

      Specified by:
      fBV in interface PhaseInterface
      Returns:
      a double
    • fBB

      public double fBB()

      fBB.

      Specified by:
      fBB in interface PhaseInterface
      Returns:
      a double
    • dFdT

      public double dFdT()

      Calculate derivative of F per Temperature, i.e., dF/dT.

      Specified by:
      dFdT in interface PhaseInterface
      Returns:
      a double
    • dFdV

      public double dFdV()

      Calculate derivative of F per Volume, i.e., dF/dV.

      Specified by:
      dFdV in interface PhaseInterface
      Returns:
      a double
    • dFdTdV

      public double dFdTdV()

      Calculate derivative of F per Temperature and Volume, i.e., dF/dT * 1/dV.

      Specified by:
      dFdTdV in interface PhaseInterface
      Returns:
      a double
    • dFdVdV

      public double dFdVdV()

      dFdVdV.

      Specified by:
      dFdVdV in interface PhaseInterface
      Returns:
      a double
    • dFdTdT

      public double dFdTdT()

      dFdTdT.

      Specified by:
      dFdTdT in interface PhaseInterface
      Returns:
      a double
    • getCpres

      public double getCpres()

      getCpres.

      Specified by:
      getCpres in interface PhaseInterface
      Returns:
      a double
    • getCvres

      public double getCvres()

      getCvres.

      Returns:
      a double
    • getHresTP

      public double getHresTP()

      getHresTP.

      Specified by:
      getHresTP in interface PhaseInterface
      Returns:
      a double
    • getHresdP

      public double getHresdP()

      getHresdP.

      Returns:
      a double
    • getGresTP

      public double getGresTP()

      getGresTP.

      Specified by:
      getGresTP in interface PhaseInterface
      Returns:
      a double
    • getSresTV

      public double getSresTV()

      getSresTV.

      Returns:
      a double
    • getSresTP

      public double getSresTP()

      getSresTP.

      Specified by:
      getSresTP in interface PhaseInterface
      Returns:
      a double
    • getCp0

      public double getCp0()

      getCp0.

      Specified by:
      getCp0 in interface PhaseInterface
      Returns:
      a double
    • getHID

      public double getHID()

      getHID.

      Returns:
      a double
    • getCp

      public double getCp()
      method to return specific heat capacity (Cp).
      Specified by:
      getCp in interface PhaseInterface
      Returns:
      Cp in unit J/K
    • getCp

      public double getCp(String unit)
      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:
      getCp in interface PhaseInterface
      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:
      getCv in interface PhaseInterface
      Returns:
      Cv in unit J/K
    • getCv

      public double getCv(String unit)
      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:
      getCv in interface PhaseInterface
      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:
      getKappa in interface PhaseInterface
      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:
      getGamma in interface PhaseInterface
      Returns:
      gamma
    • getEnthalpy

      public double getEnthalpy()
      method to return enthalpy of a phase in unit Joule.
      Specified by:
      getEnthalpy in interface PhaseInterface
      Returns:
      a double
    • getEnthalpy

      public double getEnthalpy(String unit)
      Calculates the enthalpy in the specified units. method to return phase enthalpy in a specified unit.
      Specified by:
      getEnthalpy in interface PhaseInterface
      Parameters:
      unit - Supported units are J, J/mol, kJ/kmol, J/kg and kJ/kg
      Returns:
      enthalpy in specified unit
    • getInternalEnergy

      public double getInternalEnergy(String unit)
      Calculates the internal energy in the specified units.

      getInternalEnergy.

      Specified by:
      getInternalEnergy in interface PhaseInterface
      Parameters:
      unit - a String object
      Returns:
      a double
    • getEnthalpydP

      public double getEnthalpydP()

      getEnthalpydP.

      Specified by:
      getEnthalpydP in interface PhaseInterface
      Returns:
      a double
    • getEnthalpydT

      public double getEnthalpydT()

      getEnthalpydT.

      Specified by:
      getEnthalpydT in interface PhaseInterface
      Returns:
      a double
    • setNumberOfComponents

      public void setNumberOfComponents(int numberOfComponents)

      setNumberOfComponents.

      Specified by:
      setNumberOfComponents in interface PhaseInterface
      Parameters:
      numberOfComponents - a int
    • getNumberOfMolecularComponents

      public final int getNumberOfMolecularComponents()

      getNumberOfMolecularComponents.

      Specified by:
      getNumberOfMolecularComponents in interface PhaseInterface
      Returns:
      a int
    • getNumberOfIonicComponents

      public final int getNumberOfIonicComponents()

      getNumberOfIonicComponents.

      Specified by:
      getNumberOfIonicComponents in interface PhaseInterface
      Returns:
      a int
    • getEntropy

      public double getEntropy()
      method to return entropy of the phase.
      Specified by:
      getEntropy in interface PhaseInterface
      Returns:
      a double
    • getEntropy

      public double getEntropy(String unit)
      Calculates the entropy in the specified units. method to return entropy of the phase.
      Specified by:
      getEntropy in interface PhaseInterface
      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:
      getEntropydP in interface PhaseInterface
      Returns:
      a double
    • getEntropydT

      public double getEntropydT()

      getEntropydT.

      Specified by:
      getEntropydT in interface PhaseInterface
      Returns:
      a double
    • getViscosity

      public double getViscosity()
      method to return viscosity of the phase.
      Specified by:
      getViscosity in interface PhaseInterface
      Returns:
      viscosity in unit kg/msec
    • getViscosity

      public double getViscosity(String unit)
      method to return viscosity of the phase in a specified unit.
      Specified by:
      getViscosity in interface PhaseInterface
      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:
      getThermalConductivity in interface PhaseInterface
      Returns:
      conductivity in unit W/m*K
    • getThermalConductivity

      public double getThermalConductivity(String unit)
      method to return conductivity in a specified unit.
      Specified by:
      getThermalConductivity in interface PhaseInterface
      Parameters:
      unit - Supported units are W/mK, W/cmK
      Returns:
      conductivity in specified unit
    • initRefPhases

      public void initRefPhases(boolean onlyPure)

      initRefPhases.

      Specified by:
      initRefPhases in interface PhaseInterface
      Parameters:
      onlyPure - a boolean
    • initRefPhases

      public void initRefPhases(boolean onlyPure, String name)

      initRefPhases.

      Parameters:
      onlyPure - a boolean
      name - a String object
    • getLogPureComponentFugacity

      public double getLogPureComponentFugacity(int k, boolean pure)

      getLogPureComponentFugacity.

      Parameters:
      k - a int
      pure - a boolean
      Returns:
      a double
    • getLogPureComponentFugacity

      public double getLogPureComponentFugacity(int p)

      getLogPureComponentFugacity.

      Specified by:
      getLogPureComponentFugacity in interface PhaseInterface
      Parameters:
      p - a int
      Returns:
      a double
    • getPureComponentFugacity

      public double getPureComponentFugacity(int p)

      getPureComponentFugacity.

      Specified by:
      getPureComponentFugacity in interface PhaseInterface
      Parameters:
      p - a int
      Returns:
      a double
    • getPureComponentFugacity

      public double getPureComponentFugacity(int p, boolean pure)

      getPureComponentFugacity.

      Specified by:
      getPureComponentFugacity in interface PhaseInterface
      Parameters:
      p - a int
      pure - a boolean
      Returns:
      a double
    • getLogInfiniteDiluteFugacity

      public double getLogInfiniteDiluteFugacity(int k, int p)

      getLogInfiniteDiluteFugacity.

      Specified by:
      getLogInfiniteDiluteFugacity in interface PhaseInterface
      Parameters:
      k - a int
      p - a int
      Returns:
      a double
    • getLogInfiniteDiluteFugacity

      public double getLogInfiniteDiluteFugacity(int k)

      getLogInfiniteDiluteFugacity.

      Specified by:
      getLogInfiniteDiluteFugacity in interface PhaseInterface
      Parameters:
      k - a int
      Returns:
      a double
    • getInfiniteDiluteFugacity

      public double getInfiniteDiluteFugacity(int k, int p)

      getInfiniteDiluteFugacity.

      Specified by:
      getInfiniteDiluteFugacity in interface PhaseInterface
      Parameters:
      k - a int
      p - 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:
      getLogActivityCoefficient in interface PhaseInterface
      Parameters:
      k - a int
      p - a int
      Returns:
      a double
    • getActivityCoefficient

      public double getActivityCoefficient(int k, int p)

      getActivityCoefficient.

      Specified by:
      getActivityCoefficient in interface PhaseInterface
      Parameters:
      k - a int
      p - a int
      Returns:
      a double
    • getActivityCoefficient

      public double getActivityCoefficient(int k)

      getActivityCoefficient.

      Specified by:
      getActivityCoefficient in interface PhaseInterface
      Parameters:
      k - a int
      Returns:
      a double
    • getActivityCoefficientSymetric

      public double getActivityCoefficientSymetric(int k)

      getActivityCoefficientSymetric.

      Specified by:
      getActivityCoefficientSymetric in interface PhaseInterface
      Parameters:
      k - a int
      Returns:
      a double
    • getActivityCoefficient

      public double getActivityCoefficient(int k, String scale)
      Get activity coefficient on a specified concentration scale.
      Specified by:
      getActivityCoefficient in interface PhaseInterface
      Parameters:
      k - component index
      scale - 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:
      getActivityCoefficientUnSymetric in interface PhaseInterface
      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_water

      Reference: 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:
      getMolalMeanIonicActivity in interface PhaseInterface
      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:
      getOsmoticCoefficientOfWater in interface PhaseInterface
      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:
      getOsmoticCoefficient in interface PhaseInterface
      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:
      getOsmoticCoefficientOfWaterMolality in interface PhaseInterface
      Returns:
      osmotic coefficient on molality scale
    • getMeanIonicActivity

      public double getMeanIonicActivity(int comp1, int comp2)

      getMeanIonicActivity.

      Specified by:
      getMeanIonicActivity in interface PhaseInterface
      Parameters:
      comp1 - a int
      comp2 - a int
      Returns:
      a double
    • getGibbsEnergy

      public double getGibbsEnergy()

      getGibbsEnergy.

      Specified by:
      getGibbsEnergy in interface PhaseInterface
      Returns:
      a double
    • getInternalEnergy

      public double getInternalEnergy()

      getInternalEnergy.

      Specified by:
      getInternalEnergy in interface PhaseInterface
      Returns:
      a double
    • getHelmholtzEnergy

      public double getHelmholtzEnergy()

      getHelmholtzEnergy.

      Specified by:
      getHelmholtzEnergy in interface PhaseInterface
      Returns:
      a double
    • getMolarMass

      public final double getMolarMass()
      Get molar mass of phase.
      Specified by:
      getMolarMass in interface PhaseInterface
      Returns:
      molar mass in unit kg/mol
    • getMolarMass

      public double getMolarMass(String unit)
      Get molar mass of a fluid phase.
      Specified by:
      getMolarMass in interface PhaseInterface
      Parameters:
      unit - Supported units are kg/mol, gr/mol
      Returns:
      molar mass in specified unit
    • getJouleThomsonCoefficient

      public double getJouleThomsonCoefficient(String unit)
      Get the Joule Thomson Coefficient of a phase.
      Specified by:
      getJouleThomsonCoefficient in interface PhaseInterface
      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:
      getJouleThomsonCoefficient in interface PhaseInterface
      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:
      getDensity in interface PhaseInterface
      Returns:
      density with unit kg/m3
    • getDensity

      public double getDensity(String unit)
      Get density of a fluid note: with Peneloux volume correction.
      Specified by:
      getDensity in interface PhaseInterface
      Parameters:
      unit - Supported units are kg/m3, mol/m3
      Returns:
      density in specified unit
    • getWaterDensity

      public double getWaterDensity(String unit)
      method to get density of a water phase using specific water method.
      Specified by:
      getWaterDensity in interface PhaseInterface
      Parameters:
      unit - Supported units are kg/m3, mol/m3
      Returns:
      density in specified unit
    • getdPdrho

      public double getdPdrho()

      getdPdrho.

      Specified by:
      getdPdrho in interface PhaseInterface
      Returns:
      a double
    • getdrhodP

      public double getdrhodP()

      getdrhodP.

      Specified by:
      getdrhodP in interface PhaseInterface
      Returns:
      a double
    • getdrhodT

      public double getdrhodT()

      getdrhodT.

      Specified by:
      getdrhodT in interface PhaseInterface
      Returns:
      a double
    • getdrhodN

      public double getdrhodN()

      getdrhodN.

      Specified by:
      getdrhodN in interface PhaseInterface
      Returns:
      a double
    • getMixingRuleType

      public MixingRuleTypeInterface getMixingRuleType()
      Get mixing rule type.
      Specified by:
      getMixingRuleType in interface PhaseInterface
      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:
      getdPdTVn in interface PhaseInterface
      Returns:
      a double
    • getdPdVTn

      public double getdPdVTn()

      getdPdVTn.

      Specified by:
      getdPdVTn in interface PhaseInterface
      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:
      getpH in interface PhaseInterface
      Returns:
      pH value
    • getpH

      public double getpH(String method)
      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:
      getpH in interface PhaseInterface
      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

      public ComponentInterface getComponent(int i)

      Get Component by index.

      Specified by:
      getComponent in interface PhaseInterface
      Parameters:
      i - Component index
      Returns:
      a ComponentInterface object
    • getComponent

      public ComponentInterface getComponent(String name)

      Get Component by name.

      Specified by:
      getComponent in interface PhaseInterface
      Parameters:
      name - Name of component
      Returns:
      a ComponentInterface object
    • getComponentNames

      public String[] getComponentNames()
      Get normalized names of components in phase.
      Specified by:
      getComponentNames in interface PhaseInterface
      Returns:
      Array of names of components in phase.
    • hasComponent

      public boolean hasComponent(String name, boolean normalized)
      Verify if phase has a component.
      Specified by:
      hasComponent in interface PhaseInterface
      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

      public PhaseInterface getRefPhase(int index)

      Indexed getter for property refPhase.

      Specified by:
      getRefPhase in interface PhaseInterface
      Parameters:
      index - a int
      Returns:
      a PhaseInterface object
    • getRefPhase

      public PhaseInterface[] getRefPhase()

      Getter for property refPhase.

      Specified by:
      getRefPhase in interface PhaseInterface
      Returns:
      an array of PhaseInterface objects
    • setRefPhase

      public void setRefPhase(int index, PhaseInterface refPhase)

      Indexed setter for property refPhase.

      Specified by:
      setRefPhase in interface PhaseInterface
      Parameters:
      index - a int
      refPhase - a PhaseInterface object
    • setRefPhase

      public void setRefPhase(PhaseInterface[] refPhase)

      Setter for property refPhase.

      Specified by:
      setRefPhase in interface PhaseInterface
      Parameters:
      refPhase - an array of PhaseInterface objects
    • setParams

      public void setParams(PhaseInterface phase, double[][] alpha, double[][] Dij, double[][] DijT, String[][] mixRule, double[][] intparam)

      setParams.

      Specified by:
      setParams in interface PhaseInterface
      Parameters:
      phase - a PhaseInterface object
      alpha - an array of type double
      Dij - an array of type double
      DijT - an array of type double
      mixRule - an array of String objects
      intparam - an array of type double
    • useVolumeCorrection

      public final boolean useVolumeCorrection()

      useVolumeCorrection.

      Specified by:
      useVolumeCorrection in interface PhaseInterface
      Returns:
      a boolean
    • useVolumeCorrection

      public void useVolumeCorrection(boolean volcor)

      useVolumeCorrection.

      Specified by:
      useVolumeCorrection in interface PhaseInterface
      Parameters:
      volcor - a boolean
    • getFugacity

      public double getFugacity(int compNumb)

      getFugacity.

      Specified by:
      getFugacity in interface PhaseInterface
      Parameters:
      compNumb - a int
      Returns:
      a double
    • getFugacity

      public double getFugacity(String compName)

      getFugacity.

      Specified by:
      getFugacity in interface PhaseInterface
      Parameters:
      compName - a String object
      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:
      getBeta in interface PhaseInterface
      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:
      setBeta in interface PhaseInterface
      Parameters:
      b - Beta value to set.
    • isMixingRuleDefined

      public boolean isMixingRuleDefined()

      Check if mixing rule is defined.

      Specified by:
      isMixingRuleDefined in interface PhaseInterface
      Returns:
      Returns true if MixingRule is defined and false if not.
    • getType

      public final PhaseType getType()
      Getter for property pt.
      Specified by:
      getType in interface PhaseInterface
      Returns:
      PhaseType enum object.
    • setType

      public final void setType(PhaseType pt)
      Setter for property pt.
      Specified by:
      setType in interface PhaseInterface
      Parameters:
      pt - PhaseType to set.
    • setMolarVolume

      public void setMolarVolume(double molarVolume)

      setMolarVolume.

      Specified by:
      setMolarVolume in interface PhaseInterface
      Parameters:
      molarVolume - a double
    • calcMolarVolume

      public void calcMolarVolume(boolean test)

      calcMolarVolume.

      Specified by:
      calcMolarVolume in interface PhaseInterface
      Parameters:
      test - a boolean
    • setTotalVolume

      public void setTotalVolume(double volume)

      setTotalVolume.

      Specified by:
      setTotalVolume in interface PhaseInterface
      Parameters:
      volume - a double
    • getTotalVolume

      public double getTotalVolume()
      method to return phase volume note: without Peneloux volume correction.
      Specified by:
      getTotalVolume in interface PhaseInterface
      Returns:
      volume in unit m3*1e5
    • getVolume

      public double getVolume()
      method to return phase volume note: without Peneloux volume correction.
      Specified by:
      getVolume in interface PhaseInterface
      Returns:
      volume in unit m3*1e5
    • getVolume

      public double getVolume(String unit)
      method to return fluid volume.
      Specified by:
      getVolume in interface PhaseInterface
      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:
      getCorrectedVolume in interface PhaseInterface
      Returns:
      volume in unit m3
    • hasPlusFraction

      public boolean hasPlusFraction()

      hasPlusFraction.

      Specified by:
      hasPlusFraction in interface PhaseInterface
      Returns:
      a boolean
    • hasTBPFraction

      public boolean hasTBPFraction()

      hasTBPFraction.

      Specified by:
      hasTBPFraction in interface PhaseInterface
      Returns:
      a boolean
    • isConstantPhaseVolume

      public boolean isConstantPhaseVolume()

      isConstantPhaseVolume.

      Specified by:
      isConstantPhaseVolume in interface PhaseInterface
      Returns:
      a boolean
    • setConstantPhaseVolume

      public void setConstantPhaseVolume(boolean constantPhaseVolume)

      setConstantPhaseVolume.

      Specified by:
      setConstantPhaseVolume in interface PhaseInterface
      Parameters:
      constantPhaseVolume - a boolean
    • getMass

      public double getMass()

      getMass.

      Specified by:
      getMass in interface PhaseInterface
      Returns:
      a double
    • getSoundSpeed

      public abstract double getSoundSpeed()
      Get the speed of sound of a phase note: implemented in phaseEos.
      Specified by:
      getSoundSpeed in interface PhaseInterface
      Returns:
      speed of sound in m/s
    • getSoundSpeed

      public double getSoundSpeed(String unit)
      Get the speed of sound of a system. The sound speed is implemented based on a molar average over the phases
      Specified by:
      getSoundSpeed in interface PhaseInterface
      Parameters:
      unit - Supported units are m/s, km/h
      Returns:
      speed of sound in m/s
    • getComponentWithIndex

      public ComponentInterface getComponentWithIndex(int index)

      getComponentWithIndex.

      Specified by:
      getComponentWithIndex in interface PhaseInterface
      Parameters:
      index - a int
      Returns:
      a ComponentInterface object
    • getWtFraction

      public double getWtFraction(SystemInterface system)

      getWtFraction.

      Specified by:
      getWtFraction in interface PhaseInterface
      Parameters:
      system - a SystemInterface object
      Returns:
      a double
    • getMoleFraction

      public double getMoleFraction()

      getMoleFraction.

      Specified by:
      getMoleFraction in interface PhaseInterface
      Returns:
      a double
    • setInitType

      public void setInitType(int initType)

      setInitType.

      Specified by:
      setInitType in interface PhaseInterface
      Parameters:
      initType - a int
    • getWtFractionOfWaxFormingComponents

      public double getWtFractionOfWaxFormingComponents()

      getWtFractionOfWaxFormingComponents.

      Specified by:
      getWtFractionOfWaxFormingComponents in interface PhaseInterface
      Returns:
      a double
    • getDensity_GERG2008

      public double getDensity_GERG2008()
      Get density of a phase using the GERG-2008 EoS.
      Specified by:
      getDensity_GERG2008 in interface PhaseInterface
      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_EOSCG in interface PhaseInterface
      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_GERG2008 in interface PhaseInterface
      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_EOSCG in interface PhaseInterface
      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_GERG2008 in interface PhaseInterface
      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_EOSCG in interface PhaseInterface
      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_GERG2008 in interface PhaseInterface
      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_EOSCG in interface PhaseInterface
      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_Vega in interface PhaseInterface
      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_Vega in interface PhaseInterface
      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_Vega in interface PhaseInterface
      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_Vega in interface PhaseInterface
      Returns:
      matrix of the reduced residual helmholtz free energy and its derivatives
    • getDensity_Leachman

      public double getDensity_Leachman(String hydrogenType)
      method to get Leachman density of a phase using the Leachman EoS.
      Specified by:
      getDensity_Leachman in interface PhaseInterface
      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_Leachman in interface PhaseInterface
      Returns:
      density with unit kg/m3
    • getProperties_Leachman

      public double[] getProperties_Leachman(String hydrogenType)

      method to get Leachman properties of a phase using the Leachman EoS.

      Specified by:
      getProperties_Leachman in interface PhaseInterface
      Parameters:
      hydrogenType - a String object
      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_Leachman in interface PhaseInterface
      Returns:
      density with unit kg/m3
    • getAlpha0_Leachman

      public org.netlib.util.doubleW[] getAlpha0_Leachman(String hydrogenType)

      method to get Leachman a0matrix of a phase using the Leachman EoS.

      Specified by:
      getAlpha0_Leachman in interface PhaseInterface
      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_Leachman in interface PhaseInterface
      Returns:
      matrix of the reduced ideal helmholtz free energy and its derivatives
    • getAlphares_Leachman

      public org.netlib.util.doubleW[][] getAlphares_Leachman(String hydrogenType)

      method to get Leachman armatrix of a phase using the Leachman EoS.

      Specified by:
      getAlphares_Leachman in interface PhaseInterface
      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_Leachman in interface PhaseInterface
      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_AGA8 in interface PhaseInterface
      Returns:
      density with unit kg/m3
    • getFlowRate

      public double getFlowRate(String flowunit)
      method to return flow rate of a phase.
      Specified by:
      getFlowRate in interface PhaseInterface
      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

      public String getThermoPropertyModelName()

      Getter for the field thermoPropertyModelName.

      Returns:
      a String object
    • getCompressibilityX

      public double getCompressibilityX()

      getCompressibilityX.

      Specified by:
      getCompressibilityX in interface PhaseInterface
      Returns:
      a double
    • getCompressibilityY

      public double getCompressibilityY()

      getCompressibilityY.

      Specified by:
      getCompressibilityY in interface PhaseInterface
      Returns:
      a double
    • getIsothermalCompressibility

      public double getIsothermalCompressibility()

      getIsothermalCompressibility.

      Specified by:
      getIsothermalCompressibility in interface PhaseInterface
      Returns:
      a double
    • getIsobaricThermalExpansivity

      public double getIsobaricThermalExpansivity()

      getIsobaricThermalExpansivity.

      Specified by:
      getIsobaricThermalExpansivity in interface PhaseInterface
      Returns:
      a double
    • getModelName

      public String getModelName()
      method to return name of thermodynamic model.
      Specified by:
      getModelName in interface PhaseInterface
      Returns:
      String model name
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object