uclchem.makerates.heating#

Heating and cooling calculations for UCLCHEM reactions.

Provides functions to set reaction exothermicities from thermochemical databases or custom CSV files with various units.

Module Contents#

Functions#

convert_to_erg(→ float)

Convert exothermicity to erg per reaction.

load_custom_exothermicities(→ pandas.DataFrame)

Load custom exothermicities from CSV.

match_reaction(...)

Find matching reaction in list.

parse_species_from_row(→ list[str])

Parse species list from CSV row.

set_custom_exothermicities(→ tuple[int, int])

Set reaction exothermicities from custom CSV.

Attributes#

uclchem.makerates.heating.convert_to_erg(value: float, unit: str) float[source]#

Convert exothermicity to erg per reaction.

Parameters:
  • value (float) – Exothermicity value

  • unit (str) – Unit string (case-insensitive)

Returns:

Value in erg per reaction

Return type:

float

uclchem.makerates.heating.load_custom_exothermicities(csv_path: str | pathlib.Path) pandas.DataFrame[source]#

Load custom exothermicities from CSV.

Expected columns: reactant1-3, product1-4, exothermicity, unit

Parameters:

csv_path (str | Path) – Path to CSV file

Returns:

df – DataFrame with custom exothermicities

Return type:

pd.DataFrame

Raises:

ValueError – If the csv is missing certain columns.

uclchem.makerates.heating.match_reaction(reactants: list[str], products: list[str], reactions: list[uclchem.makerates.reaction.Reaction]) uclchem.makerates.reaction.Reaction | None[source]#

Find matching reaction in list.

Parameters:
  • reactants (list[str]) – List of reactant names

  • products (list[str]) – List of product names

  • reactions (list[Reaction]) – List to search

Returns:

Matching Reaction or None

Return type:

Reaction | None

uclchem.makerates.heating.parse_species_from_row(row: pandas.Series, prefix: str) list[str][source]#

Parse species list from CSV row.

Parameters:
  • row (pd.Series) – DataFrame row

  • prefix (str) – ‘reactant’ or ‘product’

Returns:

List of species names (uppercase, NAN for missing)

Return type:

list[str]

uclchem.makerates.heating.set_custom_exothermicities(reactions: list[uclchem.makerates.reaction.Reaction], csv_path: str | pathlib.Path, overwrite: bool = True) tuple[int, int][source]#

Set reaction exothermicities from custom CSV.

Parameters:
  • reactions (list[Reaction]) – List of Reaction objects to modify

  • csv_path (str | Path) – Path to CSV with custom exothermicities

  • overwrite (bool) – If False, only set reactions with zero exothermicity. Default = True.

Returns:

  • matched (int) – number of matched reactions

  • unmatched (int) – number of unmatched reactions

uclchem.makerates.heating.AVOGADRO_NUMBER = 6.02214076e+23[source]#
uclchem.makerates.heating.CALORIE_TO_JOULE = 4.184[source]#
uclchem.makerates.heating.ERG_TO_ERG = 1.0[source]#
uclchem.makerates.heating.ERG_TO_JOULE = 1e-07[source]#
uclchem.makerates.heating.EV_TO_ERG = 1.602176634e-12[source]#
uclchem.makerates.heating.EV_TO_JOULE = 1.602176634e-19[source]#
uclchem.makerates.heating.JOULE_TO_ERG = 10000000.0[source]#
uclchem.makerates.heating.KCAL_TO_ERG = 41840000000.0[source]#
uclchem.makerates.heating.logger[source]#