Thermodynamical models
ChemistryLab.THERMO_FACTORIESChemistryLab.THERMO_MODELSChemistryLab._THERMO_OUTPUT_UNITSChemistryLab._build_hkf_thermo_functionsChemistryLab.add_thermo_modelChemistryLab.build_thermo_factoriesChemistryLab.build_thermo_functions
ChemistryLab.THERMO_FACTORIES — Constant
THERMO_FACTORIESDictionary storing compiled ThermoFactory objects for each model. Used to efficiently generate SymbolicFunc instances.
ChemistryLab.THERMO_MODELS — Constant
THERMO_MODELSDictionary storing raw thermodynamic model expressions and units. Keys are model names (symbols), values are dictionaries containing:
- Symbolic expressions for thermodynamic functions (Cp, H, S, G).
- Units for parameters and variables.
ChemistryLab._THERMO_OUTPUT_UNITS — Constant
_THERMO_OUTPUT_UNITSExplicit output units for each thermodynamic function key. Used by build_thermo_factories to populate ThermoFactory.output_unit without relying on symbolic unit propagation.
ChemistryLab._build_hkf_thermo_functions — Method
_build_hkf_thermo_functions(params) -> OrderedDictInternal builder for the HKF (Helgeson-Kirkham-Flowers 1981/1988) standard thermodynamic model for aqueous solutes.
params must contain (all in SI units):
:a1,:a2,:a3,:a4— equation-of-state coefficients (J·mol⁻¹·Pa⁻¹, etc.):c1,:c2— heat-capacity coefficients (J·mol⁻¹·K⁻¹, J·K·mol⁻¹):wref— reference Born coefficient ω_ref (J/mol):z— species charge (dimensionless):S⁰or:Sr— standard entropy at (Tr, Pr) (J·mol⁻¹·K⁻¹):ΔₐH⁰or:ΔfH⁰— standard enthalpy of formation (J/mol):ΔₐG⁰or:ΔfG⁰— standard Gibbs energy of formation (J/mol)
ChemistryLab.add_thermo_model — Method
add_thermo_model(model_name, dict_model::AbstractDict)Add a new thermodynamic model to the registry using a dictionary of expressions.
Arguments
model_name: unique symbol for the model.dict_model: dictionary containing symbolic expressions and units.
See also: add_thermo_model(model_name, Cpexpr::Expr, units) — variant that automatically integrates a Cp expression to obtain H, S and G. Requires loading SymbolicNumericIntegration:
using SymbolicNumericIntegration
add_thermo_model(:my_model, :(a + b*T), [:T => u"K", :a => u"J/mol/K", :b => u"J/(mol*K^2)"])ChemistryLab.build_thermo_factories — Method
build_thermo_factories(dict_expr) -> DictHelper function to build ThermoFactory objects from a model dictionary.
ChemistryLab.build_thermo_functions — Method
build_thermo_functions(model_name, params) -> OrderedDictBuild thermodynamic function objects for a specific model and parameters. Dispatches on Val(model_name) — add a new method for each new model.
Arguments
model_name: symbol identifying the thermodynamic model (e.g.,:cp_ft_equation).params: dictionary or pair list of parameter values.
Returns
OrderedDictcontaining the constructed thermodynamic functions (Cp⁰,ΔₐH⁰,S⁰,ΔₐG⁰).