fuellib.fuel.Fuel

class fuellib.fuel.Fuel(name, decompName=None, fuelDataDir=None)

Bases: object

Class for handling group contribution calculations of thermodynamic and mixture properties.

Initialize Fuel object and pre-compute GCM properties.

Parameters:
  • name (str) – Name of the mixture as it appears in its gcData file.

  • decompName (str | None) – Name of the groupDecomposition file if different from name. Defaults to None.

  • fuelDataDir (str | None) – Directory where the fuel data is stored. If None, uses built-in embedded data.

Raises:

ValueError – If a GCM property cannot be found.

Attributes

name

Name of the fuel/mixture.

fuelDataDir

Directory containing the fuel data.

fuelDataGcDir

Directory containing the gas chromatography data.

fuelDataDecompDir

Directory containing the group decomposition data.

fuelDataPropsDir

Directory containing the fuel properties data.

groupDecompFile

File containing the group decomposition data for this fuel.

gcxgcFile

File containing the GCxGC compositional data for this fuel.

gcmTableFile

File containing the GCM table data.

Nij

Array containing the group decomposition data for each compound.

num_compounds

Number of compounds in the fuel mixture.

num_groups

Number of functional groups considered in the decomposition.

fam

Hydrocarbon family codes for thermal conductivity.

hc_type

Hydrocarbon types for each compound:

nC

Number of carbon atoms in each compound.

nH

Number of hydrogen atoms in each compound.

compounds

List of compound names.

formulas

Molecular formulas of the fuel components, if available.

pelephysics_keys

PelePhysics keys for the fuel components, if available.

MW

Molecular weights in kg/mol.

Tc

Critical temperature in K.

Pc

Critical pressure in Pa.

Vc

Critical volume in m^3/mol.

Tb

Boiling temperature in K.

Tm

Melting temperature in K.

Hf

Enthalpy of formation in J/mol.

Gf

Gibbs free energy in J/mol.

Hv_stp

Enthalpy of vaporization at 298 K in J/mol.

omega

Accentric factor (dimensionless).

Vm_stp

Molar liquid volume at 298 K in m^3/mol.

Cp_stp

Molar specific heat at 298 K in J/(mol*K).

Cp_B

Temperature-corrected specific heat (B) in J/(mol*K).

Cp_C

Temperature-corrected specific heat (C) in J/(mol*K).

Lv_stp

Latent heat of vaporization at 298 K in J/kg.

epsilonByKB

Lennard-Jones well depth over Boltzmann constant in K.

sigma

Lennard-Jones collision diameter in m.

Methods

Cl

Compute liquid mass specific heat capacity in J/kg/K at a given temperature.

Cp

Compute molar specific heat capacity at a given temperature.

X2Y

Calculate the mass fractions from the mole fractions of each component.

Y2X

Calculate the mole fractions from the mass fractions of each component.

density

Calculate the density of each component at temperature T.

diffusion_coeff

Compute diffusion coefficients using Lennard-Jones parameters.

latent_heat_vaporization

Calculate latent heat of vaporization adjusted for temperature.

mass2X

Calculate the mole fractions from the mass of each component.

mass2Y

Calculate the mass fractions from the mass of each component.

mean_molecular_weight

Calculate the mean molecular weight of the mixture.

mixture_density

Calculate mixture density at a given temperature.

mixture_dynamic_viscosity

Calculate dynamic viscosity of the mixture.

mixture_kinematic_viscosity

Calculate kinematic viscosity of the mixture.

mixture_surface_tension

Calculate surface tension of the mixture.

mixture_thermal_conductivity

Calculate thermal conductivity of the mixture.

mixture_vapor_pressure

Calculate vapor pressure of the mixture.

mixture_vapor_pressure_antoine_coeffs

Estimate Antoine coefficients for vapor pressure of the mixture.

molar_liquid_vol

Compute molar liquid volume with temperature correction.

psat

Compute saturated vapor pressure.

