bloc.chem.species#

Compute Lower Heating Values (LHV) and Higher Heating Values (HHV) for arbitrary species.

Attributes#

Functions#

get_solid_carbon_species(gas[, n_C_min, ...])

Return a list of solid carbon species from the gas phase object.

get_solid_carbon_mass_fraction(gas[, solid_sp, n_C_min])

Return the mass fraction of solid carbon species in the gas object.

get_solid_carbon_mole_fraction(gas[, solid_sp, n_C_min])

Return the mole fraction of solid carbon species in the gas object.

get_PAH_species(gas[, n_C_min, n_C_max])

Get the PAH species in the gas / states object based on the number of carbon atoms.

get_PAH_mole_fraction(gas[, n_C_min, n_C_max])

Get the mole fraction of PAH species in the gas / states object based on the number of carbon atoms.

get_solid_carbon_mass_fraction_from_states(states[, ...])

Return the mass fraction vector of solid carbon species from a Cantera states object.

get_solid_carbon_mole_fraction_from_states(states[, ...])

Return the mole fraction vector of solid carbon species from a Cantera states object.

compute_hhv_lhv_all(gas)

Compute Lower Heating Values (lhv) and Higher Heating Values (hhv) for all species in a Cantera gas phase.

Module Contents#

bloc.chem.species.get_solid_carbon_species(gas, n_C_min=80, solid_species_base=['C(s)', 'C(soot)', 'CSOLID', 'C(gr)'], return_indices=False)#

Return a list of solid carbon species from the gas phase object.

Parameters:
  • gas (cantera.Solution or cantera.SolutionArray) – The solution object from Cantera.

  • n_C_min (int or None, optional) – Minimum number of carbon atoms to consider a species as solid. Default is 80, according to Martin et al., PR#182 (spark-cleantech-l3/bloc#182). None means “no count-based rule at all” – only solid_species_base marks a species as solid (see bloc.chem.solid_carbon_threshold.resolve_n_c_min(), which returns None for mechanisms with no PAH/soot continuum, e.g. Fincke_GRC).

  • solid_species_base (list of str, optional) – Predefined list of solid species names. Default is ["C(s)", "C(soot)", "CSOLID", "C(gr)"].

  • return_indices (bool, optional) – If True, return each solid species’ index into gas.species_names (int) instead of its name (str). Default False. Useful for callers that repeatedly index a state array (e.g. phase.Y[indices]) and would otherwise need a second pass through cantera.Solution.species_index() to convert names to indices.

Returns:

solid_species – Names (default) or indices (return_indices=True) of species that have at least n_C_min carbon atoms OR are in the predefined solid species list.

Return type:

list of str or list of int

bloc.chem.species.get_solid_carbon_mass_fraction(gas, solid_sp=['C(s)', 'C(soot)', 'CSOLID'], n_C_min=300)#

Return the mass fraction of solid carbon species in the gas object.

Solid species are identified by their name or by the number of carbon atoms, through get_solid_carbon_species().

Parameters:
  • gas (cantera.Solution) – The gas object containing gaseous species and soot.

  • solid_sp (list of str, optional) – List of solid species to consider. Default is [“C(s)”, “C(soot)”, “CSOLID”].

  • n_C_min (int, optional) – Minimum number of carbon atoms to consider a species as solid. Default is 300. This is used as a second filter to identify solid carbon species. A specie is considered solid if it satisfies one criterium (s in solid_sp) OR the other (n_C >= n_C_min).

Returns:

The mass fraction of solid carbon species in the gas object.

Return type:

float

bloc.chem.species.get_solid_carbon_mole_fraction(gas, solid_sp=['C(s)', 'C(soot)', 'CSOLID'], n_C_min=300)#

Return the mole fraction of solid carbon species in the gas object.

Parameters:
  • gas (cantera.Solution or cantera.SolutionArray) – The gas object with composition set.

  • solid_sp (list of str, optional) – List of solid species to consider. Default is [“C(s)”, “C(soot)”, “CSOLID”].

  • n_C_min (int, optional) – Minimum number of carbon atoms to consider a species as solid. Default is 300.

Returns:

The mole fraction of solid carbon species in the gas object.

Return type:

float

bloc.chem.species.get_PAH_species(gas, n_C_min=6, n_C_max=300)#

Get the PAH species in the gas / states object based on the number of carbon atoms.

bloc.chem.species.get_PAH_mole_fraction(gas, n_C_min=6, n_C_max=300)#

Get the mole fraction of PAH species in the gas / states object based on the number of carbon atoms.

bloc.chem.species.get_solid_carbon_mass_fraction_from_states(states, solid_sp=['C(s)', 'C(soot)', 'CSOLID'], n_C_min=300)#

Return the mass fraction vector of solid carbon species from a Cantera states object.

Solid species are identified by their name or by the number of carbon atoms, through get_solid_carbon_species().

Parameters:
  • states (cantera.SolutionArray) – The states object from Cantera.

  • solid_sp (list of str, optional) – List of solid species to consider. Default is [“C(s)”, “C(soot)”, “CSOLID”].

  • n_C_min (int, optional) – Minimum number of carbon atoms to consider a species as solid. Default is 300. This is used as a second filter to identify solid carbon species. A specie is considered solid if it satisfies

Returns:

The mass fraction vector of solid carbon species (for each time step).

Return type:

np.ndarray

bloc.chem.species.get_solid_carbon_mole_fraction_from_states(states, solid_sp=['C(s)', 'C(soot)', 'CSOLID'], n_C_min=300)#

Return the mole fraction vector of solid carbon species from a Cantera states object.

Solid species are identified by their name or by the number of carbon atoms, through get_solid_carbon_species().

Parameters:
  • states (cantera.SolutionArray) – The states object from Cantera.

  • solid_sp (list of str, optional) – List of solid species to consider. Default is [“C(s)”, “C(soot)”, “CSOLID”].

  • n_C_min (int, optional) – Minimum number of carbon atoms to consider a species as solid. Default is 300. This is used as a second filter to identify solid carbon species. A specie is considered solid if it satisfies one criterium (s in solid_sp) OR the other (n_C >= n_C_min).

Returns:

The mole fraction vector of solid carbon species (for each time step).

Return type:

np.ndarray

bloc.chem.species.compute_hhv_lhv_all(gas)#

Compute Lower Heating Values (lhv) and Higher Heating Values (hhv) for all species in a Cantera gas phase.

Parameters:

gas (cantera.Solution) – Cantera gas phase object containing species and their thermodynamic data.

Returns:

One row per species in gas.species_names (same order), with hhv and lhv in J/kg and J/kmol. Non-fuel species (inerts, no C/H) get zero.

Return type:

pd.DataFrame

Notes

Product enthalpies for complete combustion (CO2, H2O vapor/liquid) go through _combustion_product_enthalpy_mole(), which uses mechanism NASA data when available and falls back to cantera.Water() / cantera.CarbonDioxide() pure-fluid references otherwise.

bloc.chem.species.mechanism_path = ''#