fuellib.simulate.distillation.greenfield.Thermo

class fuellib.simulate.distillation.greenfield.Thermo(fuel, P, *, ideal_solution, ideal_vapor)

Bases: object

Pure-component properties and vapor-liquid equilibrium on NumPy arrays.

Tabulate pure-component properties and set up the VLE models.

Parameters:
  • fuel (Fuel) – Fuel object.

  • P (float) – Pressure in Pa.

  • ideal_solution (bool) – Whether to use unit activity coefficients.

  • ideal_vapor (bool) – Whether to use unit fugacity coefficients.

Methods

Cp_l

Liquid molar heat capacity C_p,l (Nielsen, 1998).

Cp_v

Ideal-gas molar heat capacity, Greenfield et al. (1998) eq.

bubble_point

Bubble temperature of a liquid, Greenfield et al. (1998) eq.

dH_vap

Molar enthalpy of vaporization, Greenfield et al. (1998) eq.

flash

Isothermal flash of the flask vapor in stage 2.

ln_K

Natural log of the equilibrium ratios, Greenfield et al. (1998) eq.

ln_P_sat

Natural log of the saturated vapor pressure (Lee and Kesler, 1975).

ln_gamma

Natural log of the liquid activity coefficients.

ln_phi

Natural log of the vapor fugacity coefficients.

mixture_Cp_l

Mole-fraction-weighted liquid molar heat capacity.

mixture_Cp_v

Mole-fraction-weighted ideal-gas molar heat capacity.

mixture_dH_vap

Mole-fraction-weighted molar enthalpy of vaporization.

Cp_l(T)

Liquid molar heat capacity C_p,l (Nielsen, 1998).

Parameters:

T (float) – Temperature in K.

Returns:

C_p,l in J/(mol*K) for each compound.

Return type:

ndarray[tuple[int]]

Cp_v(T)

Ideal-gas molar heat capacity, Greenfield et al. (1998) eq. (19).

Parameters:

T (float) – Temperature in K.

Returns:

C^0_p,v in J/(mol*K) for each compound.

Return type:

ndarray[tuple[int]]

N: int
P: float
__init__(fuel, P, *, ideal_solution, ideal_vapor)

Tabulate pure-component properties and set up the VLE models.

Parameters:
  • fuel (Fuel) – Fuel object.

  • P (float) – Pressure in Pa.

  • ideal_solution (bool) – Whether to use unit activity coefficients.

  • ideal_vapor (bool) – Whether to use unit fugacity coefficients.

Return type:

None

bubble_point(x, T)

Bubble temperature of a liquid, Greenfield et al. (1998) eq. (10).

Parameters:
  • x (ndarray[tuple[int]]) – Liquid mole fractions.

  • T (float) – Initial guess of the bubble temperature in K.

Returns:

Bubble temperature in K and the equilibrium vapor mole fractions.

Raises:

RuntimeError – If the iteration does not converge.

Return type:

tuple[float, ndarray[tuple[int]]]

dH_vap(T)

Molar enthalpy of vaporization, Greenfield et al. (1998) eq. (17).

Parameters:

T (float) – Temperature in K.

Returns:

dH_vap in J/mol for each compound.

Return type:

ndarray[tuple[int]]

flash(y, T2)

Isothermal flash of the flask vapor in stage 2.

Greenfield et al. (1998) eq. (7) and (11), solved by successive substitution with the Rachford-Rice equation.

Parameters:
  • y (ndarray[tuple[int]]) – Mole fractions of the flask vapor fed to stage 2.

  • T2 (float) – Stage-2 temperature in K.

Returns:

Fraction condensed R2 / D1, reflux mole fractions u, and stage-2 vapor mole fractions v.

Raises:

RuntimeError – If the successive substitution does not converge.

Return type:

tuple[float, ndarray[tuple[int]], ndarray[tuple[int]]]

ideal_solution: bool
ideal_vapor: bool
ln_K(x, y, T)

Natural log of the equilibrium ratios, Greenfield et al. (1998) eq. (10).

Parameters:
  • x (ndarray[tuple[int]]) – Liquid mole fractions.

  • y (ndarray[tuple[int]]) – Vapor mole fractions.

  • T (float) – Temperature in K.

Returns:

ln(K_i) for each compound.

Return type:

ndarray[tuple[int]]

ln_P: Any
ln_P_sat(T)

Natural log of the saturated vapor pressure (Lee and Kesler, 1975).

Parameters:

T (float) – Temperature in K.

Returns:

ln(P^sat / Pa) for each compound.

Return type:

ndarray[tuple[int]]

ln_gamma(x, T)

Natural log of the liquid activity coefficients.

UNIFAC 2.0 (Hayer et al., 2025).

Parameters:
  • x (ndarray[tuple[int]]) – Liquid mole fractions.

  • T (float) – Temperature in K.

Returns:

ln(gamma_i) for each compound.

Return type:

ndarray[tuple[int]]

ln_phi(y, T, ln_P_sat)

Natural log of the vapor fugacity coefficients.

Greenfield et al. (1998) eq. (27)-(31).

Parameters:
  • y (ndarray[tuple[int]]) – Vapor mole fractions.

  • T (float) – Temperature in K.

  • ln_P_sat (ndarray[tuple[int]]) – Natural log of the saturated vapor pressures in Pa at T.

Returns:

ln(phi_i / phi_i^sat) for each compound.

Return type:

ndarray[tuple[int]]

mixture_Cp_l(x, T)

Mole-fraction-weighted liquid molar heat capacity.

Parameters:
  • x (ndarray[tuple[int]]) – Mole fractions.

  • T (float) – Temperature in K.

Returns:

Mixture C_p,l in J/(mol*K).

Return type:

float

mixture_Cp_v(x, T)

Mole-fraction-weighted ideal-gas molar heat capacity.

Parameters:
  • x (ndarray[tuple[int]]) – Mole fractions.

  • T (float) – Temperature in K.

Returns:

Mixture C^0_p,v in J/(mol*K).

Return type:

float

mixture_dH_vap(x, T)

Mole-fraction-weighted molar enthalpy of vaporization.

Parameters:
  • x (ndarray[tuple[int]]) – Mole fractions.

  • T (float) – Temperature in K.

Returns:

Mixture dH_vap in J/mol.

Return type:

float