Skip to content

Property packages

One object that owns phase equilibrium and energy for a set of components: the PropertyPackage protocol and its cubic, gamma-phi, PC-SAFT, and reference-fluid implementations, plus the generic two-phase properties and energy-specified flashes built on top of them.

See the property-packages guide for the concepts and worked examples.

package

Property packages: one object that owns phase equilibrium and energy.

A process simulator needs two things from its thermodynamics: "what splits?" (fugacities, K-values, flashes) and "how much energy?" (enthalpy, entropy, volume). The equilibrium models in fugacio.thermo.phase answer the first question for the cubic, gamma-phi, and PC-SAFT routes, but the energy side of the engine was, until now, wired to the cubic equation of state alone: a heater, a mixer, an isentropic compressor, or a column energy balance could only be evaluated on Peng-Robinson or SRK. A PropertyPackage closes that gap. It is the single interface every energy-balanced unit operation consumes, and it is implemented for all four method classes Fugacio carries:

  • CubicPackage: phi-phi on a cubic EOS (PR, SRK, RK, vdW), the default;
  • GammaPhiPackage: an activity-coefficient liquid (NRTL, UNIQUAC, Wilson, UNIFAC, ...) with an ideal or EOS vapour. Its liquid enthalpy is the pure-liquid enthalpies plus the excess enthalpy obtained by automatic differentiation of the excess Gibbs energy (Gibbs-Helmholtz), so heat of mixing comes for free and stays consistent with the activity coefficients themselves;
  • SAFTPackage: PC-SAFT with Wertheim association, residual properties from the temperature derivatives of the residual Helmholtz energy;
  • HelmholtzPackage: a pure reference fluid (IAPWS-95 water, Span-Wagner CO2, ...) wrapped as a one-component package, so steam and refrigerant loops can be simulated with reference-grade properties inside the same flowsheet engine.

Every package exposes the same calls: single-phase ln_phi / enthalpy / entropy / volume at (T, P, x), the isothermal flash_pt and the four saturation calculations, and (implemented once, generically, on top of those) the two-phase-aware mixture_enthalpy / mixture_entropy / mixture_volume and the energy-specified flash_ph / flash_ps / flash_tv. Packages are registered JAX pytrees whose model parameters are differentiable leaves, so a flowsheet built on any of them is differentiable with respect to the thermodynamic parameters as well as the operating conditions.

Every package also satisfies the fugacio.thermo.phase.EquilibriumModel protocol, so it can be passed anywhere an equilibrium model is accepted.

Enthalpy and entropy are relative to the ideal-gas reference at T_REF / P_REF (the reference state of fugacio.thermo.properties), except for HelmholtzPackage, whose reference is the one built into the published formulation. Only differences are physical, and any consistent reference cancels in a balance, so do not mix packages with different references across one energy balance.

Classes:

Name Description
EnergySolveResult

A PH/PS flash state and its independently verified solve report.

PropertyPackage

Structural type of a property package (equilibrium + energy + volume).

CubicPackage

Phi-phi property package on a cubic equation of state.

GammaPhiPackage

Gamma-phi property package: activity-coefficient liquid, ideal or EOS vapour.

SAFTPackage

PC-SAFT property package (phi-phi on the molecular equation of state).

HelmholtzPackage

One-component package on a reference multiparameter Helmholtz EOS.

Functions:

Name Description
excess_enthalpy

Excess (mixing) enthalpy h^E = -R T^2 d(g^E/RT)/dT (J/mol) by autodiff.

excess_entropy

Excess entropy s^E = (h^E - g^E) / T (J/mol/K).

cubic_package

Construct a CubicPackage from component constants and Cp coefficients.

gamma_phi_package

Construct a GammaPhiPackage from an activity model and component constants.

saft_package

Construct a SAFTPackage from PC-SAFT parameters, seeding constants, and Cp.

helmholtz_package

Wrap a reference fluid as a one-component HelmholtzPackage.

energy_flash_report

Verify an energy flash independently from its temperature iteration.

flash_ph_with_info

PH flash and an independent material/enthalpy verification report.

flash_ps_with_info

PS flash and an independent material/entropy verification report.

EnergySolveResult

Bases: NamedTuple

A PH/PS flash state and its independently verified solve report.

PropertyPackage

Bases: Protocol

