fuellib.fuel.core.Fuel

class fuellib.fuel.core.Fuel(name, data_dir=None, *, use_ref_props=True)

Bases: object

Class for handling calculations of thermodynamic and mixture properties.

Initialize a Fuel instance.

Parameters:
  • name (str) – Name of the fuel.

  • data_dir (str | Path | None) – Directory containing fuel data. Defaults to fuellib/data.

  • use_ref_props (bool) – Whether to use reference compound properties for calculations. Defaults to True.

Raises:
  • FileNotFoundError – If the fuel data directory does not exist.

  • ValueError – If the GCxGC data file is missing required columns.

Attributes

num_compounds

Number of components in the fuel.

name

Name of the fuel.

data_dir

Directory containing fuel data.

gc_data

GCxGC data as a DataFrame.

components_data

Matched components data with reference compounds.

prop_data

Property data for the fuel/mixture, if available.

metadata

Fuel metadata, if available.

comps

Components attribute for the fuel.

mix

Mixture attribute for the fuel.

y0

Normalized weight fractions from the GCxGC data.

x0

Normalized mole fractions from the GCxGC data.

Methods

__init__(name, data_dir=None, *, use_ref_props=True)

Initialize a Fuel instance.

Parameters:
  • name (str) – Name of the fuel.

  • data_dir (str | Path | None) – Directory containing fuel data. Defaults to fuellib/data.

  • use_ref_props (bool) – Whether to use reference compound properties for calculations. Defaults to True.

Raises:
  • FileNotFoundError – If the fuel data directory does not exist.

  • ValueError – If the GCxGC data file is missing required columns.

Return type:

None

components_data: DataFrame

Matched components data with reference compounds.

comps: Components

Components attribute for the fuel.

data_dir: Path

Directory containing fuel data.

gc_data: DataFrame

GCxGC data as a DataFrame.

metadata: dict | None

Fuel metadata, if available.

mix: Mixture

Mixture attribute for the fuel.

name: str

Name of the fuel.

property num_compounds: int

Number of components in the fuel.

prop_data: DataFrame | None

Property data for the fuel/mixture, if available.

x0: Quantity[ndarray[tuple[int]]]

Normalized mole fractions from the GCxGC data.

y0: Quantity[ndarray[tuple[int]]]

Normalized weight fractions from the GCxGC data.