bloc.chem.carbon_dominance#

Carbon-species dominance classification for pyrolysis maps.

Attributes#

Functions#

build_category_map(gas, *, n_C_min)

Map dominance categories to mechanism species names present in gas.

category_mass_fractions(gas, category_map)

Return summed mass fraction per category at the current gas state.

solid_carbon_yield_fraction(fractions)

Mass fraction of solid carbon (C(s) + BIN soot) in the product.

dominant_category(fractions)

Return the carbon category with the largest mass fraction.

result_from_state(gas, category_map, *, temperature_K, ...)

Build a sweep result dict from the current gas state.

trajectory_sample_from_result(result, *, ...)

Convert a grid result row into a trajectory CSV row.

Module Contents#

bloc.chem.carbon_dominance.CATEGORY_ORDER = ('CH4', 'C2H2', 'C2H4', 'C2H6', 'C(s)', 'BIN', 'PAH', 'other_C')#
bloc.chem.carbon_dominance.build_category_map(gas, *, n_C_min)#

Map dominance categories to mechanism species names present in gas.

n_C_min is the minimum carbon count for a species to classify as solid carbon (C(s)), in addition to the explicitly named solids – None means no count-based rule at all (only the named solids count). Callers should resolve this via bloc.chem.solid_carbon_threshold.resolve_n_c_min() (mechanism-aware; the same resolver the SPRING KPIs use) rather than hardcoding a value, so the map’s solid-carbon definition stays consistent with the calculation-note KPIs across every mechanism. BIN* soot(-precursor) species below the threshold are grouped as BIN; both categories count toward solid_carbon_yield_fraction().

bloc.chem.carbon_dominance.category_mass_fractions(gas, category_map)#

Return summed mass fraction per category at the current gas state.

bloc.chem.carbon_dominance.solid_carbon_yield_fraction(fractions)#

Mass fraction of solid carbon (C(s) + BIN soot) in the product.

bloc.chem.carbon_dominance.dominant_category(fractions)#

Return the carbon category with the largest mass fraction.

Raises ValueError on an empty mapping (a carbon-free mechanism) instead of silently reporting a default category.

bloc.chem.carbon_dominance.result_from_state(gas, category_map, *, temperature_K, residence_time_s, reactor_mode)#

Build a sweep result dict from the current gas state.

bloc.chem.carbon_dominance.trajectory_sample_from_result(result, *, initial_temperature_K)#

Convert a grid result row into a trajectory CSV row.