Structural type of a property package (equilibrium + energy + volume).

Implementations bundle their component constants and model parameters, so callers pass only the state (T, P, composition). phase is "liquid" or "vapor" and selects the phase branch to evaluate.

Methods:

Name Description
ln_phi

Log fugacity coefficients ln phi_i of the phase at (T, P, x).

enthalpy

Single-phase molar enthalpy (J/mol).

entropy

Single-phase molar entropy (J/mol/K).

volume

Single-phase molar volume (m^3/mol).

flash_pt

Isothermal-isobaric two-phase flash.

bubble_pressure

Bubble pressure and incipient vapour (P, y) at fixed T, x.

dew_pressure

Dew pressure and incipient liquid (P, x) at fixed T, y.

bubble_temperature

Bubble temperature and incipient vapour (T, y) at fixed P, x.

dew_temperature

Dew temperature and incipient liquid (T, x) at fixed P, y.

k_values

Equilibrium ratios K_i = phi_i^L(x) / phi_i^V(y).

k_seed

Composition-light K-value estimate used to initialise staged solvers.

mixture_enthalpy

Two-phase-aware molar enthalpy of a feed z at (T, P) (J/mol).

mixture_entropy

Two-phase-aware molar entropy of a feed z at (T, P) (J/mol/K).

mixture_volume

Two-phase-aware molar volume of a feed z at (T, P) (m^3/mol).

flash_ph

Isenthalpic flash: the temperature (and split) at which H = h.

flash_ps

Isentropic flash: the temperature (and split) at which S = s.

signature

Hashable description of the package structure (not its values).

Attributes:

Name Type Description
n_components int

Number of components the package describes.

n_components property

n_components: int

Number of components the package describes.

ln_phi

ln_phi(
    t: ArrayLike, p: ArrayLike, x: Array, *, phase: str
) -> Array

Log fugacity coefficients ln phi_i of the phase at (T, P, x).

enthalpy

enthalpy(
    t: ArrayLike, p: ArrayLike, x: Array, *, phase: str
) -> Array

Single-phase molar enthalpy (J/mol).

entropy

entropy(
    t: ArrayLike, p: ArrayLike, x: Array, *, phase: str
) -> Array

Single-phase molar entropy (J/mol/K).

volume

volume(
    t: ArrayLike, p: ArrayLike, x: Array, *, phase: str
) -> Array

Single-phase molar volume (m^3/mol).

flash_pt

flash_pt(
    t: ArrayLike, p: ArrayLike, z: Array
) -> FlashResult

Isothermal-isobaric two-phase flash.

bubble_pressure

bubble_pressure(
    t: ArrayLike, x: Array
) -> tuple[Array, Array]

Bubble pressure and incipient vapour (P, y) at fixed T, x.

dew_pressure

dew_pressure(t: ArrayLike, y: Array) -> tuple[Array, Array]

Dew pressure and incipient liquid (P, x) at fixed T, y.

bubble_temperature

bubble_temperature(
    p: ArrayLike, x: Array
) -> tuple[Array, Array]

Bubble temperature and incipient vapour (T, y) at fixed P, x.

dew_temperature

dew_temperature(
    p: ArrayLike, y: Array
) -> tuple[Array, Array]

Dew temperature and incipient liquid (T, x) at fixed P, y.

k_values

k_values(
    t: ArrayLike, p: ArrayLike, x: Array, y: Array
) -> Array

Equilibrium ratios K_i = phi_i^L(x) / phi_i^V(y).

k_seed

k_seed(t: ArrayLike, p: ArrayLike, x: Array) -> Array

Composition-light K-value estimate used to initialise staged solvers.

mixture_enthalpy

mixture_enthalpy(
    t: ArrayLike, p: ArrayLike, z: Array
) -> Array

Two-phase-aware molar enthalpy of a feed z at (T, P) (J/mol).

mixture_entropy

mixture_entropy(
    t: ArrayLike, p: ArrayLike, z: Array
) -> Array

Two-phase-aware molar entropy of a feed z at (T, P) (J/mol/K).

mixture_volume

mixture_volume(
    t: ArrayLike, p: ArrayLike, z: Array
) -> Array

Two-phase-aware molar volume of a feed z at (T, P) (m^3/mol).

flash_ph

