fuellib.fuel
- class fuellib.fuel(name, decompName=None, fuelDataDir=None)
Bases:
objectClass for handling group contribution calculations of thermodynamic and mixture properties.
- Parameters:
name (str) – Name of the mixture as it appears in its gcData file.
decompName (str, optional) – Name of the groupDecomposition file if different from name. Defaults to None.
fuelDataDir (str, optional) – Directory where the fuel data is stored. If None, uses built-in embedded data.
- __init__(name, decompName=None, fuelDataDir=None)
Initialize the fuel object and calculate GCM properties.
- Parameters:
name (str) – Name of the mixture as it appears in its gcData file.
decompName (str, optional) – Name of the groupDecomposition file if different from name.
fuelDataDir (str, optional) – Directory where the fuel data is stored. If None, uses built-in embedded data.
Methods
Cl(T[, comp_idx])Compute liquid mass specific heat capacity in J/kg/K at a given temperature.
Cp(T[, comp_idx])Compute molar specific heat capacity at a given temperature.
X2Y(Xi)Calculate the mass fractions from the mole fractions of each component.
Y2X(Yi)Calculate the mole fractions from the mass fractions of each component.
__init__(name[, decompName, fuelDataDir])Initialize the fuel object and calculate GCM properties.
density(T[, comp_idx])Calculate the density of each component at temperature T.
diffusion_coeff(p, T[, sigma_gas, ...])Compute diffusion coefficients using Lennard-Jones parameters.
latent_heat_vaporization(T[, comp_idx])Calculate latent heat of vaporization adjusted for temperature.
mass2X(mass)Calculate the mole fractions from the mass of each component.
mass2Y(mass)Calculate the mass fractions from the mass of each component.
mean_molecular_weight(Yi)Calculate the mean molecular weight of the mixture.
mixture_density(Yi, T)Calculate mixture density at a given temperature.
mixture_dynamic_viscosity(Yi, T[, correlation])Calculate dynamic viscosity of the mixture.
mixture_kinematic_viscosity(Yi, T[, correlation])Calculate kinematic viscosity of the mixture.
mixture_surface_tension(Yi, T[, correlation])Calculate surface tension of the mixture.
mixture_thermal_conductivity(Yi, T)Calculate thermal conductivity of the mixture.
mixture_vapor_pressure(Yi, T[, correlation])Calculate vapor pressure of the mixture.
mixture_vapor_pressure_antoine_coeffs(Yi[, ...])Estimate Antoine coefficients for vapor pressure of the mixture.
molar_liquid_vol(T[, comp_idx])Compute molar liquid volume with temperature correction.
psat(T[, comp_idx, correlation])Compute saturated vapor pressure.
psat_antoine_coeffs([Tvals, units, correlation])Estimate Antoine coefficients for vapor pressure of an individual compound.
surface_tension(T[, comp_idx, correlation])Calculate surface tension of each compound at a given temperature.
thermal_conductivity(T[, comp_idx])Calculate thermal conductivity at a given temperature.
viscosity_dynamic(T[, comp_idx])Calculate liquid dynamic viscosity based on droplet temperature and density.
viscosity_kinematic(T[, comp_idx])Calculate the viscosity using Dutt's equation.
Attributes
N_g1N_g2fuelDataDirRoot directory for fuel data (custom or embedded)
fuelDataGcDirDirectory containing GCxGC compositional data files
fuelDataDecompDirDirectory containing functional group decomposition files
fuelDataPropsDirDirectory containing experimental property data (may be None)
nameName of the fuel/mixture
compoundsList of compound names in the mixture
formulasMolecular formulas for each compound
Y_0(num_compounds,)
Nij(num_compounds, num_groups)
num_compoundsNumber of compounds in the mixture
num_groupsNumber of functional groups in the decomposition
MW(num_compounds,)
Tc(num_compounds,)
Pc(num_compounds,)
Vc(num_compounds,)
Tb(num_compounds,)
Tm(num_compounds,)
Hf(num_compounds,)
Gf(num_compounds,)
Hv_stp(num_compounds,)
Lv_stp(num_compounds,)
Cp_stp(num_compounds,)
Vm_stp(num_compounds,)
omega(num_compounds,)
sigma(num_compounds,)
epsilonByKB(num_compounds,)
hc_typeHydrocarbon types ("n-alkane", "iso-alkane", "cyclo-alkane", "aromatic", "alkene")
famaromatic, 2: cycloparaffin, 3: olefin)
nC(num_compounds,)
nH(num_compounds,)
pelephysics_keysPelePhysics keys for each compound (if available)
- Cl(T, comp_idx=None)
Compute liquid mass specific heat capacity in J/kg/K at a given temperature.
- Parameters:
T (float) – Temperature in Kelvin.
comp_idx (int, optional) – Index of compound to calculate property for.
- Returns:
Mass specific heat capacity in J/kg/K.
- Return type:
np.ndarray
- Cp(T, comp_idx=None)
Compute molar specific heat capacity at a given temperature.
- Parameters:
T (float) – Temperature in Kelvin.
comp_idx (int, optional) – Index of compound to calculate property for.
- Returns:
Molar specific heat capacity in J/mol/K.
- Return type:
np.ndarray
- Cp_stp: ndarray
(num_compounds,)
- Type:
Molar specific heat at 298 K in J/mol/K. Shape
- Gf: ndarray
(num_compounds,)
- Type:
Gibbs free energy in J/mol. Shape
- Hf: ndarray
(num_compounds,)
- Type:
Enthalpy of formation in J/mol. Shape
- Hv_stp: ndarray
(num_compounds,)
- Type:
Enthalpy of vaporization at 298 K in J/mol. Shape
- Lv_stp: ndarray
(num_compounds,)
- Type:
Latent heat of vaporization at 298 K in J/kg. Shape
- MW: ndarray
(num_compounds,)
- Type:
Molecular weights in kg/mol. Shape
- N_g1 = 78
- N_g2 = 43
- Nij: ndarray
(num_compounds, num_groups)
- Type:
Functional group decomposition matrix. Shape
- Pc: ndarray
(num_compounds,)
- Type:
Critical pressures in Pa. Shape
- Tb: ndarray
(num_compounds,)
- Type:
Boiling temperatures in K. Shape
- Tc: ndarray
(num_compounds,)
- Type:
Critical temperatures in K. Shape
- Tm: ndarray
(num_compounds,)
- Type:
Melting temperatures in K. Shape
- Vc: ndarray
(num_compounds,)
- Type:
Critical volumes in m³/mol. Shape
- Vm_stp: ndarray
(num_compounds,)
- Type:
Molar liquid volume at 298 K in m³/mol. Shape
- X2Y(Xi)
Calculate the mass fractions from the mole fractions of each component.
- Parameters:
Xi (np.ndarray) – Mole fractions of each compound.
- Returns:
Mass fractions of the compounds (shape: num_compounds,).
- Return type:
np.ndarray
- Y2X(Yi)
Calculate the mole fractions from the mass fractions of each component.
- Parameters:
Yi (np.ndarray) – Mass fractions of each compound.
- Returns:
Mole fractions of the compounds (shape: num_compounds,).
- Return type:
np.ndarray
- Y_0: ndarray
(num_compounds,)
- Type:
Mass fractions of each compound. Shape
- compounds: list
List of compound names in the mixture
- density(T, comp_idx=None)
Calculate the density of each component at temperature T.
- Parameters:
T (float) – Temperature of the mixture in Kelvin.
comp_idx (int, optional) – Index of compound to calculate property for.
- Returns:
Density of each compound in kg/m^3.
- Return type:
np.ndarray
- epsilonByKB: ndarray
(num_compounds,)
- Type:
Lennard-Jones well depths in K. Shape
- fam: ndarray
aromatic, 2: cycloparaffin, 3: olefin)
- Type:
Family codes for thermal conductivity (0
- Type:
saturated, 1
- formulas: ndarray
Molecular formulas for each compound
- fuelDataDecompDir: str
Directory containing functional group decomposition files
- fuelDataDir: str
Root directory for fuel data (custom or embedded)
- fuelDataGcDir: str
Directory containing GCxGC compositional data files
- fuelDataPropsDir: str
Directory containing experimental property data (may be None)
- hc_type: ndarray
Hydrocarbon types (“n-alkane”, “iso-alkane”, “cyclo-alkane”, “aromatic”, “alkene”)
- latent_heat_vaporization(T, comp_idx=None)
Calculate latent heat of vaporization adjusted for temperature.
- Parameters:
T (float) – Temperature in Kelvin.
comp_idx (int, optional) – Index of compound to calculate property for.
- Returns:
Latent heat of vaporization in J/kg.
- Return type:
np.ndarray
- mass2X(mass)
Calculate the mole fractions from the mass of each component.
- Parameters:
mass (np.ndarray) – Mass of each compound.
- Returns:
Mass fractions of the compounds (shape: num_compounds,).
- Return type:
np.ndarray
- mass2Y(mass)
Calculate the mass fractions from the mass of each component.
- Parameters:
mass (np.ndarray) – Mass of each compound.
- Returns:
Mass fractions of the compounds (shape: num_compounds,).
- Return type:
np.ndarray
- mean_molecular_weight(Yi)
Calculate the mean molecular weight of the mixture.
- Parameters:
Yi (np.ndarray) – Mass fractions of each compound.
- Returns:
Mean molecular weight of the mixture in kg/mol.
- Return type:
float
- mixture_density(Yi, T)
Calculate mixture density at a given temperature.
- Parameters:
Yi (np.ndarray) – Mass fractions of each compound.
T (float) – Temperature in Kelvin.
- Returns:
Mixture density in kg/m^3.
- Return type:
float
- mixture_dynamic_viscosity(Yi, T, correlation='Kendall-Monroe')
Calculate dynamic viscosity of the mixture.
- Parameters:
Yi (np.ndarray) – Mass fractions of each compound.
T (float) – Temperature in Kelvin.
correlation (str, optional) – Mixing model (“Kendall-Monroe” or “Arrhenius”).
- Returns:
Mixture dynamic viscosity in Pa*s.
- Return type:
float
- mixture_thermal_conductivity(Yi, T)
Calculate thermal conductivity of the mixture.
- Parameters:
Yi (np.ndarray) – Mass fractions of each compound in the mixture.
T (float) – Temperature in Kelvin.
- Returns:
Thermal conductivity in W/m/K.
- Return type:
float
- mixture_vapor_pressure(Yi, T, correlation='Lee-Kesler')
Calculate vapor pressure of the mixture.
- Parameters:
Yi (np.ndarray) – Mass fractions of each compound in the mixture.
T (float) – Temperature in Kelvin.
correlation (str, optional) – Correlation method (“Ambrose-Walton” or “Lee-Kesler”).
- Returns:
Mixture vapor pressure in Pa.
- Return type:
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 (np.ndarray) – Mass fractions of each compound in the mixture.
Tvals (np.ndarray, optional) – Temperature range or nodes for Antoine fit in Kelvin (default [273.15, min(Tb)]).
units (str, optional) – Units for pressure in fit (“mks”, “cgs”, “bar”, “atm”)
correlation (str, optional) – Correlation method (“Ambrose-Walton” or “Lee-Kesler”).
- Returns:
Coefficients A, B, C, D
- Return type:
float
- molar_liquid_vol(T, comp_idx=None)
Compute molar liquid volume with temperature correction.
- Parameters:
T (float) – Temperature in Kelvin.
comp_idx (int, optional) – Index of compound to calculate property for.
- Returns:
Molar liquid volume in m^3/mol.
- Return type:
np.ndarray
- nC: ndarray
(num_compounds,)
- Type:
Carbon numbers. Shape
- nH: ndarray
(num_compounds,)
- Type:
Hydrogen numbers. Shape
- name: str
Name of the fuel/mixture
- num_compounds: int
Number of compounds in the mixture
- num_groups: int
Number of functional groups in the decomposition
- omega: ndarray
(num_compounds,)
- Type:
Acentric factors. Shape
- pelephysics_keys: ndarray
PelePhysics keys for each compound (if available)
- psat_antoine_coeffs(Tvals=None, units='mks', correlation='Lee-Kesler')
Estimate Antoine coefficients for vapor pressure of an individual compound.
- Parameters:
Tvals (np.ndarray, optional) – Temperature range or nodes for Antoine fit in Kelvin (default [273.15, Tb_i]).
units (str, optional) – Units for pressure in fit (“mks”, “cgs”, “bar”, “atm”)
correlation (str, optional) – Correlation method (“Ambrose-Walton” or “Lee-Kesler”).
- Returns:
Coefficients A, B, C, D
- Return type:
4 np.ndarrays
- sigma: ndarray
(num_compounds,)
- Type:
Lennard-Jones collision diameters in m. Shape