Class CPAContribution

java.lang.Object
neqsim.thermo.phase.CPAContribution
All Implemented Interfaces:
Serializable

public class CPAContribution extends Object implements Serializable
CPAContribution provides utility methods for CPA (Cubic Plus Association) calculations that are common across different cubic EOS implementations (SRK-CPA, PR-CPA, UMR-CPA, etc.).

In CPA theory, the radial distribution function at contact is based on the Carnahan-Starling hard-sphere model and is the same for all cubic equations of state. The formulas depend only on the co-volume parameter (b) and volume, not on the attraction parameter (a) which differs between SRK and PR.

This class provides methods for calculating the radial distribution function and its volume derivatives, which can be used for verification and comparison between different CPA implementations.

Version:
1.0
Author:
Even Solbraa
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) static org.apache.logging.log4j.Logger
    Logger object for class.
    private final PhaseEos
    Reference to the parent phase.
    private static final long
    Serialization version UID.
    (package private) double
    Temporary molar volume storage.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor for CPAContribution.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Calculate radial distribution function g at contact.
    double
    Calculate first volume derivative of ln(g).
    double
    Calculate second volume derivative of ln(g).
    double
    Calculate third volume derivative of ln(g).
    static double
    calcG(double molarVolume, double molarB)
    Calculate radial distribution function g given molar volume and molar b parameter.
    static double
    calcLngV(double totalVolume, double totalB)
    Calculate first volume derivative of ln(g).

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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.
    • phase

      private final PhaseEos phase
      Reference to the parent phase. Must be a PhaseEos subclass.
    • tempTotVol

      double tempTotVol
      Temporary molar volume storage.
  • Constructor Details

    • CPAContribution

      public CPAContribution(PhaseEos phase)
      Constructor for CPAContribution.
      Parameters:
      phase - the parent EOS phase that this CPA contribution belongs to
  • Method Details

    • calc_g

      public double calc_g()
      Calculate radial distribution function g at contact.

      Uses the simplified Carnahan-Starling expression: g = (2 - η/2) / (2 * (1 - η/2)³) where η = b/(4V) is the packing fraction.

      Returns:
      g value
    • calc_lngV

      public double calc_lngV()
      Calculate first volume derivative of ln(g).
      Returns:
      d(ln g)/dV
    • calc_lngVV

      public double calc_lngVV()
      Calculate second volume derivative of ln(g).
      Returns:
      d²(ln g)/dV²
    • calc_lngVVV

      public double calc_lngVVV()
      Calculate third volume derivative of ln(g).
      Returns:
      d³(ln g)/dV³
    • calcG

      public static double calcG(double molarVolume, double molarB)
      Calculate radial distribution function g given molar volume and molar b parameter.

      This is a static utility method for standalone calculations.

      Parameters:
      molarVolume - molar volume in m³/mol
      molarB - molar co-volume parameter b in m³/mol
      Returns:
      g value
    • calcLngV

      public static double calcLngV(double totalVolume, double totalB)
      Calculate first volume derivative of ln(g).
      Parameters:
      totalVolume - total volume in m³
      totalB - total co-volume parameter B in m³
      Returns:
      d(ln g)/dV