flash_ph(
    p: ArrayLike,
    h: ArrayLike,
    z: Array,
    *,
    t_init: ArrayLike = 300.0,
    t_min: float = 50.0,
    t_max: float = 1500.0,
    tol: float = 1e-08,
    max_iter: int = 100,
) -> EnergyFlashResult

Isenthalpic flash: the temperature (and split) at which H = h.

flash_ps

flash_ps(
    p: ArrayLike,
    s: ArrayLike,
    z: Array,
    *,
    t_init: ArrayLike = 300.0,
    t_min: float = 50.0,
    t_max: float = 1500.0,
    tol: float = 1e-08,
    max_iter: int = 100,
) -> EnergyFlashResult

Isentropic flash: the temperature (and split) at which S = s.

signature

signature() -> tuple[Any, ...]

Hashable description of the package structure (not its values).

CubicPackage dataclass

CubicPackage(
    tc: Array,
    pc: Array,
    omega: Array,
    cp: CpCoeffs,
    kij: Array | None = None,
    eos: CubicEOS = PR,
    component_names: tuple[str, ...] = (),
    evidence: PackageEvidence = PackageEvidence(),
)

Bases: _PackageBase

Phi-phi property package on a cubic equation of state.

Attributes:

Name Type Description
tc Array

Critical temperatures (K).

pc Array

Critical pressures (Pa).

omega Array

Acentric factors.

cp CpCoeffs

Ideal-gas heat-capacity coefficient arrays (a, b, c, d, e).

kij Array | None

Binary interaction matrix (None means zeros).

eos CubicEOS

Cubic equation of state (static; default Peng-Robinson).

Methods:

Name Description
signature

Class, component count, cubic, and whether a kij matrix is present.

ln_phi

Log fugacity coefficients from the cubic EOS.

enthalpy

Ideal-gas enthalpy plus the cubic residual enthalpy (J/mol).

entropy

Ideal-gas entropy (with mixing) plus the cubic residual entropy (J/mol/K).

volume

Molar volume Z R T / P on the requested cubic root (m^3/mol).

flash_pt

Isothermal-isobaric two-phase flash via the cubic EOS.

bubble_pressure

Bubble pressure and incipient vapour at fixed T, x.

dew_pressure

Dew pressure and incipient liquid at fixed T, y.

stability

Michelsen tangent-plane stability of feed z at (T, P).

n_components property

n_components: int

Number of components.

signature

signature() -> tuple[Any, ...]

Class, component count, cubic, and whether a kij matrix is present.

ln_phi

ln_phi(
    t: ArrayLike, p: ArrayLike, x: Array, *, phase: str
) -> Array

Log fugacity coefficients from the cubic EOS.

enthalpy

enthalpy(
    t: ArrayLike, p: ArrayLike, x: Array, *, phase: str
) -> Array

Ideal-gas enthalpy plus the cubic residual enthalpy (J/mol).

entropy

entropy(
    t: ArrayLike, p: ArrayLike, x: Array, *, phase: str
) -> Array

Ideal-gas entropy (with mixing) plus the cubic residual entropy (J/mol/K).

volume

volume(
    t: ArrayLike, p: ArrayLike, x: Array, *, phase: str
) -> Array

Molar volume Z R T / P on the requested cubic root (m^3/mol).

flash_pt

flash_pt(
    t: ArrayLike, p: ArrayLike, z: Array
) -> FlashResult

Isothermal-isobaric two-phase flash via the cubic EOS.

bubble_pressure

bubble_pressure(
    t: ArrayLike, x: Array
) -> tuple[Array, Array]

Bubble pressure and incipient vapour at fixed T, x.

dew_pressure

dew_pressure(t: ArrayLike, y: Array) -> tuple[Array, Array]

Dew pressure and incipient liquid at fixed T, y.

stability

stability(
    t: ArrayLike, p: ArrayLike, z: Array
) -> StabilityResult

Michelsen tangent-plane stability of feed z at (T, P).

GammaPhiPackage dataclass

GammaPhiPackage(
    activity: ActivityModel,
    tc: Array,
    pc: Array,
    omega: Array,
    cp: CpCoeffs,
    kij: Array | None = None,
    eos: CubicEOS = PR,
    vapor: str = "ideal",
    poynting: bool = False,
    phi_saturation: bool = False,
    component_names: tuple[str, ...] = (),
    evidence: PackageEvidence = PackageEvidence(),
)

