Class PhaseIdealGas

java.lang.Object
neqsim.thermo.phase.Phase
neqsim.thermo.phase.PhaseIdealGas
All Implemented Interfaces:
Serializable, Cloneable, PhaseInterface, ThermodynamicConstantsInterface

public class PhaseIdealGas extends Phase
Phase model for an ideal gas. Compressibility is fixed to unity and thermodynamic properties are calculated from ideal-gas relations.
Author:
esol
See Also:
  • Field Details

  • Constructor Details

    • PhaseIdealGas

      public PhaseIdealGas()

      Constructor for PhaseIdealGas.

  • Method Details

    • getZ

      public double getZ()

      getZ.

      Specified by:
      getZ in interface PhaseInterface
      Overrides:
      getZ in class Phase
      Returns:
      a double
    • clone

      public PhaseIdealGas clone()

      clone.

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

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

      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.
      compNumber - Index number of component in phase object component array.
    • getMixingRule

      public EosMixingRulesInterface getMixingRule()

      getMixingRule.

      Returns:
      a EosMixingRulesInterface 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
      Overrides:
      init in class Phase
      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.
    • setMixingRuleGEModel

      public void setMixingRuleGEModel(String name)

      setMixingRuleGEModel.

      Parameters:
      name - a String object
    • setMixingRule

      public void setMixingRule(MixingRuleTypeInterface mr)

      setMixingRule.

      Parameters:
      mr - a MixingRuleTypeInterface object
    • resetMixingRule

      public void resetMixingRule(MixingRuleTypeInterface mr)

      resetMixingRule.

      Parameters:
      mr - a int
    • molarVolume

      public double molarVolume(double pressure, double temperature, double A, double B, PhaseType pt) throws IsNaNException, TooManyIterationsException

      molarVolume.

      Parameters:
      pressure - a double
      temperature - a double
      A - a double
      B - a double
      pt - the PhaseType of the phase
      Returns:
      a double
      Throws:
      IsNaNException - if any.
      TooManyIterationsException - if any.
    • updateMolarVolume

      private void updateMolarVolume()
    • setTemperature

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

      public void setPressure(double pres)

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

      Specified by:
      setPressure in interface PhaseInterface
      Overrides:
      setPressure in class Phase
      Parameters:
      pres - a double
    • getDensity

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

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

      public double getCpres()

      getCpres.

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

      public double getCvres()

      getCvres.

      Overrides:
      getCvres in class Phase
      Returns:
      a double
    • getHresTP

      public double getHresTP()

      getHresTP.

      Specified by:
      getHresTP in interface PhaseInterface
      Overrides:
      getHresTP in class Phase
      Returns:
      a double
    • getSresTP

      public double getSresTP()

      getSresTP.

      Specified by:
      getSresTP in interface PhaseInterface
      Overrides:
      getSresTP in class Phase
      Returns:
      a double
    • getJouleThomsonCoefficient

      public double getJouleThomsonCoefficient()
      Get the Joule Thomson Coefficient of a phase.
      Specified by:
      getJouleThomsonCoefficient in interface PhaseInterface
      Overrides:
      getJouleThomsonCoefficient in class Phase
      Returns:
      Joule Thomson coefficient in K/bar