Calculator API

High-level interface for calculating thermochemical properties.

Types

Glenn.ThermoPropertiesType
ThermoProperties

Immutable struct holding calculated thermochemical properties at a given temperature. All values in SI units: Cp, S° → J/(mol·K); H° → J/mol.

Fields

  • temperature::Float64 : Temperature (K)
  • cp::Float64 : Heat capacity (J/(mol·K))
  • h_relative::Float64 : Enthalpy relative to 0 K (J/mol)
  • s::Float64 : Absolute entropy (J/(mol·K))
  • temp_min::Float64 : Lower bound of valid interval (K)
  • temp_max::Float64 : Upper bound of valid interval (K)
  • species_name::String : Species name
  • phase::String : Phase ("gas" or "condensed")
source
Glenn.CalculatorType
Calculator

High-level interface for calculating thermochemical properties. Wraps a ThermoDB connection.

Call without arguments to use the bundled thermo.db: calc = Calculator()

source

Functions

Glenn.ThermoCalculator.default_inp_pathFunction
default_inp_path() -> String

Return the path to the bundled thermo.inp shipped with the package.

Used as the default input for ThermoDBBuilder when rebuilding the database.

source
Glenn.ThermoCalculator.get_available_speciesFunction
get_available_species(calc::Calculator, pattern::AbstractString=""; exact_match::Bool=false) -> Vector{SpeciesInfo}

Return a list of available species, optionally filtered by name pattern.

If exact_match=false (default), performs a substring search. Use exact_match=true for case-insensitive exact match — only the species whose name matches the pattern exactly is returned (e.g. $"N2"$ returns only N₂, not Be₃N₂).

source
Glenn.ThermoCalculator.calculate_propertiesFunction
calculate_properties(calc::Calculator, species_id::Int, T::Float64)
   -> ThermoProperties

Calculate thermochemical properties at a given temperature.

Returns a ThermoProperties struct with Cp, H°, S° and metadata.

Throws SpeciesNotFoundError if the species ID is invalid. Throws TemperatureOutOfRangeError if T is outside all valid intervals.

source
calculate_properties(calc::Calculator, species_id::Int,
                     T_range::AbstractVector{<:Real}) -> Vector{ThermoProperties}

Vectorized: calculate thermochemical properties for multiple temperatures.

Loads coefficients once from the database and evaluates the polynomial for each temperature in memory — much faster than calling the scalar version in a loop.

Throws SpeciesNotFoundError if the species ID is invalid. Skips temperatures outside valid intervals (returns only valid results).

source
Glenn.ThermoCalculator.calculate_formation_enthalpyFunction
calculate_formation_enthalpy(calc::Calculator, species_id::Int) -> Union{Float64, Nothing}

Return the enthalpy of formation at 298.15 K (J/mol).

Returns nothing if the species exists but has no formation enthalpy data. Throws SpeciesNotFoundError if the species ID is invalid.

source
Glenn.ThermoCalculator.calculate_enthalpy_changeFunction
calculate_enthalpy_change(calc::Calculator, species_id::Int,
                          T1::Float64, T2::Float64) -> Float64

Calculate ΔH = H(T2) - H(T1) for a species (J/mol).

Throws on invalid species or out-of-range temperatures.

source
Glenn.ThermoCalculator.get_properties_rangeFunction
get_properties_range(calc::Calculator, species_id::Int,
                     T_range::AbstractVector{<:Real}) -> Vector{ThermoProperties}

Calculate thermochemical properties over a range of temperatures.

Delegates to the vectorized calculate_properties for efficiency.

source

Constants