Class PhasePitzer

All Implemented Interfaces:
Serializable, Cloneable, PhaseGEInterface, PhaseInterface, ThermodynamicConstantsInterface

public class PhasePitzer extends PhaseGE
Phase implementation for the Pitzer activity coefficient model.
Author:
esol
See Also:
  • Field Details

    • serialVersionUID

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

      private double[][] beta0
    • beta1

      private double[][] beta1
    • cphi

      private double[][] cphi
  • Constructor Details

    • PhasePitzer

      public PhasePitzer()
      Constructor for PhasePitzer.
  • Method Details

    • 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.
    • getExcessGibbsEnergy

      public double getExcessGibbsEnergy(PhaseInterface phase, int numberOfComponents, double temperature, double pressure, PhaseType pt)

      getExcessGibbsEnergy.

      Parameters:
      phase - a PhaseInterface object
      numberOfComponents - a int
      temperature - a double
      pressure - a double
      pt - the PhaseType of the phase
      Returns:
      a double
    • setMixingRule

      public void setMixingRule(MixingRuleTypeInterface mr)

      setMixingRule.

      Specified by:
      setMixingRule in interface PhaseInterface
      Overrides:
      setMixingRule in class PhaseGE
      Parameters:
      mr - a MixingRuleTypeInterface
    • setAlpha

      public void setAlpha(double[][] alpha)

      setAlpha.

      Parameters:
      alpha - an array of type double
    • setDij

      public void setDij(double[][] Dij)

      setDij.

      Parameters:
      Dij - an array of type double
    • setDijT

      public void setDijT(double[][] DijT)

      setDijT.

      Parameters:
      DijT - an array of type double
    • setBinaryParameters

      public void setBinaryParameters(int i, int j, double b0, double b1, double c)
      Set binary Pitzer parameters.
      Parameters:
      i - component i
      j - component j
      b0 - beta0 parameter
      b1 - beta1 parameter
      c - cPhi parameter
    • getBeta0ij

      public double getBeta0ij(int i, int j)
      Get beta0 parameter.
      Parameters:
      i - component index i
      j - component index j
      Returns:
      beta0 parameter for components i and j
    • getBeta1ij

      public double getBeta1ij(int i, int j)
      Get beta1 parameter.
      Parameters:
      i - component index i
      j - component index j
      Returns:
      beta1 parameter for components i and j
    • getCphiij

      public double getCphiij(int i, int j)
      Get Cphi parameter.
      Parameters:
      i - component index i
      j - component index j
      Returns:
      Cphi parameter for components i and j
    • getIonicStrength

      public double getIonicStrength()
      Calculate ionic strength.
      Returns:
      ionic strength
    • getSolventWeight

      public double getSolventWeight()
      Get mass of solvent in kilograms.
      Returns:
      solvent mass
    • getActivityCoefficient

      public double getActivityCoefficient(int k)

      getActivityCoefficient.

      Specified by:
      getActivityCoefficient in interface PhaseInterface
      Overrides:
      getActivityCoefficient in class PhaseGE
      Parameters:
      k - a int
      Returns:
      a double
    • 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.
    • getHresTP

      public double getHresTP()

      getHresTP.

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

      public double getHresdP()

      getHresdP.

      Overrides:
      getHresdP in class Phase
      Returns:
      a double
    • getSresTV

      public double getSresTV()

      getSresTV.

      Overrides:
      getSresTV 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
    • getCpres

      public double getCpres()

      getCpres.

      Calculates the excess heat capacity via finite-difference temperature derivatives of the activity coefficients. In the current implementation the Pitzer binary parameters are temperature independent, so the residual contribution evaluates to zero.

      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
    • getCp

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

      public double getCv()
      method to return specific heat capacity (Cv).
      Specified by:
      getCv in interface PhaseInterface
      Overrides:
      getCv in class PhaseGE
      Returns:
      Cv in unit J/K