temperature_model
Data-driven model that maps pyrolysis temperature (and optionally feedstock) to biochar composition targets (H/C ratio, O/C ratio, aromaticity) and a set of reference properties. Fit from the UC Davis Biochar Database (https://biochar.ucdavis.edu/) with aromaticity calibrated from NMR data collected by Wood, Mašek & Erastova (2024).
Module-level helpers
- biochar.temperature_model.properties(temperature, feedstock=None)[source]
Convenience: all modeled biochar properties at a pyrolysis temperature (°C), optionally for a feedstock (one of
VALID_FEEDSTOCKS).Example:
import biochar biochar.properties(600, feedstock="softwood")
- biochar.temperature_model.VALID_FEEDSTOCKS = ('corn_stover', 'grass', 'hardwood', 'manure', 'softwood', 'wood')
First-class feedstocks eligible for per-group H/C and O/C overrides.
TemperatureModel
- class biochar.temperature_model.TemperatureModel(model_path=None)[source]
Bases:
objectQuery the bundled temperature × feedstock property model.
- Parameters:
model_path – Path to the JSON artifact (defaults to the bundled file).
- Parameters:
model_path (Optional[Path])
- predict(temperature, prop, feedstock=None)[source]
Predict prop at temperature (°C). Uses the feedstock-specific curve only for H/C and O/C when that group has one and temperature is within its support; otherwise the pooled curve. Clamped to the grid ends.
- composition(temperature, feedstock=None)[source]
The three generator targets at temperature (and feedstock).
Build helper
- biochar.temperature_model.build_model(output_path=None)[source]
Build the temperature-model JSON artifact from the bundled CSVs.
Dev/offline entry point:
python -c "from biochar.temperature_model import build_model; build_model()"
Returns the path written. Prints a short QC report (dedup count, per-property point counts, aromaticity fit R²).