FuelLib

Functions

C2K(T)

Convert temperature from Celsius to Kelvin.

K2C(T)

Convert temperature from Kelvin to Celsius.

droplet_mass(fuel, r, Yi, T)

Calculate the mass of each compound in the fuel provided the radius of the droplet.

droplet_volume(r)

Calculate spherical volume of a droplet given the radius.

mixing_rule(var_n, X[, pseudo_prop])

Mixing rules for computing mixture properties.

Classes

fuel(name[, decompName, fuelDataDir])

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

FuelLib.C2K(T)

Convert temperature from Celsius to Kelvin.

Parameters:

T (float or np.ndarray) – Temperature in Celsius.

Returns:

Temperature in Kelvin.

Return type:

float or np.ndarray

FuelLib.K2C(T)

Convert temperature from Kelvin to Celsius.

Parameters:

T (float or np.ndarray) – Temperature in Kelvin.

Returns:

Temperature in Celsius.

Return type:

float or np.ndarray

FuelLib.droplet_mass(fuel, r, Yi, T)

Calculate the mass of each compound in the fuel provided the radius of the droplet.

Parameters:
  • fuel (groupContribution object) – An instance of the groupContribution class.

  • r (float) – Radius of the droplet in meters.

  • Yi (np.ndarray) – Mass fractions of each compound.

  • T (float) – Droplet temperature in Kelvin.

Returns:

Mass of each compound in droplet in kg.

Return type:

np.ndarray

FuelLib.droplet_volume(r)

Calculate spherical volume of a droplet given the radius.

Parameters:

r (float) – Radius of the droplet in meters.

Returns:

Spherical volume of droplet in cubic meters.

Return type:

float

class FuelLib.fuel(name, decompName=None, fuelDataDir='/home/runner/work/FuelLib/FuelLib/fuelData')

Bases: object

Class 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. Defaults to FuelLib/fuelData.

Cl(T)

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

Parameters:

T (float) – Temperature in Kelvin.

Returns:

Specific heat capacity in J/kg/K.

Return type:

np.ndarray

Cp(T)

Compute specific heat capacity at a given temperature.

Parameters:

T (float) – Temperature in Kelvin.

Returns:

Specific heat capacity in J/mol/K.

Return type:

np.ndarray

N_g1 = 78
N_g2 = 43
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

density(T)

Calculate the density of each component at temperature T.

Parameters:

T (float) – Temperature of the mixture in Kelvin.

Returns:

Density of each compound in kg/m^3.

Return type:

np.ndarray

k_B = 1.380649e-23
latent_heat_vaporization(T)

Calculate latent heat of vaporization adjusted for temperature.

Parameters:

T (float) – Temperature in Kelvin.

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

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, 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) – Temperature range or nodes for Antoine fit in Kelvin.

  • units – 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)

Compute molar liquid volume with temperature correction.

Parameters:

T (float) – Temperature in Kelvin.

Returns:

Molar liquid volume in m^3/mol.

Return type:

np.ndarray

FuelLib.mixing_rule(var_n, X, pseudo_prop='arithmetic')

Mixing rules for computing mixture properties.

Parameters:
  • var_n (np.ndarray) – Individual compound properties.

  • X (np.ndarray) – Mole fractions of the compounds.

  • pseudo_prop (str, optional) – Type of mean (“arithmetic” or “geometric”).

Returns:

Mixture property value.

Return type:

float