Bases: _PackageBase

Gamma-phi property package: activity-coefficient liquid, ideal or EOS vapour.

The liquid fugacity is x_i gamma_i f_i^{0,L}(T, P) (see fugacio.thermo.reference), expressed here as an effective liquid fugacity coefficient phi_i^L = gamma_i f_i^{0,L} / P so the package presents the same ln_phi interface as the phi-phi routes. The liquid enthalpy is

h^L(T, P, x) = sum_i x_i h_i^{L,pure}(T, P) + h^E(T, x)

with each pure-liquid enthalpy taken from the cubic EOS at that component's saturation point (plus the small v_i^L (P - Psat_i) pressure term that partners the Poynting factor) and the excess enthalpy from excess_enthalpy (autodiff Gibbs-Helmholtz on the activity model). The liquid entropy follows the same construction with the ideal entropy of mixing and s^E.

Components must be subcritical at the conditions of interest (the reference fugacity is saturation-based, the standard gamma-phi limitation).

Attributes:

Name Type Description
activity ActivityModel

Liquid activity-coefficient model (a differentiable pytree).

tc Array

Critical temperatures (K).

pc Array

Critical pressures (Pa).

omega Array

Acentric factors.

cp CpCoeffs

Ideal-gas heat-capacity coefficient arrays (a, b, c, d, e).

kij Array | None

Binary interaction matrix for an EOS vapour (None means zeros).

eos CubicEOS

Cubic EOS used for the saturation reference and, if selected, the vapour.

vapor str

"ideal" (phi^V = 1) or "eos" (static).

poynting bool

Include the Poynting correction in the reference (static).

phi_saturation bool

Include the saturation fugacity coefficient (static).

Methods:

Name Description
signature

Class, component count, activity-model class, and the static flags.

ln_phi

Effective ln phi: ln gamma + ln f^{0,L} - ln P (liquid) or the vapour model.

enthalpy

Liquid: pure saturated-liquid enthalpies plus h^E; vapour: ideal gas (+ EOS).

entropy

Liquid: saturated-liquid entropies, ideal mixing, s^E; vapour: ideal gas (+ EOS).

volume

Liquid: mole-fraction sum of pure saturated-liquid volumes; vapour: ideal gas or EOS.

flash_pt

Isothermal-isobaric gamma-phi flash.

k_seed

gamma_i(x) Psat_i / P: the modified Raoult K-values (ideal vapour).

bubble_pressure

Bubble pressure and incipient vapour at fixed T, x.

dew_pressure

Dew pressure and incipient liquid at fixed T, y.

bubble_temperature

Bubble temperature and incipient vapour at fixed P, x (native gamma-phi).

dew_temperature

Dew temperature and incipient liquid at fixed P, y (native gamma-phi solve).

n_components property

n_components: int

Number of components.

signature

signature() -> tuple[Any, ...]

Class, component count, activity-model class, and the static flags.

ln_phi

ln_phi(
    t: ArrayLike, p: ArrayLike, x: Array, *, phase: str
) -> Array

Effective ln phi: ln gamma + ln f^{0,L} - ln P (liquid) or the vapour model.

enthalpy

enthalpy(
    t: ArrayLike, p: ArrayLike, x: Array, *, phase: str
) -> Array

Liquid: pure saturated-liquid enthalpies plus h^E; vapour: ideal gas (+ EOS).

entropy

entropy(
    t: ArrayLike, p: ArrayLike, x: Array, *, phase: str
) -> Array

Liquid: saturated-liquid entropies, ideal mixing, s^E; vapour: ideal gas (+ EOS).

volume

volume(
    t: ArrayLike, p: ArrayLike, x: Array, *, phase: str
) -> Array

Liquid: mole-fraction sum of pure saturated-liquid volumes; vapour: ideal gas or EOS.

flash_pt

flash_pt(
    t: ArrayLike, p: ArrayLike, z: Array
) -> FlashResult

Isothermal-isobaric gamma-phi flash.

k_seed

k_seed(t: ArrayLike, p: ArrayLike, x: Array) -> Array

gamma_i(x) Psat_i / P: the modified Raoult K-values (ideal vapour).

bubble_pressure

