HHV_STOICHIOMETRY
This function computes the higher heating value from a fuel’s theoretical combustion stoichiometry and its heat of formation. It evaluates the combustion reaction enthalpy using standard heats of formation for the products in the stoichiometric dictionary.
The sign convention follows the reaction enthalpy:
HHV = \sum_i \nu_i H_{f,i}^{\circ} - H_{f,fuel}^{\circ}
For an exothermic combustion reaction, the returned value is typically negative because the products have a lower enthalpy than the reactants. This convention is useful when combining the result directly with stoichiometric balances and downstream heating-value conversions.
Excel Usage
=HHV_STOICHIOMETRY(stoichiometry, Hf, Hf_chemicals)
stoichiometry(str, required): Stoichiometric coefficients of combustion.Hf(float, required): Heat of formation [J/mol].Hf_chemicals(str, optional, default: null): Heat of formation of chemicals present in stoichiometry [J/mol].
Returns (float): Higher heating value [J/mol].
Example 1: Methane HHV
Inputs:
| stoichiometry | Hf |
|---|---|
| {“O2”: -2.0, “CO2”: 1, “H2O”: 2.0} | -74520 |
Excel formula:
=HHV_STOICHIOMETRY("{"O2": -2.0, "CO2": 1, "H2O": 2.0}", -74520)
Expected output:
-890604
Example 2: Methanol HHV
Inputs:
| stoichiometry | Hf |
|---|---|
| {“O2”: -1.5, “CO2”: 1, “H2O”: 2.0} | -201000 |
Excel formula:
=HHV_STOICHIOMETRY("{"O2": -1.5, "CO2": 1, "H2O": 2.0}", -201000)
Expected output:
-764124
Example 3: Methane HHV with explicit product heats of formation
Inputs:
| stoichiometry | Hf | Hf_chemicals |
|---|---|---|
| {“O2”: -2.0, “CO2”: 1, “H2O”: 2.0} | -74520 | {“O2”: 0, “CO2”: -393474, “H2O”: -285825} |
Excel formula:
=HHV_STOICHIOMETRY("{"O2": -2.0, "CO2": 1, "H2O": 2.0}", -74520, "{"O2": 0, "CO2": -393474, "H2O": -285825}")
Expected output:
-890604
Python Code
Show Code
import json
from chemicals.combustion import HHV_stoichiometry
def hhv_stoichiometry(stoichiometry, Hf, Hf_chemicals=None):
"""
Returns the higher heating value based on theoretical combustion stoichiometry and heat of formation.
See: https://chemicals.readthedocs.io/chemicals.combustion.html
This example function is provided as-is without any representation of accuracy.
Args:
stoichiometry (str): Stoichiometric coefficients of combustion.
Hf (float): Heat of formation [J/mol].
Hf_chemicals (str, optional): Heat of formation of chemicals present in stoichiometry [J/mol]. Default is None.
Returns:
float: Higher heating value [J/mol].
"""
try:
st = json.loads(stoichiometry) if isinstance(stoichiometry, str) else stoichiometry
hfc = json.loads(Hf_chemicals) if Hf_chemicals and isinstance(Hf_chemicals, str) else Hf_chemicals
return float(HHV_stoichiometry(st, Hf, hfc))
except Exception as e:
return f"Error: {str(e)}"