Thermodynamical models

ChemistryLab.THERMO_FACTORIESConstant
THERMO_FACTORIES

Dictionary storing compiled ThermoFactory objects for each model. Used to efficiently generate SymbolicFunc instances.

source
ChemistryLab.THERMO_MODELSConstant
THERMO_MODELS

Dictionary 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.
source
ChemistryLab._THERMO_OUTPUT_UNITSConstant
_THERMO_OUTPUT_UNITS

Explicit output units for each thermodynamic function key. Used by build_thermo_factories to populate ThermoFactory.output_unit without relying on symbolic unit propagation.

source
ChemistryLab._build_hkf_thermo_functionsMethod
_build_hkf_thermo_functions(params) -> OrderedDict

Internal 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)
source
ChemistryLab.add_thermo_modelMethod
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)"])
source
ChemistryLab.build_thermo_functionsMethod
build_thermo_functions(model_name, params) -> OrderedDict

Build 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

  • OrderedDict containing the constructed thermodynamic functions (Cp⁰, ΔₐH⁰, S⁰, ΔₐG⁰).
source