bubble_pressure(
    t: ArrayLike, x: Array
) -> tuple[Array, Array]

Bubble pressure and incipient vapour at fixed T, x.

dew_pressure

dew_pressure(t: ArrayLike, y: Array) -> tuple[Array, Array]

Dew pressure and incipient liquid at fixed T, y.

bubble_temperature

bubble_temperature(
    p: ArrayLike,
    x: Array,
    *,
    t_min: float = 150.0,
    t_max: float = 700.0,
) -> tuple[Array, Array]

Bubble temperature and incipient vapour at fixed P, x (native gamma-phi).

dew_temperature

dew_temperature(
    p: ArrayLike,
    y: Array,
    *,
    t_min: float = 150.0,
    t_max: float = 700.0,
) -> tuple[Array, Array]

Dew temperature and incipient liquid at fixed P, y (native gamma-phi solve).

SAFTPackage dataclass

SAFTPackage(
    params: SaftParameters,
    tc: Array,
    pc: Array,
    omega: Array,
    cp: CpCoeffs,
    component_names: tuple[str, ...] = (),
    evidence: PackageEvidence = PackageEvidence(),
)

Bases: _PackageBase

PC-SAFT property package (phi-phi on the molecular equation of state).

Residual enthalpy and entropy come from the temperature derivatives of the reduced residual Helmholtz energy (fugacio.thermo.saft.properties), so association effects on the heat of mixing and vaporisation are captured.

Attributes:

Name Type Description
params SaftParameters

PC-SAFT parameter set (a differentiable pytree).

tc Array

Critical temperatures (K), used to seed the flash K-values.

pc Array

Critical pressures (Pa), used to seed the flash K-values.

omega Array

Acentric factors, used to seed the flash K-values.

cp CpCoeffs

Ideal-gas heat-capacity coefficient arrays (a, b, c, d, e).

Methods:

Name Description
signature

Class and component count.

ln_phi

Log fugacity coefficients on the PC-SAFT density branch phase.

enthalpy

Ideal-gas enthalpy plus the PC-SAFT residual enthalpy (J/mol).

entropy

Ideal-gas entropy (with mixing) plus the PC-SAFT residual entropy (J/mol/K).

volume

Molar volume 1 / rho on the requested density branch (m^3/mol).

flash_pt

Isothermal-isobaric two-phase flash via PC-SAFT.

bubble_pressure

Bubble pressure and incipient vapour at fixed T, x.

dew_pressure

Dew pressure and incipient liquid at fixed T, y.

stability

Michelsen tangent-plane stability of feed z at (T, P).

n_components property

n_components: int

Number of components.

signature

signature() -> tuple[Any, ...]

Class and component count.

ln_phi

ln_phi(
    t: ArrayLike, p: ArrayLike, x: Array, *, phase: str
) -> Array

Log fugacity coefficients on the PC-SAFT density branch phase.

enthalpy

enthalpy(
    t: ArrayLike, p: ArrayLike, x: Array, *, phase: str
) -> Array

Ideal-gas enthalpy plus the PC-SAFT residual enthalpy (J/mol).

entropy

entropy(
    t: ArrayLike, p: ArrayLike, x: Array, *, phase: str
) -> Array

Ideal-gas entropy (with mixing) plus the PC-SAFT residual entropy (J/mol/K).

volume

volume(
    t: ArrayLike, p: ArrayLike, x: Array, *, phase: str
) -> Array

Molar volume 1 / rho on the requested density branch (m^3/mol).

flash_pt

flash_pt(
    t: ArrayLike, p: ArrayLike, z: Array
) -> FlashResult

Isothermal-isobaric two-phase flash via PC-SAFT.

bubble_pressure

bubble_pressure(
    t: ArrayLike, x: Array
) -> tuple[Array, Array]

Bubble pressure and incipient vapour at fixed T, x.

dew_pressure

dew_pressure(t: ArrayLike, y: Array) -> tuple[Array, Array]

Dew pressure and incipient liquid at fixed T, y.

stability

stability(
    t: ArrayLike, p: ArrayLike, z: Array
) -> StabilityResult

Michelsen tangent-plane stability of feed z at (T, P).

HelmholtzPackage dataclass

