Database API

Low-level SQLite query interface and NASA-7 polynomial calculations.

All thermodynamic functions return dimensionless values (divided by R).

Exception Types

Types

Glenn.NASACoefficientsType
NASACoefficients

Immutable struct holding the 9 NASA-7 polynomial coefficients (a₁–a₇, b₁, b₂). All fields are Float64 — use 0.0 for missing coefficients.

source

Statistics

Species Lookup

Glenn.ThermoDatabase.find_speciesFunction
find_species(tdb::ThermoDB, name::AbstractString; exact_match::Bool=false) -> Vector{SpeciesInfo}

Find species by name or formula.

If exact_match=false (default), performs a substring search (LIKE) and returns up to 20 matches, with exact matches prioritised first.

If exact_match=true, performs a 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.ThermoDatabase.list_all_speciesFunction
list_all_species(tdb::ThermoDB) -> Vector{SpeciesInfo}

Return all species in a single query (no pagination). Faster than paginating when you need the full list.

source
Glenn.ThermoDatabase.get_species_dataFunction
get_species_data(tdb::ThermoDB, species_id::Int) -> Union{Dict, Nothing}

Get complete data for a species including all its temperature intervals and polynomial coefficients.

source
Glenn.ThermoDatabase.get_species_infoFunction
get_species_info(tdb::ThermoDB, species_id::Int) -> Union{SpeciesInfo, Nothing}

Lightweight lookup: returns basic species metadata (id, name, formula, phase, molecularweight, heatofformation298K) without loading temperature intervals or coefficients.

Use this when you only need species identification, not the full thermochemical data.

source
Glenn.ThermoDatabase.get_species_for_temperatureFunction
get_species_for_temperature(tdb::ThermoDB, species_id::Int, temperature::Float64)
   -> Union{IntervalData, Nothing}

Find the temperature interval and coefficients valid for the given temperature. Returns an IntervalData struct, or nothing if out of range.

source

NASA-7 Polynomials

Glenn.ThermoDatabase.calculate_cpFunction
calculate_cp(coeffs::NASACoefficients, T::Float64) -> Float64

Calculate Cp(T)/R using NASA-7 polynomial coefficients.

Equation: a1·T⁻² + a2·T⁻¹ + a3 + a4·T + a5·T² + a6·T³ + a7·T⁴

source
Glenn.ThermoDatabase.calculate_hFunction
calculate_h(coeffs::NASACoefficients, T::Float64) -> Float64

Calculate H°(T)/RT using NASA-7 polynomial coefficients.

Equation: -a1·T⁻² + a2·ln(T)/T + a3 + a4·T/2 + a5·T²/3

  • a6·T³/4 + a7·T⁴/5 + b1/T
source
Glenn.ThermoDatabase.calculate_sFunction
calculate_s(coeffs::NASACoefficients, T::Float64) -> Float64

Calculate S°(T)/R using NASA-7 polynomial coefficients.

Equation: -a1·T⁻²/2 - a2·T⁻¹ + a3·ln(T) + a4·T + a5·T²/2

  • a6·T³/3 + a7·T⁴/4 + b2
source