Database API
Low-level SQLite query interface and NASA-7 polynomial calculations.
All thermodynamic functions return dimensionless values (divided by R).
Exception Types
Glenn.ThermoCalcError — Type
ThermoCalcErrorBase exception type for thermochemical calculation errors.
Glenn.DatabaseNotConnectedError — Type
DatabaseNotConnectedErrorRaised when attempting a calculation without an active database connection.
Glenn.SpeciesNotFoundError — Type
SpeciesNotFoundErrorRaised when a species ID is not found in the database.
Glenn.TemperatureOutOfRangeError — Type
TemperatureOutOfRangeErrorRaised when the requested temperature is outside all valid intervals for the given species.
Types
Glenn.NASACoefficients — Type
NASACoefficientsImmutable struct holding the 9 NASA-7 polynomial coefficients (a₁–a₇, b₁, b₂). All fields are Float64 — use 0.0 for missing coefficients.
Glenn.SpeciesInfo — Type
SpeciesInfoLightweight immutable struct with basic species metadata.
Glenn.IntervalData — Type
IntervalDataCombines a temperature interval with its NASA-7 coefficients.
Glenn.ThermoDatabase.ThermoDB — Type
ThermoDBHandle to an open thermochemical SQLite3 database.
Statistics
Glenn.ThermoDatabase.get_statistics — Function
get_statistics(tdb::ThermoDB) -> DictReturn summary statistics from the database.
Species Lookup
Glenn.ThermoDatabase.find_species — Function
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₂).
Glenn.ThermoDatabase.list_species_page — Function
list_species_page(tdb::ThermoDB; page=1, page_size=20) -> (Vector{SpeciesInfo}, Int)List species with pagination. Returns a tuple (species_list, total_pages).
Glenn.ThermoDatabase.list_all_species — Function
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.
Glenn.ThermoDatabase.get_species_data — Function
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.
Glenn.ThermoDatabase.get_species_info — Function
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.
Glenn.ThermoDatabase.get_species_for_temperature — Function
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.
NASA-7 Polynomials
Glenn.ThermoDatabase.calculate_cp — Function
calculate_cp(coeffs::NASACoefficients, T::Float64) -> Float64Calculate Cp(T)/R using NASA-7 polynomial coefficients.
Equation: a1·T⁻² + a2·T⁻¹ + a3 + a4·T + a5·T² + a6·T³ + a7·T⁴
Glenn.ThermoDatabase.calculate_h — Function
calculate_h(coeffs::NASACoefficients, T::Float64) -> Float64Calculate 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
Glenn.ThermoDatabase.calculate_s — Function
calculate_s(coeffs::NASACoefficients, T::Float64) -> Float64Calculate 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