bloc.chem.species#
Compute Lower Heating Values (LHV) and Higher Heating Values (HHV) for arbitrary species.
Attributes#
Functions#
|
Return a list of solid carbon species from the gas phase object. |
|
Return the mass fraction of solid carbon species in the gas object. |
|
Return the mole fraction of solid carbon species in the gas object. |
|
Get the PAH species in the gas / states object based on the number of carbon atoms. |
|
Get the mole fraction of PAH species in the gas / states object based on the number of carbon atoms. |
|
Return the mass fraction vector of solid carbon species from a Cantera states object. |
|
Return the mole fraction vector of solid carbon species from a Cantera states object. |
|
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.Solutionorcantera.SolutionArray) – The solution object from Cantera.n_C_min (
intorNone, 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).Nonemeans “no count-based rule at all” – only solid_species_base marks a species as solid (seebloc.chem.solid_carbon_threshold.resolve_n_c_min(), which returnsNonefor mechanisms with no PAH/soot continuum, e.g. Fincke_GRC).solid_species_base (
listofstr, optional) – Predefined list of solid species names. Default is["C(s)", "C(soot)", "CSOLID", "C(gr)"].return_indices (
bool, optional) – IfTrue, return each solid species’ index intogas.species_names(int) instead of its name (str). DefaultFalse. Useful for callers that repeatedly index a state array (e.g.phase.Y[indices]) and would otherwise need a second pass throughcantera.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:
listofstrorlistofint
- 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 (
listofstr, 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.Solutionorcantera.SolutionArray) – The gas object with composition set.solid_sp (
listofstr, 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 (
listofstr, 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 (
listofstr, 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,H2Ovapor/liquid) go through_combustion_product_enthalpy_mole(), which uses mechanism NASA data when available and falls back tocantera.Water()/cantera.CarbonDioxide()pure-fluid references otherwise.
- bloc.chem.species.mechanism_path = ''#