HelmholtzPackage(
    fluid: HelmholtzFluid,
    component_names: tuple[str, ...] = (),
    evidence: PackageEvidence = PackageEvidence(),
)

Bases: _PackageBase

One-component package on a reference multiparameter Helmholtz EOS.

Wraps a fugacio.thermo.helmholtz.HelmholtzFluid (IAPWS-95 water, Span-Wagner CO2, ...) so a pure utility or working fluid can flow through the ordinary unit operations with reference-grade properties. Compositions are the one-element vector [1.0]; the "flash" is the saturation-line test of a pure substance (vapour fraction 0 or 1 away from the dome, the quality on it), and the energy flashes resolve directly to the steam-table state functions state_ph / state_ps.

Enthalpy and entropy carry the reference state of the published formulation (not the ideal-gas T_REF reference of the mixture packages).

Attributes:

Name Type Description
fluid HelmholtzFluid

The reference fluid.

Methods:

Name Description
signature

Class and fluid name.

ln_phi

Pure-fluid ln phi on the requested density branch, as a length-1 vector.

enthalpy

Molar enthalpy on the requested branch (J/mol).

entropy

Molar entropy on the requested branch (J/mol/K).

volume

Molar volume 1 / rho on the requested branch (m^3/mol).

flash_pt

Pure-fluid phase test: all vapour below Psat(T) (or above Tc), else liquid.

k_seed

Psat(T) / P as a length-1 vector.

mixture_enthalpy

Stable-branch molar enthalpy at (T, P) (J/mol).

mixture_entropy

Stable-branch molar entropy at (T, P) (J/mol/K).

mixture_volume

Stable-branch molar volume at (T, P) (m^3/mol).

flash_ph

Steam-table (P, h) state: saturation temperature and quality inside the dome.

flash_ps

Steam-table (P, s) state: saturation temperature and quality inside the dome.

bubble_pressure

Saturation pressure at T (pure fluid).

dew_pressure

Saturation pressure at T (pure fluid).

bubble_temperature

Saturation temperature at P (pure fluid).

dew_temperature

Saturation temperature at P (pure fluid).

n_components property

n_components: int

Always one.

signature

signature() -> tuple[Any, ...]

Class and fluid name.

ln_phi

ln_phi(
    t: ArrayLike, p: ArrayLike, x: Array, *, phase: str
) -> Array

Pure-fluid ln phi on the requested density branch, as a length-1 vector.

enthalpy

enthalpy(
    t: ArrayLike, p: ArrayLike, x: Array, *, phase: str
) -> Array

Molar enthalpy on the requested branch (J/mol).

entropy

entropy(
    t: ArrayLike, p: ArrayLike, x: Array, *, phase: str
) -> Array

Molar entropy on the requested branch (J/mol/K).

volume

volume(
    t: ArrayLike, p: ArrayLike, x: Array, *, phase: str
) -> Array

Molar volume 1 / rho on the requested branch (m^3/mol).

flash_pt

flash_pt(
    t: ArrayLike, p: ArrayLike, z: Array
) -> FlashResult

Pure-fluid phase test: all vapour below Psat(T) (or above Tc), else liquid.

k_seed

k_seed(t: ArrayLike, p: ArrayLike, x: Array) -> Array

Psat(T) / P as a length-1 vector.

mixture_enthalpy

mixture_enthalpy(
    t: ArrayLike, p: ArrayLike, z: Array
) -> Array

Stable-branch molar enthalpy at (T, P) (J/mol).

mixture_entropy

mixture_entropy(
    t: ArrayLike, p: ArrayLike, z: Array
) -> Array

Stable-branch molar entropy at (T, P) (J/mol/K).

mixture_volume

mixture_volume(
    t: ArrayLike, p: ArrayLike, z: Array
) -> Array

Stable-branch molar volume at (T, P) (m^3/mol).

flash_ph

flash_ph(
    p: ArrayLike, h: ArrayLike, z: Array, **kwargs: Any
) -> EnergyFlashResult

Steam-table (P, h) state: saturation temperature and quality inside the dome.

flash_ps

flash_ps(
    p: ArrayLike, s: ArrayLike, z: Array, **kwargs: Any
) -> EnergyFlashResult

Steam-table (P, s) state: saturation temperature and quality inside the dome.

bubble_pressure

bubble_pressure(
    t: ArrayLike, x: Array
) -> tuple[Array, Array]

