Extends base chemistry model by adding a thermo package, and ODE functions. Introduces chemistry equation system and evaluation of chemical source terms. More...
#include <chemistryModel/ODEChemistryModel.H>
Extends base chemistry model by adding a thermo package, and ODE functions. Introduces chemistry equation system and evaluation of chemical source terms.
Definition at line 61 of file ODEChemistryModel.H.
Public Member Functions | |
TypeName ("ODEChemistryModel") | |
Runtime type information.
| |
ODEChemistryModel (const fvMesh &mesh, const word &compTypeName, const word &thermoTypeName) | |
Construct from components.
| |
virtual | ~ODEChemistryModel () |
Destructor.
| |
const PtrList< Reaction < ThermoType > > & | reactions () const |
The reactions.
| |
const PtrList< ThermoType > & | specieThermo () const |
Thermodynamic data of the species.
| |
label | nSpecie () const |
The number of species.
| |
label | nReaction () const |
The number of reactions.
| |
const chemistrySolver < CompType, ThermoType > & | solver () const |
Return the chemisty solver.
| |
virtual scalarField | omega (const scalarField &c, const scalar T, const scalar p) const |
dc/dt = omega, rate of change in concentration, for each species
| |
virtual scalar | omega (const Reaction< ThermoType > &r, const scalarField &c, const scalar T, const scalar p, scalar &pf, scalar &cf, label &lRef, scalar &pr, scalar &cr, label &rRef) const |
Return the reaction rate for reaction r and the reference.
| |
virtual void | calculate () |
Calculates the reaction rates.
| |
tmp< volScalarField > | RR (const label i) const |
Return const access to the chemical source terms.
| |
virtual scalar | solve (const scalar t0, const scalar deltaT) |
Solve the reaction system for the given start time and time.
| |
virtual tmp< volScalarField > | tc () const |
Return the chemical time scale.
| |
virtual tmp< volScalarField > | Sh () const |
Return source for enthalpy equation [kg/m/s3].
| |
virtual tmp< volScalarField > | dQ () const |
Return the heat release, i.e. enthalpy/sec [m2/s3].
| |
virtual label | nEqns () const |
Number of ODE's to solve.
| |
virtual void | derivatives (const scalar t, const scalarField &c, scalarField &dcdt) const |
virtual void | jacobian (const scalar t, const scalarField &c, scalarField &dcdt, scalarSquareMatrix &dfdc) const |
Protected Member Functions | |
PtrList< scalarField > & | RR () |
Write access to chemical source terms.
| |
Protected Attributes | |
PtrList< volScalarField > & | Y_ |
Reference to the field of specie mass fractions.
| |
const PtrList< Reaction < ThermoType > > & | reactions_ |
Reactions.
| |
const PtrList< ThermoType > & | specieThermo_ |
Thermodynamic data of the species.
| |
label | nSpecie_ |
Number of species.
| |
label | nReaction_ |
Number of reactions.
| |
autoPtr< chemistrySolver < CompType, ThermoType > > | solver_ |
Chemistry solver.
| |
PtrList< scalarField > | RR_ |
Chemical source term [kg/m3/s].
|
ODEChemistryModel | ( | const fvMesh & | mesh, |
const word & | compTypeName, | ||
const word & | thermoTypeName | ||
) |
Construct from components.
Definition at line 34 of file ODEChemistryModel.C.
References Foam::endl(), forAll, Foam::Info, and primitiveMesh::nCells().
~ODEChemistryModel | ( | ) | [virtual]
|
Destructor.
Definition at line 89 of file ODEChemistryModel.C.
Foam::PtrList< Foam::scalarField > & RR | ( | ) | [inline, protected]
|
Write access to chemical source terms.
(e.g. for multi-chemistry model)
Definition at line 33 of file ODEChemistryModelI.H.
TypeName | ( | "ODEChemistryModel< CompType, ThermoType >" | ) |
Runtime type information.
const Foam::PtrList< Foam::Reaction< ThermoType > > & reactions | ( | ) | const [inline]
|
The reactions.
Definition at line 41 of file ODEChemistryModelI.H.
const Foam::PtrList< ThermoType > & specieThermo | ( | ) | const [inline]
|
Thermodynamic data of the species.
Definition at line 49 of file ODEChemistryModelI.H.
Foam::label nSpecie | ( | ) | const [inline]
|
The number of species.
Definition at line 57 of file ODEChemistryModelI.H.
Foam::label nReaction | ( | ) | const [inline]
|
The number of reactions.
Definition at line 65 of file ODEChemistryModelI.H.
const Foam::chemistrySolver< CompType, ThermoType > & solver | ( | ) | const [inline]
|
Return the chemisty solver.
Definition at line 73 of file ODEChemistryModelI.H.
Foam::scalarField omega | ( | const scalarField & | c, |
const scalar | T, | ||
const scalar | p | ||
) | const [virtual]
|
dc/dt = omega, rate of change in concentration, for each species
Definition at line 97 of file ODEChemistryModel.C.
References forAll, Reaction< ReactionThermo >::lhs(), R, and Reaction< ReactionThermo >::rhs().
Foam::scalar omega | ( | const Reaction< ThermoType > & | r, |
const scalarField & | c, | ||
const scalar | T, | ||
const scalar | p, | ||
scalar & | pf, | ||
scalar & | cf, | ||
label & | lRef, | ||
scalar & | pr, | ||
scalar & | cr, | ||
label & | rRef | ||
) | const [virtual]
|
Return the reaction rate for reaction r and the reference.
species and charateristic times
Definition at line 138 of file ODEChemistryModel.C.
References Foam::exp(), Reaction< ReactionThermo >::kf(), Reaction< ReactionThermo >::kr(), Reaction< ReactionThermo >::lhs(), Foam::max(), Foam::pow(), Reaction< ReactionThermo >::rhs(), and List< T >::size().
void calculate | ( | ) | [virtual]
|
Calculates the reaction rates.
Definition at line 616 of file ODEChemistryModel.C.
References forAll, mesh, basicThermo::p(), Foam::mathematicalConstant::pi(), rho, List< T >::size(), basicThermo::T(), thermo, and timeName.
Foam::tmp< Foam::volScalarField > RR | ( | const label | i ) | const [inline]
|
Return const access to the chemical source terms.
Definition at line 82 of file ODEChemistryModelI.H.
References Foam::dimMass, Foam::dimTime, Foam::dimVolume, mesh, name(), and timeName.
Foam::scalar solve | ( | const scalar | t0, |
const scalar | deltaT | ||
) | [virtual]
|
Solve the reaction system for the given start time and time.
step and return the characteristic time
Definition at line 672 of file ODEChemistryModel.C.
References forAll, basicThermo::hc(), basicThermo::hs(), Foam::max(), mesh, Foam::min(), basicThermo::p(), Foam::mathematicalConstant::pi(), rho, List< T >::size(), Foam::sum(), basicThermo::T(), thermo, and timeName.
Foam::tmp< Foam::volScalarField > tc | ( | ) | const [virtual]
|
Return the chemical time scale.
Definition at line 449 of file ODEChemistryModel.C.
References Foam::dimTime, forAll, mesh, basicThermo::p(), Foam::mathematicalConstant::pi(), rho, Reaction< ReactionThermo >::rhs(), basicThermo::T(), thermo, and timeName.
Foam::tmp< Foam::volScalarField > Sh | ( | ) | const [virtual]
|
Return source for enthalpy equation [kg/m/s3].
Definition at line 535 of file ODEChemistryModel.C.
References Foam::dimEnergy, Foam::dimTime, Foam::dimVolume, and forAll.
Foam::tmp< Foam::volScalarField > dQ | ( | ) | const [virtual]
|
Return the heat release, i.e. enthalpy/sec [m2/s3].
Definition at line 576 of file ODEChemistryModel.C.
References Foam::dimEnergy, GeometricField< Type, PatchField, GeoMesh >::dimensionedInternalField(), and Foam::dimTime.
Foam::label nEqns | ( | ) | const [virtual]
|
void derivatives | ( | const scalar | t, |
const scalarField & | c, | ||
scalarField & | dcdt | ||
) | const [virtual]
|
Implements ODE.
Definition at line 256 of file ODEChemistryModel.C.
References cp, Foam::mag(), Foam::min(), rho, and Xi().
void jacobian | ( | const scalar | t, |
const scalarField & | c, | ||
scalarField & | dcdt, | ||
scalarSquareMatrix & | dfdc | ||
) | const [virtual]
|
Implements ODE.
Definition at line 307 of file ODEChemistryModel.C.
References forAll, Reaction< ReactionThermo >::kf(), Reaction< ReactionThermo >::kr(), Reaction< ReactionThermo >::lhs(), Foam::max(), Foam::pow(), and Reaction< ReactionThermo >::rhs().
PtrList<volScalarField>& Y_ [protected]
|
Reference to the field of specie mass fractions.
Definition at line 77 of file ODEChemistryModel.H.
const PtrList<Reaction<ThermoType> >& reactions_ [protected]
|
Reactions.
Definition at line 80 of file ODEChemistryModel.H.
const PtrList<ThermoType>& specieThermo_ [protected]
|
Thermodynamic data of the species.
Definition at line 83 of file ODEChemistryModel.H.
label nSpecie_ [protected]
|
Number of species.
Definition at line 86 of file ODEChemistryModel.H.
label nReaction_ [protected]
|
Number of reactions.
Definition at line 89 of file ODEChemistryModel.H.
autoPtr<chemistrySolver<CompType, ThermoType> > solver_ [protected]
|
Chemistry solver.
Definition at line 92 of file ODEChemistryModel.H.
PtrList<scalarField> RR_ [protected]
|
Chemical source term [kg/m3/s].
Definition at line 95 of file ODEChemistryModel.H.