Class ComponentGePitzer

All Implemented Interfaces:
Serializable, Cloneable, ComponentGEInterface, ComponentInterface, ThermodynamicConstantsInterface

public class ComponentGePitzer extends ComponentGE
Component class for the Pitzer model.
Author:
Even Solbraa
See Also:
  • Field Details

    • serialVersionUID

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

    • ComponentGePitzer

      public ComponentGePitzer(String name, double moles, double molesInPhase, int compIndex)
      Constructor for ComponentGePitzer.
      Parameters:
      name - Name of component
      moles - total number of moles
      molesInPhase - moles in phase
      compIndex - component index
  • Method Details

    • fugcoef

      public double fugcoef(PhaseInterface phase)

      Calculate, set and return fugacity coefficient.

      Specified by:
      fugcoef in interface ComponentInterface
      Overrides:
      fugcoef in class ComponentGE
      Parameters:
      phase - a PhaseInterface object to get fugacity coefficient of.
      Returns:
      Fugacity coefficient
    • getGamma

      public double getGamma(PhaseInterface phase, int numberOfComponents, double temperature, double pressure, PhaseType pt, double[][] HValpha, double[][] HVgij, double[][] intparam, String[][] mixRule)

      getGamma.

      Parameters:
      phase - a PhaseInterface object
      numberOfComponents - a int
      temperature - a double
      pressure - a double
      pt - the PhaseType of the phase
      HValpha - an array of type double
      HVgij - an array of type double
      intparam - an array of type double
      mixRule - an array of String objects
      Returns:
      a double
    • getGamma

      public double getGamma(PhaseInterface phase, int numberOfComponents, double temperature, double pressure, PhaseType pt)
      Calculate activity coefficient using the Pitzer model.

      For ions (charge != 0): computes the single-ion activity coefficient from the Pitzer Debye-Huckel term and binary cation-anion interaction parameters. For the solvent (water, referenceStateType = "solvent"): computes the activity coefficient from the Pitzer osmotic coefficient using the Harvie and Weare (1980) mixed-electrolyte framework. For other neutral species (dissolved gases): returns gamma = 1.0 (no lambda/mu parameters available).

      Parameters:
      phase - phase object
      numberOfComponents - number of components in phase
      temperature - temperature in Kelvin
      pressure - pressure in bara
      pt - phase type
      Returns:
      activity coefficient (dimensionless)
    • getWaterGamma

      private double getWaterGamma(PhaseInterface phase, int numberOfComponents, double TK)
      Compute the water (solvent) activity coefficient from the Pitzer osmotic coefficient.

      Uses the Harvie and Weare (1980) mixed-electrolyte framework for the osmotic coefficient:

      phi - 1 = (2 / sum_m) * [-Aphi * I^(3/2) / (1 + b*sqrt(I))
                 + sum_c sum_a m_c * m_a * (Bphi_ca + Z * C_ca)]
      

      Water activity: ln(a_w) = -phi * M_w * sum_m / 1000

      Activity coefficient (Raoult convention): gamma_w = a_w / x_w

      Parameters:
      phase - the Pitzer phase
      numberOfComponents - number of components
      TK - temperature in Kelvin
      Returns:
      water activity coefficient (mole fraction basis, Raoult convention)
    • getMolality

      public double getMolality(PhaseInterface phase)

      getMolality.

      Specified by:
      getMolality in interface ComponentInterface
      Overrides:
      getMolality in class Component
      Parameters:
      phase - a PhaseInterface object
      Returns:
      a double
    • debyeHuckelAphi

      private double debyeHuckelAphi(double TK)
      Calculates the Pitzer Debye-Hückel Aphi parameter as a function of temperature.

      Uses the Bradley-Pitzer (1979) correlation for the osmotic coefficient Debye-Hückel parameter. The Aphi value is in ln-based units (Aphi = Agamma/3). Water density uses the IAPWS simplified equation valid at pressures typical for oilfield brine (liquid state).

      Parameters:
      TK - temperature in Kelvin
      Returns:
      Aphi in ln-based units (dimensionless)