Importing packages and classes#
The Combustion Toolbox (CT) is organized using namespaces (starting from version 1.1.0). The main namespace is combustiontoolbox. The classes and methods included in CT’s modules (described in detail later) rely on several core and database classes, including:
Elements
: stores the list of elements that may appear in the database.Species
: object containing the properties of a chemical species.ChemicalSystem
: object that defines the chemical system.EquationState
: object that defines the equation of state.Mixture
: object that defines a multicomponent mixture.Database
: an abstract class that contains common methods for the databases.NasaDatabase
: a structured thermochemical database including data from McBride [2002], Burcat and Ruscic [2005] with griddedInterpolant objects (see MATLAB built-in function griddedInterpolant.m) that contain piecewise cubic Hermite interpolating polynomials (PCHIP) [Fritsch and Carlson, 1980] for faster data access.
To get started, let’s import one of the subpackages of the Combustion Toolbox, the databases
package. This package contains the classes that define the databases used in CT. To import the databases
package, use the following command:
import combustiontoolbox.databases.*
For importing a specific class, such as NasaDatabase
, use:
import combustiontoolbox.databases.NasaDatabase
In addition to the classes described above, there are other essential classes in the Combustion Toolbox, for example:
EquilibriumSolver
: solver class for equilibrium calculations,ShockSolver
: solver class for shock calculations,DetonationSolver
: solver class for detonation calculations,RocketSolver
: solver class for rocket calculations,
These classes are part of the CT-EQUIL (equilibrium), CT-SD (shockdetonation), and CT-ROCKET (rocket) modules (subpackages), respectively. All the classes and subpackages are imported as shown below:
import combustiontoolbox.equilibrium.equilibriumSolver
import combustiontoolbox.shockdetonation.shockSolver
import combustiontoolbox.rocket.Rocket
For typical tasks, in addition to the solvers required, you will often need the following subpackages:
import combustiontoolbox.databases.NasaDatabase
import combustiontoolbox.core.*
import combustiontoolbox.utils.display.*
This setup will ensure that you have access to the key components of the Combustion Toolbox for most of your tasks.
Summary#
% Import packages
import combustiontoolbox.databases.NasaDatabase
import combustiontoolbox.core.*
% Import packages
import combustiontoolbox.databases.NasaDatabase
import combustiontoolbox.core.*
import combustiontoolbox.equilibrium.*
% Import packages
import combustiontoolbox.databases.NasaDatabase
import combustiontoolbox.core.*
import combustiontoolbox.shockdetonation.*
% Import packages
import combustiontoolbox.databases.NasaDatabase
import combustiontoolbox.core.*
import combustiontoolbox.rocket.*