Accessing the databases#
In the preceding section, we discussed how to import some of the necessary classes and packages that comprise the Combustion Toolbox (CT). In this section, we will delve into how to access the databases incorporated within CT.
There are two main types of databases: NasaDatabase
and BurcatDatabase
. The former comprises all data from NASA’s database McBride [2002]. The latter extracts data from the Third Millennium database Burcat and Ruscic [2005]. There is an additional third database, SolarAbundances
, which stores the solar abundances of the elements Asplund et al. [2009].
Tip
By default, the stored NasaDatabase object contains all the species from NASA’s database McBride [2002] and the Third Millennium database Burcat and Ruscic [2005]. The size of this database is approximately 36 MB. To reduce memory usage and loading time, a streamlined version of the database can be generated by selecting only the species of interest. To generate this streamlined version, execute the following command:
DB = generateDatabase(NasaDatabase(), {'O2', 'N2'});
Subsequently, save the DB variable in the databases
folder as DB.mat to be loaded in the remaining sessions.
This can be done by the following command:
save(DB);
Finding specific chemical species#
The thermodynamic data are defined through Species objects and they are stored in the database’s species property. For example, to access to the carbon soot species Cgr, we can use the following command:
DB.species.Cbgrb
This command will yield the following information:
Species with properties:
name: 'Cbgrb'
fullname: 'C(gr)'
refCode: 'n 4/83'
comments: 'Graphite. Ref-Elm. TRC(4/83) vc,uc,tc1000-1002. '
formula: 'C 1.00 0.00 0.00 0.00 0.00'
W: 0.0120
hf: 0
hftoh0: {[1.0535e+03] [1.0535e+03] [1.0535e+03]}
ef: [0]
phase: [1]
T: [200 229.1457 258.2915 287.4372 316.5829 345.7286 374.8744 404.0201 433.1658 462.3116 … ] (1×200 double)
Tref: [298.1500]
Trange: {[200 600] [600 2000] [2000 6000]}
Tintervals: [3]
Texponents: {[-2 -1 0 1 2 3 4 0] [-2 -1 0 1 2 3 4 0] [-2 -1 0 1 2 3 4 0]}
a: {[1.1329e+05 -1.9804e+03 13.6538 -0.0464 1.0213e-04 -1.0829e-07 4.4723e-11 0] [1×8 double] [1×8 double]}
b: {[8.9439e+03 -72.9582] [1.3984e+04 -44.7718] [5.8481e+03 -23.5093]}
cpcurve: [1×1 griddedInterpolant]
h0curve: [1×1 griddedInterpolant]
s0curve: [1×1 griddedInterpolant]
g0curve: [1×1 griddedInterpolant]
These details offer comprehensive insights into the thermodynamic properties of the specified species in the Combustion Toolbox database. We have the following fields:
name
: short name of the species as defined in the database.fullname
: full name of the species.refCode
: reference code.comments
: comments about the species.formula
: chemical formula of the species.W
: molar mass [kg/mol].hf
: enthalpy of formation at Tref from its reference species in their standard state [J/mol]hftoh0
: enthalpy of formation at Tref relative to molar enthalpy at 0 K for standard state [J/mol]ef
: standard internal energy of formation [J/mol].phase
: phase of the species (0: gas, 1: liquid or solid).T
: temperature vector [K].Tref
: reference temperature [K].Trange
: temperature range.Tintervals
: number of temperature intervals.Texponents
: temperature exponents for the standard specific heat capacity at constant pressure, standard enthalpy, and standard entropy, respectively.cpcurve
: griddedInterpolant object containing the standard specific heat capacity at constant pressure [J/mol-K].h0curve
: griddedInterpolant object containing the standard enthalpy [J/mol].s0curve
: griddedInterpolant object containing the standard entropy [J/mol-K].g0curve
: griddedInterpolant object containing the standard Gibbs free energy [J/mol].
Finding list of chemical species with given chemical elements#
To find the list of species that contain only some chemical elements, we first have to define a chemical system. Briefly, because this will be explained in more detail in the next sections, this can be done as:
import combustiontoolbox.core.*
import combustiontoolbox.databases.NasaDatabase
DB = NasaDatabase();
chemicalSystem = ChemicalSystem(DB);
After defining the chemical system, we can use the findProducts()
function to find the list of species that contain only the specified chemical elements. For example, to find all species that contain oxygen (O) and hydrogen (H), we can use the following command:
listSpecies = findProducts(chemicalSystem, {'O', 'H'})
which will yield the following output:
listSpecies =
1×15 cell array
Columns 1 through 7
{'HO2'} {'H2O'} {'H2O2'} {'OH'} {'H2Obcrb'} {'H2ObLb'} {'H2O2bLb'}
Columns 8 through 15
{'O'} {'O2'} {'O3'} {'O2bLb'} {'O3bLb'} {'H'} {'H2'} {'H2bLb'}
Note
By default, the findProducts()
function looks for species in the NASA database, includes condensed species, and excludes ionized species. To search for species in Burcat’s database and include ionized species, set flag_burcat
and flag_ion
options to true
. Chemical species from the Third Millennium database (Burcat) are indicated with the subscript _M
.
listSpecies = findProducts(chemicalSystem, {'O', 'H'}, 'flag_burcat', true)
which will yield the following output:
listSpecies =
1×25 cell array
Columns 1 through 7
{'HO2'} {'H2O'} {'H2O2'} {'OH'} {'H2Obcrb'} {'H2ObLb'} {'H2O2bLb'}
Columns 8 through 14
{'OH_M'} {'HO2_M'} {'HO3_M'} {'H2O2_M'} {'H2O3_M'} {'HOOOH_M'} {'O'}
Columns 15 through 21
{'O2'} {'O3'} {'O2bLb'} {'O3bLb'} {'O_M'} {'O2_M'} {'O3_M'}
Columns 22 through 25
{'O4_M'} {'H'} {'H2'} {'H2bLb'}
Note
Chemical species from the Third Millennium database (Burcat) are indicated with the subscript _M
. By default, the findProducts()
function looks for species in the NASA database, includes condensed species, and excludes ionized species. To search for species in Burcat’s database, we have enabled the flag_burcat
option, setting it to true
.
listSpecies = findProducts(chemicalSystem, {'O', 'H'}, 'flag_burcat', true, 'flag_ion', true)
which will yield the following output:
listSpecies =
1×52 cell array
Columns 1 through 6
{'HO2minus'} {'H2Oplus'} {'H3Oplus'} {'OHplus'} {'OHminus'} {'HO2plus_M'}
Columns 7 through 11
{'HO2minus_M'} {'HO3plus_M'} {'HO3minus_M'} {'H2O2plus_M'} {'H2O3plus_M'}
Columns 12 through 17
{'H3O2plus_M'} {'Oplus'} {'Ominus'} {'O2plus'} {'O2minus'} {'O3plus_M'}
Columns 18 through 23
{'O3minus_M'} {'O4plus_M'} {'O4minus_M'} {'Hplus'} {'Hminus'} {'H2plus'}
Columns 24 through 29
{'H2minus'} {'H2minus_M'} {'H3plus_M'} {'eminus'} {'HO2'} {'H2O'}
Columns 30 through 36
{'H2O2'} {'OH'} {'H2Obcrb'} {'H2ObLb'} {'H2O2bLb'} {'OH_M'} {'HO2_M'}
Columns 37 through 43
{'HO3_M'} {'H2O2_M'} {'H2O3_M'} {'HOOOH_M'} {'O'} {'O2'} {'O3'}
Columns 44 through 51
{'O2bLb'} {'O3bLb'} {'O_M'} {'O2_M'} {'O3_M'} {'O4_M'} {'H'} {'H2'}
Column 52
{'H2bLb'}
Note
Chemical species from the Third Millennium database (Burcat) are indicated with the subscript _M
. By default, the findProducts()
function looks for species in the NASA database, includes condensed species, and excludes ionized species. To search for species in Burcat’s database and include ionized species, we have enabled the flag_burcat
and flag_ion
options, setting both to true
. Alternatively, we can modify the default flag values in the Species.m file.
Tip
The same procedure can be used to identify all possible products after a chemical transformation given a set of chemical species (reactants), as described in Defining chemical system.