Database
The SQLite database stores NASA polynomial coefficients for each species in a normalised three-table schema.
Database Schema
The database contains three linked tables:
species — chemical species metadata
id— primary key (auto-increment)name— species name (e.g.,'CH4','CO2')formula— chemical formulaphase—'gas'or'condensed'molecular_weight— in g/molheat_of_formation_298K— ΔH°f at 298.15 K in J/molnum_intervals— number of temperature intervalscomments— free-text notes
temperature_intervals — one row per temperature range per species
id— primary keyspecies_id— foreign key →species.idinterval_number— 1, 2, 3, …temp_min— minimum valid temperature [K]temp_max— maximum valid temperature [K]h_298_to_0— H°(298.15) − H°(0) in J/mol
coefficients — NASA-7 polynomial coefficients (one row per interval)
id— primary keyinterval_id— foreign key →temperature_intervals.ida1…a7— polynomial coefficientsb1,b2— integration constants
metadata — additive dataset metadata
key— metadata keyvalue— metadata value
Newly built NASA Glenn/CEA databases store gas_constant_ref = 8.314510 and
its provenance in this table. Legacy databases without this table remain
readable and use the universal fallback constant.
NASA Polynomial Format
pyglenn uses the alternate NASA-7 form (also known as the “old” or “Gordon–McBride” form). The dimensionless properties are:
These match the implementation in pyglenn.database
(calculate_cp(),
calculate_h(),
calculate_s()).
Querying the Database
You can query the database directly using ThermoDBQuery:
from pyglenn import ThermoDBQuery
query = ThermoDBQuery('thermo.db')
query.connect()
# Search species by name
species = query.find_species('CH4', exact_match=True)
print(species[0].name, species[0].phase)
# Get complete data (metadata + all intervals + coefficients)
data = query.get_species_data(species[0].id)
for interval in data.intervals:
print(f" {interval.temp_min}–{interval.temp_max} K")
coeffs = interval.coefficients
print(f" a1={coeffs.a1}, …, a7={coeffs.a7}")
query.close()
Gas Constants
The universal CODATA gas constant and the NASA Glenn/CEA dataset reference
constant are available as pyglenn.R_UNIVERSAL and
pyglenn.R_GLENN. pyglenn.R remains a compatibility alias for
the universal value.
from pyglenn import R_GLENN, R_UNIVERSAL
print(f"R (universal) = {R_UNIVERSAL} J/(mol·K)")
print(f"R (NASA Glenn) = {R_GLENN} J/(mol·K)")