Saturation pressure at T (pure fluid).

dew_pressure

dew_pressure(t: ArrayLike, y: Array) -> tuple[Array, Array]

Saturation pressure at T (pure fluid).

bubble_temperature

bubble_temperature(
    p: ArrayLike,
    x: Array,
    *,
    t_min: float = 150.0,
    t_max: float = 700.0,
) -> tuple[Array, Array]

Saturation temperature at P (pure fluid).

dew_temperature

dew_temperature(
    p: ArrayLike,
    y: Array,
    *,
    t_min: float = 150.0,
    t_max: float = 700.0,
) -> tuple[Array, Array]

Saturation temperature at P (pure fluid).

excess_enthalpy

excess_enthalpy(
    activity: ActivityModel, x: Array, t: ArrayLike
) -> Array

Excess (mixing) enthalpy h^E = -R T^2 d(g^E/RT)/dT (J/mol) by autodiff.

The Gibbs-Helmholtz relation turns the temperature derivative of the excess Gibbs energy into the heat of mixing. Taking that derivative with automatic differentiation keeps h^E exactly consistent with the activity coefficients (and their temperature dependence), with no separate correlation to maintain.

Parameters:

Name Type Description Default
activity ActivityModel

Liquid activity-coefficient model.

required
x Array

Liquid mole fractions.

required
t ArrayLike

Temperature (K).

required

Returns:

Type Description
Array

The molar excess enthalpy of the liquid mixture.

excess_entropy

excess_entropy(
    activity: ActivityModel, x: Array, t: ArrayLike
) -> Array

Excess entropy s^E = (h^E - g^E) / T (J/mol/K).

cubic_package

cubic_package(
    tc: Array,
    pc: Array,
    omega: Array,
    cp: CpCoeffs,
    *,
    kij: Array | None = None,
    eos: CubicEOS = PR,
) -> CubicPackage

Construct a CubicPackage from component constants and Cp coefficients.

gamma_phi_package

gamma_phi_package(
    activity: ActivityModel,
    tc: Array,
    pc: Array,
    omega: Array,
    cp: CpCoeffs,
    *,
    kij: Array | None = None,
    eos: CubicEOS = PR,
    vapor: str = "ideal",
    poynting: bool = False,
    phi_saturation: bool = False,
) -> GammaPhiPackage

Construct a GammaPhiPackage from an activity model and component constants.

saft_package

saft_package(
    params: SaftParameters,
    tc: Array,
    pc: Array,
    omega: Array,
    cp: CpCoeffs,
) -> SAFTPackage

Construct a SAFTPackage from PC-SAFT parameters, seeding constants, and Cp.

helmholtz_package

helmholtz_package(
    fluid: HelmholtzFluid,
) -> HelmholtzPackage

Wrap a reference fluid as a one-component HelmholtzPackage.

energy_flash_report

energy_flash_report(
    pkg: PropertyPackage,
    result: EnergyFlashResult,
    p: ArrayLike,
    target: ArrayLike,
    z: Array,
    *,
    prop: str = "enthalpy",
    tol: float = 1e-07,
) -> SolveReport

Verify an energy flash independently from its temperature iteration.

The residual checks component closure, composition normalization, phase fractions, and the specified molar property. The iteration count is zero because this is a verification of the returned state, not its iteration log.

flash_pt_with_info

flash_pt_with_info(
    pkg: PropertyPackage,
    t: ArrayLike,
    p: ArrayLike,
    z: Array,
    **options: Any,
) -> Any

PT flash and its actual iteration report for cubic, gamma-phi, and PC-SAFT.

Reference-fluid and custom packages use independent state verification with zero reported iterations. Physical stability and applicability are assessed by fugacio.thermo.acceptance.flash_pt_checked.

flash_ph_with_info

flash_ph_with_info(
    pkg: PropertyPackage,
    p: ArrayLike,
    h: ArrayLike,
    z: Array,
    **options: Any,
) -> EnergySolveResult

PH flash and an independent material/enthalpy verification report.

flash_ps_with_info

flash_ps_with_info(
    pkg: PropertyPackage,
    p: ArrayLike,
    s: ArrayLike,
    z: Array,
    **options: Any,
) -> EnergySolveResult

PS flash and an independent material/entropy verification report.