Class PhaseElectrolyteCPAAdvanced

All Implemented Interfaces:
Serializable, Cloneable, PhaseCPAInterface, PhaseEosInterface, PhaseInterface, ThermodynamicConstantsInterface

public class PhaseElectrolyteCPAAdvanced extends PhaseElectrolyteCPAstatoil
Phase class for the e-CPA-Advanced electrolyte equation of state.

Implements an advanced electrolyte CPA model with the following Helmholtz energy contributions:

A_res = A_SRK + A_CPA + A_DH + A_Born_adv + A_SR_adv + A_IP

Key improvements over the standard e-CPA model:

  • Ion-specific short-range parameters (W) instead of universal linear correlations
  • Temperature-dependent Born radii with physical constraints from hydration data
  • Quadratic temperature dependence in short-range interaction energies
  • Ion-pair formation for 2:2 and select 2:1 electrolyte systems

References

  • Maribo-Mogensen et al., Ind. Eng. Chem. Res. 2012, 51, 5353-5363
  • Furst and Renon, AIChE J. 1993, 39(2), 335-343
  • Born, Z. Physik 1920, 1, 45-48
  • Debye and Huckel, Phys. Z. 1923, 24, 185-206
Version:
1.0
Author:
Even Solbraa
See Also:
  • Field Details

    • serialVersionUID

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

      private static final org.apache.logging.log4j.Logger logger
      Logger object for class.
    • advSROn

      private double advSROn
      Flag to enable/disable the advanced short-range term. Disabled by default until ion-specific W parameters are fitted in the correct NeqSim unit system (wij ~ 1e-5).
    • advBornOn

      private double advBornOn
      Flag to enable/disable the phase-level Born replacement. Disabled because the advanced Born radii are now applied through the component-level XBorni override and the overridden calcBornX() method, which makes the parent's Born term automatically use advanced radii.
    • ionPairOn

      private double ionPairOn
      Flag to enable/disable ion-pair formation.
    • fAdvSR

      private double fAdvSR
      Cached advanced short-range Helmholtz energy and derivatives.
    • fAdvSRdT

      private double fAdvSRdT
    • fAdvSRdV

      private double fAdvSRdV
    • fAdvSRdTdT

      private double fAdvSRdTdT
    • fAdvSRdTdV

      private double fAdvSRdTdV
    • fAdvSRdVdV

      private double fAdvSRdVdV
    • fAdvSRdVdVdV

      private double fAdvSRdVdVdV
    • fAdvBorn

      private double fAdvBorn
      Cached advanced Born solvation energy and derivatives.
    • fAdvBorndT

      private double fAdvBorndT
    • fAdvBorndTdT

      private double fAdvBorndTdT
    • ionPairFractionReduction

      private double ionPairFractionReduction
      Ion-pair correction to ionic strength.
  • Constructor Details

    • PhaseElectrolyteCPAAdvanced

      public PhaseElectrolyteCPAAdvanced()
      Constructor for PhaseElectrolyteCPAAdvanced.
  • Method Details

    • addComponent

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

      Add component to component array and update moles variables.

      Specified by:
      addComponent in interface PhaseInterface
      Overrides:
      addComponent in class PhaseElectrolyteCPAstatoil
      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.
    • clone

      clone.

      Specified by:
      clone in interface PhaseInterface
      Overrides:
      clone in class PhaseElectrolyteCPAstatoil
      Returns:
      a PhaseInterface object
    • calcBornX

      public double calcBornX()
      Calculate the Born X parameter using advanced Born cavity radii.

      The parent implementation hardcodes bornX = sum(n_i * z_i^2 / sigma_i), using the Lennard-Jones diameter. This override computes bornX directly from the temperature-dependent Born cavity radii in IonParametersAdvanced, without depending on component Finit() having been called (avoiding the init-order chicken-and-egg problem).

      For ions without advanced parameters, the calculation falls back to the parent's formula using the Lennard-Jones diameter.

      Overrides:
      calcBornX in class PhaseModifiedFurstElectrolyteEos
      Returns:
      bornX sum for the phase
    • calcWi

      public double calcWi(int compNumb, PhaseInterface phase, double temperature, double pressure, int numbcomp)
      Calculate the composition-weighted short-range interaction parameter for a component using ion-specific parameters from IonParametersAdvanced.

      For ions with advanced parameters, this replaces the universal linear correlation (W = a*sigma + b) with ion-specific W(T) = W0 + WT*(T-298.15) + WTT*(T-298.15)^2 for their interaction with water. For non-water solvents and ions without advanced parameters, the parent mixing rule is used.

      Overrides:
      calcWi in class PhaseModifiedFurstElectrolyteEos
      Parameters:
      compNumb - component index
      phase - phase object
      temperature - temperature in Kelvin
      pressure - pressure in bara
      numbcomp - number of components
      Returns:
      composition-weighted W parameter for component compNumb
    • calcWiT

      public double calcWiT(int compNumb, PhaseInterface phase, double temperature, double pressure, int numbcomp)
      Calculate the temperature derivative of the composition-weighted short-range interaction parameter using ion-specific parameters from IonParametersAdvanced.
      Overrides:
      calcWiT in class PhaseModifiedFurstElectrolyteEos
      Parameters:
      compNumb - component index
      phase - phase object
      temperature - temperature in Kelvin
      pressure - pressure in bara
      numbcomp - number of components
      Returns:
      temperature derivative of composition-weighted W parameter
    • volInit

      public void volInit()
      Initialize volume-dependent quantities including advanced terms.
      Overrides:
      volInit in class PhaseModifiedFurstElectrolyteEos
    • calcAdvancedSRTerms

      private void calcAdvancedSRTerms()
      Calculate the advanced short-range term and all required derivatives.

      This replaces the universal SR correlation with ion-specific parameters from IonParametersAdvanced. The term accounts for non-electrostatic ion-solvent interactions including hydration effects, cavity formation, and dispersion forces.

    • calcAdvancedBornTerms

      private void calcAdvancedBornTerms()
      Calculate the advanced Born solvation term with temperature-dependent Born radii.

      This extends the standard Born term by allowing Born radii to vary with temperature. The physical basis is that the ion-solvent cavity expands with temperature as the hydration shell becomes more loosely structured.

      All values are in reduced form (divided by RT) consistent with NeqSim conventions.

    • calcIonPairReduction

      private void calcIonPairReduction()
      Calculate ion-pair formation and its effect on ionic strength.

      For 2:2 electrolyte pairs (e.g., MgSO4, CaSO4), explicit ion-pair formation reduces the effective number of free ions. This correction is applied to the long-range (DH) term by reducing the ion concentration used in the shielding parameter calculation.

    • getF

      public double getF()

      getF.

      Overrides:
      getF in class PhaseElectrolyteCPA
      Returns:
      a double
    • dFdT

      public double dFdT()

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

      Specified by:
      dFdT in interface PhaseInterface
      Overrides:
      dFdT in class PhaseElectrolyteCPA
      Returns:
      a double
    • dFdTdT

      public double dFdTdT()

      dFdTdT.

      Specified by:
      dFdTdT in interface PhaseInterface
      Overrides:
      dFdTdT in class PhaseElectrolyteCPA
      Returns:
      a double
    • dFdV

      public double dFdV()

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

      Specified by:
      dFdV in interface PhaseInterface
      Overrides:
      dFdV in class PhaseElectrolyteCPA
      Returns:
      a double
    • dFdVdV

      public double dFdVdV()

      dFdVdV.

      Specified by:
      dFdVdV in interface PhaseInterface
      Overrides:
      dFdVdV in class PhaseElectrolyteCPA
      Returns:
      a double
    • dFdVdVdV

      public double dFdVdVdV()

      dFdVdVdV.

      Overrides:
      dFdVdVdV in class PhaseElectrolyteCPA
      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
      Overrides:
      dFdTdV in class PhaseElectrolyteCPA
      Returns:
      a double
    • setAdvancedSROn

      public void setAdvancedSROn(double on)
      Enable or disable the advanced short-range term.
      Parameters:
      on - 1.0 to enable, 0.0 to disable
    • setAdvancedBornOn

      public void setAdvancedBornOn(double on)
      Enable or disable the advanced Born term.
      Parameters:
      on - 1.0 to enable, 0.0 to disable
    • setIonPairOn

      public void setIonPairOn(double on)
      Enable or disable ion-pair formation.
      Parameters:
      on - 1.0 to enable, 0.0 to disable
    • getIonPairFractionReduction

      public double getIonPairFractionReduction()
      Get the fraction of ions forming ion pairs.
      Returns:
      ion pair fraction reduction (0 to 0.95)
    • getAdvancedBornEnergy

      public double getAdvancedBornEnergy()
      Get the advanced Born solvation contribution to Helmholtz energy.
      Returns:
      F_Born_adv
    • getAdvancedSREnergy

      public double getAdvancedSREnergy()
      Get the advanced short-range contribution to Helmholtz energy.
      Returns:
      F_SR_adv