psat_antoine_coeffs

Estimate Antoine coefficients for vapor pressure of an individual compound.

surface_tension

Calculate surface tension of each compound at a given temperature.

thermal_conductivity

Calculate thermal conductivity at a given temperature.

viscosity_dynamic

Calculate liquid dynamic viscosity based on droplet temperature and density.

viscosity_kinematic

Calculate the viscosity using Dutt's equation.

Cl(T, comp_idx=None)

Compute liquid mass specific heat capacity in J/kg/K at a given temperature.

Parameters:
  • T (Quantity[float]) – Temperature to compute property.

  • comp_idx (int | None) – Index of compound to calculate property for.

Returns:

Mass specific heat capacity in J/kg/K.

Return type:

Quantity[ndarray[tuple[int]]]

Cp(T, comp_idx=None)

Compute molar specific heat capacity at a given temperature.

Parameters:
  • T (Quantity[float]) – Temperature to compute property.

  • comp_idx (int | None) – Index of compound to calculate property for.

Returns:

Molar specific heat capacity in J/mol/K.

Return type:

Quantity[ndarray[tuple[int]]]

Cp_B: Quantity[ndarray[tuple[int]]]

Temperature-corrected specific heat (B) in J/(mol*K).

Cp_C: Quantity[ndarray[tuple[int]]]

Temperature-corrected specific heat (C) in J/(mol*K).

Cp_stp: Quantity[ndarray[tuple[int]]]

Molar specific heat at 298 K in J/(mol*K).

Gf: Quantity[ndarray[tuple[int]]]

Gibbs free energy in J/mol.

Hf: Quantity[ndarray[tuple[int]]]

Enthalpy of formation in J/mol.

Hv_stp: Quantity[ndarray[tuple[int]]]

Enthalpy of vaporization at 298 K in J/mol.

Lv_stp: Quantity[ndarray[tuple[int]]]

Latent heat of vaporization at 298 K in J/kg.

MW: Quantity[ndarray[tuple[int]]]

Molecular weights in kg/mol.

Nij: ndarray[tuple[int, int]]

Array containing the group decomposition data for each compound.

Pc: Quantity[ndarray[tuple[int]]]

Critical pressure in Pa.

Tb: Quantity[ndarray[tuple[int]]]

Boiling temperature in K.

Tc: Quantity[ndarray[tuple[int]]]

Critical temperature in K.

Tm: Quantity[ndarray[tuple[int]]]

Melting temperature in K.

Vc: Quantity[ndarray[tuple[int]]]

Critical volume in m^3/mol.

Vm_stp: Quantity[ndarray[tuple[int]]]

Molar liquid volume at 298 K in m^3/mol.

X2Y(Xi)

Calculate the mass fractions from the mole fractions of each component.

Parameters:

Xi (Quantity[ndarray[tuple[int]]]) – Mole fractions of each compound.

Returns:

num_compounds,).

Return type:

Mass fractions of the compounds (shape

Y2X(Yi)

Calculate the mole fractions from the mass fractions of each component.

Parameters:

Yi (Quantity[ndarray[tuple[int]]]) – Mass fractions of each compound.

Returns:

num_compounds,).

Return type:

Mole fractions of the compounds (shape

__init__(name, decompName=None, fuelDataDir=None)

Initialize Fuel object and pre-compute GCM properties.

Parameters:
  • name (str) – Name of the mixture as it appears in its gcData file.

  • decompName (str | None) – Name of the groupDecomposition file if different from name. Defaults to None.

  • fuelDataDir (str | None) – Directory where the fuel data is stored. If None, uses built-in embedded data.

Raises:

ValueError – If a GCM property cannot be found.

Return type:

None

compounds: list[str]

List of compound names.

density(T, comp_idx=None)

Calculate the density of each component at temperature T.

Parameters:
  • T (Quantity[float]) – Temperature of the mixture in Kelvin.

  • comp_idx (int | None) – Index of compound to calculate property for.

Returns:

Density of each compound in kg/m^3.

Return type:

Quantity[ndarray[tuple[int]]]

diffusion_coeff(p, T, sigma_gas=Quantity(3.62, 'angstrom'), epsilonByKB_gas=Quantity(97.0, 'kelvin'), MW_gas=Quantity(0.02897, 'kilogram / mole'), correlation='Tee')

Compute diffusion coefficients using Lennard-Jones parameters.

Uses Wilke and Lee method (Poling, equation 11-4.1). Ambient gas defaults to air parameters.

Parameters:
  • p (Quantity[float]) – Pressure in Pa.

  • T (Quantity[float]) – Temperature to compute property.

  • sigma_gas (Quantity[float]) – Collision diameter in m.

  • epsilonByKB_gas (Quantity[float]) – Well depth over Boltzmann constant, in K.

  • MW_gas (Quantity[float]) – Mean molecular weight of ambient gas in kg/mol.

  • correlation (Literal['Tee', 'Wilke']) – Method to calculate sigma and epsilon (“Tee” or “Wilke”).

Returns:

Diffusion coefficient.

Return type:

Quantity[ndarray[tuple[int]]]

epsilonByKB: Quantity[ndarray[tuple[int]]]

Lennard-Jones well depth over Boltzmann constant in K.

fam: ndarray[tuple[int]]

Hydrocarbon family codes for thermal conductivity.

Code

Hydrocarbon Family

0

saturated

1

aromatics

2

cycloparaffins

3

olefins

formulas: ndarray[tuple[int]] | None

Molecular formulas of the fuel components, if available.

fuelDataDecompDir: str

Directory containing the group decomposition data.

fuelDataDir: str

Directory containing the fuel data.

fuelDataGcDir: str

Directory containing the gas chromatography data.

fuelDataPropsDir: str

Directory containing the fuel properties data.

gcmTableFile: str

File containing the GCM table data.

gcxgcFile: str

File containing the GCxGC compositional data for this fuel.

groupDecompFile: str

File containing the group decomposition data for this fuel.

hc_type: ndarray[tuple[int]]

Hydrocarbon types for each compound:

  • “n-alkane”

  • “iso-alkane”

  • “alkene”

  • “cyclo-alkane”

  • “aromatic”

latent_heat_vaporization(T, comp_idx=None)

Calculate latent heat of vaporization adjusted for temperature.

Parameters:
  • T (Quantity[float]) – Temperature to compute property.

  • comp_idx (int | None) – Index of compound to calculate property for.

Returns:

Latent heat of vaporization in J/kg.

Return type:

Quantity[ndarray[tuple[int]]]

mass2X(mass)

Calculate the mole fractions from the mass of each component.

Parameters:

mass (Quantity[ndarray[tuple[int]]]) – Mass of each compound.

Returns:

num_compounds,).

Return type:

Mole fractions of the compounds (shape

mass2Y(mass)

Calculate the mass fractions from the mass of each component.

Parameters:

mass (Quantity[ndarray[tuple[int]]]) – Mass of each compound.

Returns:

num_compounds,).

Return type:

Mass fractions of the compounds (shape

mean_molecular_weight(Yi)

Calculate the mean molecular weight of the mixture.

Parameters:

Yi (Quantity[ndarray[tuple[int]]]) – Mass fractions of each compound.

Returns:

Mean molecular weight of the mixture in kg/mol.

Return type:

Quantity[float]

mixture_density(Yi, T)

Calculate mixture density at a given temperature.

Parameters:
  • Yi (Quantity[ndarray[tuple[int]]]) – Mass fractions of each compound.

  • T (Quantity[float]) – Temperature to compute property.

Returns:

Mixture density in kg/m^3.

Return type:

Quantity[ndarray[tuple[int]]]

mixture_dynamic_viscosity(Yi, T, correlation='Kendall-Monroe')

Calculate dynamic viscosity of the mixture.

Parameters:
  • Yi (Quantity[ndarray[tuple[int]]]) – Mass fractions of each compound.

  • T (Quantity[float]) – Temperature to compute property.

  • correlation (Literal['Kendall-Monroe', 'Arrhenius']) – Mixing model (“Kendall-Monroe” or “Arrhenius”).

Returns:

Mixture dynamic viscosity in Pa*s.

Return type:

Quantity[float]

mixture_kinematic_viscosity(Yi, T, correlation='Kendall-Monroe')

Calculate kinematic viscosity of the mixture.

Uses Kendall-Monroe (default) or Arrhenius mixing correlations.

Parameters:
  • Yi (Quantity[ndarray[tuple[int]]]) – Mass fractions of each compound.

  • T (Quantity[float]) – Temperature to compute property.

  • correlation (Literal['Kendall-Monroe', 'Arrhenius']) – Mixing model (“Kendall-Monroe” or “Arrhenius”).

Returns:

Mixture kinematic viscosity in m^2/s.

Return type:

Quantity[float]

mixture_surface_tension(Yi, T, correlation='Brock-Bird')

Calculate surface tension of the mixture.

Uses arithmetic pseudo-property method recommended by Hugill and van Welsenes (1986).

Parameters:
  • Yi (Quantity[ndarray[tuple[int]]]) – Mass fractions of each compound in the mixture.

  • T (Quantity[float]) – Temperature to compute property.

  • correlation (Literal['Pitzer', 'Brock-Bird']) – Correlation method (“Pitzer” or “Brock-Bird”).

Returns:

Mixture surface tension in N/m.

Return type:

Quantity[float]

mixture_thermal_conductivity(Yi, T)

Calculate thermal conductivity of the mixture.

Parameters:
  • Yi (Quantity[ndarray[tuple[int]]]) – Mass fractions of each compound in the mixture.

  • T (Quantity[float]) – Temperature to compute property.

Returns:

Thermal conductivity in W/m/K.

Return type:

Quantity[float]

mixture_vapor_pressure(Yi, T, correlation='Lee-Kesler')

Calculate vapor pressure of the mixture.

Parameters:
  • Yi (Quantity[ndarray[tuple[int]]]) – Mass fractions of each compound in the mixture.

  • T (Quantity[float]) – Temperature to compute property.

  • correlation (Literal['Ambrose-Walton', 'Lee-Kesler']) – Correlation method (“Ambrose-Walton” or “Lee-Kesler”).

Returns:

Mixture vapor pressure in Pa.

Return type:

Quantity[float]

mixture_vapor_pressure_antoine_coeffs(Yi, Tvals=None, units='mks', correlation='Lee-Kesler')

Estimate Antoine coefficients for vapor pressure of the mixture.

Parameters:
  • Yi (Quantity[ndarray[tuple[int]]]) – Mass fractions of each compound in the mixture.

  • Tvals (Quantity[ndarray[tuple[int]]] | None) – Temperature range or nodes for Antoine fit in Kelvin (default [273.15, min(Tb)]).

  • units (Literal['mks', 'cgs', 'dyne/cm^2', 'Pa']) – Units for pressure in fit (“mks”, “cgs”).

  • correlation (Literal['Ambrose-Walton', 'Lee-Kesler']) – Correlation method (“Ambrose-Walton” or “Lee-Kesler”).

Returns:

Coefficients A, B, C, D.

Raises:

ValueError – If units or Tvals are invalid.

Return type:

tuple[float, float, float, float]

molar_liquid_vol(T, comp_idx=None)

Compute molar liquid volume with temperature correction.

Parameters:
  • T (Quantity[float]) – Temperature to compute property.

  • comp_idx (int | None) – Index of compound to calculate property for.

Returns:

Molar liquid volume in m^3/mol.

Return type:

Quantity[ndarray[tuple[int]]]

nC: ndarray[tuple[int]]

Number of carbon atoms in each compound.

nH: ndarray[tuple[int]]

Number of hydrogen atoms in each compound.

name: str

Name of the fuel/mixture.

num_compounds: int

Number of compounds in the fuel mixture.

num_groups: int

Number of functional groups considered in the decomposition.

omega: Quantity[ndarray[tuple[int]]]

Accentric factor (dimensionless).

pelephysics_keys: ndarray[tuple[int]] | None

PelePhysics keys for the fuel components, if available.

psat(T, comp_idx=None, correlation='Lee-Kesler')

Compute saturated vapor pressure.

Can use Ambrose-Walton or Lee-Kesler correlations (default Lee-Kesler).

Parameters:
  • T (Quantity[float]) – Temperature to compute property.

  • comp_idx (int | None) – Index of compound to calculate property for.

  • correlation (Literal['Ambrose-Walton', 'Lee-Kesler']) – Correlation method (“Ambrose-Walton” or “Lee-Kesler”).

Returns:

Saturated vapor pressure in Pa.

Return type:

Quantity[ndarray[tuple[int]]]

psat_antoine_coeffs(Tvals=None, units='mks', correlation='Lee-Kesler')

Estimate Antoine coefficients for vapor pressure of an individual compound.

Parameters:
  • Tvals (Quantity[ndarray[tuple[int]]] | None) – Temperature range or nodes for Antoine fit in Kelvin (default [273.15, Tb_i]).

  • units (Literal['mks', 'cgs', 'dyne/cm^2', 'Pa']) – Units for pressure in fit (“mks”, “cgs”).

  • correlation (Literal['Ambrose-Walton', 'Lee-Kesler']) – Correlation method (“Ambrose-Walton” or “Lee-Kesler”).

Returns:

Coefficients A, B, C, D for each compound.

Raises:

ValueError – If units or Tvals are invalid.

Return type:

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

sigma: Quantity[ndarray[tuple[int]]]

Lennard-Jones collision diameter in m.

surface_tension(T, comp_idx=None, correlation='Brock-Bird')

Calculate surface tension of each compound at a given temperature.

Uses Brock-Bird (default) or Pitzer correlations (Poling 12-3.5, 12-3.7).

Parameters:
  • T (Quantity[float]) – Temperature to compute property.

  • comp_idx (int | None) – Index of compound to calculate property for.

  • correlation (Literal['Brock-Bird', 'Pitzer']) – Correlation method (“Brock-Bird” or “Pitzer”).

Returns:

Surface tension in N/m.

Return type:

Quantity[ndarray[tuple[int]]]

thermal_conductivity(T, comp_idx=None)

Calculate thermal conductivity at a given temperature.

Uses Latini et al. method (Poling equation 10-9.1).

Parameters:
  • T (Quantity[float]) – Temperature to compute property.

  • comp_idx (int | None) – Index of compound to calculate property for.

Returns:

Thermal conductivity in W/m/K.

Return type:

Quantity[ndarray[tuple[int]]]

viscosity_dynamic(T, comp_idx=None)

Calculate liquid dynamic viscosity based on droplet temperature and density.

Uses Dutt’s equation (4.23) for kinematic viscosity, combined with density.

Parameters:
  • T (Quantity[float]) – Temperature to compute property.

  • comp_idx (int | None) – Index of compound to calculate property for.

Returns:

Dynamic viscosity in Pa*s.

Return type:

Quantity[ndarray[tuple[int]]]

viscosity_kinematic(T, comp_idx=None)

Calculate the viscosity using Dutt’s equation.

Uses Dutt’s equation (4.23) from “Viscosity of Liquids”. The equation predicts viscosity in mm^2/s and is converted to SI units.

Parameters:
  • T (Quantity[float]) – Temperature to compute property.

  • comp_idx (int | None) – Index of compound to calculate property for.

Returns:

Viscosity of each component in m^2/s.

Return type:

Quantity[ndarray[tuple[int]]]