Public Member Functions | List of all members
TDACChemistryModel< CompType, ThermoType > Class Template Referenceabstract

Extends chemistryModel by adding the TDAC method. More...

Inheritance diagram for TDACChemistryModel< CompType, ThermoType >:
Inheritance graph
[legend]
Collaboration diagram for TDACChemistryModel< CompType, ThermoType >:
Collaboration graph
[legend]

Public Member Functions

 TypeName ("TDACChemistryModel")
 Runtime type information. More...
 
 TDACChemistryModel (const fvMesh &mesh, const word &phaseName)
 Construct from mesh. More...
 
virtual ~TDACChemistryModel ()
 Destructor. More...
 
bool variableTimeStep () const
 Return true if the time-step is variable and/or non-uniform. More...
 
label timeSteps () const
 Return the number of chemistry evaluations (used by ISAT) More...
 
autoPtr< OFstreamlogFile (const word &name) const
 Create and return a TDAC log file of the given name. More...
 
PtrList< volScalarField > & Y ()
 
virtual void omega (const scalarField &c, const scalar T, const scalar p, scalarField &dcdt) const
 dc/dt = omega, rate of change in concentration, for each species More...
 
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. More...
 
virtual scalar solve (const scalar deltaT)
 Solve the reaction system for the given time step. More...
 
virtual scalar solve (const scalarField &deltaT)
 Solve the reaction system for the given time step. More...
 
virtual void derivatives (const scalar t, const scalarField &c, scalarField &dcdt) const
 Calculate the derivatives in dydx. More...
 
void jacobian (const scalar t, const scalarField &c, scalarSquareMatrix &dfdc) const
 Pure jacobian function for tabulation. More...
 
virtual void jacobian (const scalar t, const scalarField &c, scalarField &dcdt, scalarSquareMatrix &dfdc) const
 Calculate the Jacobian of the system. More...
 
virtual void solve (scalarField &c, scalar &T, scalar &p, scalar &deltaT, scalar &subDeltaT) const =0
 
void setNsDAC (const label newNsDAC)
 
void setNSpecie (const label newNs)
 
scalarFieldcompleteC ()
 
scalarFieldsimplifiedC ()
 
Field< bool > & reactionsDisabled ()
 
bool active (const label i) const
 
void setActive (const label i)
 
DynamicList< label > & simplifiedToCompleteIndex ()
 
Field< label > & completeToSimplifiedIndex ()
 
const Field< label > & completeToSimplifiedIndex () const
 
List< List< specieElement > > & specieComp ()
 
autoPtr< chemistryReductionMethod< CompType, ThermoType > > & mechRed ()
 
tmp< volScalarFieldtabulationResults () const
 
void setTabulationResultsAdd (const label celli)
 
void setTabulationResultsGrow (const label celli)
 
void setTabulationResultsRetrieve (const label celli)
 
void resetTabulationResults ()
 
template<class DeltaTType >
Foam::scalar solve (const DeltaTType &deltaT)
 
- Public Member Functions inherited from chemistryModel< CompType, ThermoType >
 TypeName ("chemistryModel")
 Runtime type information. More...
 
 chemistryModel (const fvMesh &mesh, const word &phaseName)
 Construct from mesh. More...
 
virtual ~chemistryModel ()
 Destructor. More...
 
const PtrList< Reaction< ThermoType > > & reactions () const
 The reactions. More...
 
const PtrList< ThermoType > & specieThermo () const
 Thermodynamic data of the species. More...
 
virtual label nSpecie () const
 The number of species. More...
 
virtual label nReaction () const
 The number of reactions. More...
 
scalar Treact () const
 Temperature below which the reaction rates are assumed 0. More...
 
scalar & Treact ()
 Temperature below which the reaction rates are assumed 0. More...
 
virtual scalar omegaI (label iReaction, 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 iReaction and the reference. More...
 
virtual void calculate ()
 Calculates the reaction rates. More...
 
const volScalarField::InternalRR (const label i) const
 Return const access to the chemical source terms for specie, i. More...
 
virtual volScalarField::InternalRR (const label i)
 Return non const access to chemical source terms [kg/m3/s]. More...
 
virtual tmp< volScalarField::InternalcalculateRR (const label reactionI, const label speciei) const
 Return reaction rate of the speciei in reactionI. More...
 
virtual tmp< volScalarFieldtc () const
 Return the chemical time scale. More...
 
virtual tmp< volScalarFieldQdot () const
 Return the heat release rate [kg/m/s3]. More...
 
virtual label nEqns () const
 Number of ODE's to solve. More...
 
template<class DeltaTType >
Foam::scalar solve (const DeltaTType &deltaT)
 
- Public Member Functions inherited from ODESystem
 ODESystem ()
 Construct null. More...
 
virtual ~ODESystem ()
 Destructor. More...
 

Additional Inherited Members

- Protected Types inherited from chemistryModel< CompType, ThermoType >
typedef ThermoType thermoType
 
- Protected Member Functions inherited from chemistryModel< CompType, ThermoType >
PtrList< volScalarField::Internal > & RR ()
 Write access to chemical source terms. More...
 
- Protected Attributes inherited from chemistryModel< CompType, ThermoType >
PtrList< volScalarField > & Y_
 Reference to the field of specie mass fractions. More...
 
const PtrList< Reaction< ThermoType > > & reactions_
 Reactions. More...
 
const PtrList< ThermoType > & specieThermo_
 Thermodynamic data of the species. More...
 
label nSpecie_
 Number of species. More...
 
label nReaction_
 Number of reactions. More...
 
scalar Treact_
 Temperature below which the reaction rates are assumed 0. More...
 
PtrList< volScalarField::InternalRR_
 List of reaction rate per specie [kg/m3/s]. More...
 
scalarField c_
 Temporary concentration field. More...
 
scalarField dcdt_
 Temporary rate-of-change of concentration field. More...
 

Detailed Description

template<class CompType, class ThermoType>
class Foam::TDACChemistryModel< CompType, ThermoType >

Extends chemistryModel by adding the TDAC method.

References:

    Contino, F., Jeanmart, H., Lucchini, T., & D’Errico, G. (2011).
    Coupling of in situ adaptive tabulation and dynamic adaptive chemistry:
    An effective method for solving combustion in engine simulations.
    Proceedings of the Combustion Institute, 33(2), 3057-3064.

    Contino, F., Lucchini, T., D'Errico, G., Duynslaegher, C.,
    Dias, V., & Jeanmart, H. (2012).
    Simulations of advanced combustion modes using detailed chemistry
    combined with tabulation and mechanism reduction techniques.
    SAE International Journal of Engines,
    5(2012-01-0145), 185-196.

    Contino, F., Foucher, F., Dagaut, P., Lucchini, T., D’Errico, G., &
    Mounaïm-Rousselle, C. (2013).
    Experimental and numerical analysis of nitric oxide effect on the
    ignition of iso-octane in a single cylinder HCCI engine.
    Combustion and Flame, 160(8), 1476-1483.

    Contino, F., Masurier, J. B., Foucher, F., Lucchini, T., D’Errico, G., &
    Dagaut, P. (2014).
    CFD simulations using the TDAC method to model iso-octane combustion
    for a large range of ozone seeding and temperature conditions
    in a single cylinder HCCI engine.
    Fuel, 137, 179-184.
Source files

Definition at line 47 of file chemistryReductionMethod.H.

Constructor & Destructor Documentation

◆ TDACChemistryModel()

TDACChemistryModel ( const fvMesh mesh,
const word phaseName 
)

Construct from mesh.

Definition at line 35 of file TDACChemistryModel.C.

References composition, forAll, mesh, Foam::name(), Foam::New(), basicMultiComponentMixture::setInactive(), basicMultiComponentMixture::species(), thermo, and Y.

Here is the call graph for this function:

◆ ~TDACChemistryModel()

~TDACChemistryModel ( )
virtual

Destructor.

Definition at line 140 of file TDACChemistryModel.C.

References TDACChemistryModel< CompType, ThermoType >::omega().

Here is the call graph for this function:

Member Function Documentation

◆ TypeName()

TypeName ( "TDACChemistryModel< CompType, ThermoType >"  )

Runtime type information.

◆ variableTimeStep()

bool variableTimeStep ( ) const
inline

Return true if the time-step is variable and/or non-uniform.

Definition at line 30 of file TDACChemistryModelI.H.

Referenced by chemistryTabulationMethod< CompType, ThermoType >::variableTimeStep(), and chemPointISAT< CompType, ThermoType >::variableTimeStep().

Here is the caller graph for this function:

◆ timeSteps()

Foam::label timeSteps ( ) const
inline

Return the number of chemistry evaluations (used by ISAT)

Definition at line 38 of file TDACChemistryModelI.H.

◆ logFile()

Foam::autoPtr< Foam::OFstream > logFile ( const word name) const
inline

Create and return a TDAC log file of the given name.

Definition at line 46 of file TDACChemistryModelI.H.

References mesh, Foam::mkDir(), and path().

Referenced by ISAT< CompType, ThermoType >::ISAT().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Y()

◆ omega() [1/2]

void omega ( const scalarField c,
const scalar  T,
const scalar  p,
scalarField dcdt 
) const
virtual

dc/dt = omega, rate of change in concentration, for each species

Reimplemented from chemistryModel< CompType, ThermoType >.

Definition at line 148 of file TDACChemistryModel.C.

References forAll, Reaction< ReactionThermo >::lhs(), R, Reaction< ReactionThermo >::rhs(), s(), and Foam::Zero.

Referenced by TDACChemistryModel< CompType, ThermoType >::~TDACChemistryModel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ omega() [2/2]

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

Reimplemented from chemistryModel< CompType, ThermoType >.

Definition at line 202 of file TDACChemistryModel.C.

References TDACChemistryModel< CompType, ThermoType >::derivatives(), Foam::exp(), Reaction< ReactionThermo >::kf(), Reaction< ReactionThermo >::kr(), Reaction< ReactionThermo >::lhs(), Foam::max(), Foam::pow(), Reaction< ReactionThermo >::rhs(), and s().

Here is the call graph for this function:

◆ solve() [1/4]

Foam::scalar solve ( const scalar  deltaT)
virtual

Solve the reaction system for the given time step.

and return the characteristic time

Reimplemented from chemistryModel< CompType, ThermoType >.

Definition at line 882 of file TDACChemistryModel.C.

References Foam::min(), and solve().

Here is the call graph for this function:

◆ solve() [2/4]

Foam::scalar solve ( const scalarField deltaT)
virtual

Solve the reaction system for the given time step.

and return the characteristic time

Reimplemented from chemistryModel< CompType, ThermoType >.

Definition at line 897 of file TDACChemistryModel.C.

References TDACChemistryModel< CompType, ThermoType >::setTabulationResultsAdd().

Here is the call graph for this function:

◆ derivatives()

void derivatives ( const scalar  x,
const scalarField y,
scalarField dydx 
) const
virtual

Calculate the derivatives in dydx.

Reimplemented from chemistryModel< CompType, ThermoType >.

Definition at line 311 of file TDACChemistryModel.C.

References cp, TDACChemistryModel< CompType, ThermoType >::jacobian(), Foam::max(), nSpecie, and rho.

Referenced by TDACChemistryModel< CompType, ThermoType >::omega().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ jacobian() [1/2]

void jacobian ( const scalar  t,
const scalarField c,
scalarSquareMatrix dfdc 
) const

Pure jacobian function for tabulation.

Definition at line 395 of file TDACChemistryModel.C.

References delta, Foam::constant::electromagnetic::e, forAll, Reaction< ReactionThermo >::kf(), Reaction< ReactionThermo >::kr(), Reaction< ReactionThermo >::lhs(), Foam::max(), Foam::pow(), Reaction< ReactionThermo >::rhs(), and Foam::Zero.

Referenced by TDACChemistryModel< CompType, ThermoType >::derivatives().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ jacobian() [2/2]

void jacobian ( const scalar  x,
const scalarField y,
scalarField dfdx,
scalarSquareMatrix dfdy 
) const
virtual

Calculate the Jacobian of the system.

Need by the stiff-system solvers

Reimplemented from chemistryModel< CompType, ThermoType >.

Definition at line 579 of file TDACChemistryModel.C.

◆ solve() [3/4]

virtual void solve ( scalarField c,
scalar &  T,
scalar &  p,
scalar &  deltaT,
scalar &  subDeltaT 
) const
pure virtual

◆ setNsDAC()

void setNsDAC ( const label  newNsDAC)
inline

Definition at line 97 of file TDACChemistryModelI.H.

◆ setNSpecie()

void setNSpecie ( const label  newNs)
inline

Definition at line 105 of file TDACChemistryModelI.H.

◆ completeC()

Foam::scalarField & completeC ( )
inline

Definition at line 146 of file TDACChemistryModelI.H.

◆ simplifiedC()

Foam::scalarField & simplifiedC ( )
inline

Definition at line 154 of file TDACChemistryModelI.H.

◆ reactionsDisabled()

Foam::Field< bool > & reactionsDisabled ( )
inline

Definition at line 138 of file TDACChemistryModelI.H.

◆ active()

bool active ( const label  i) const
inline

Definition at line 87 of file TDACChemistryModelI.H.

References thermo.

Referenced by TDACChemistryModel< CompType, ThermoType >::setActive(), and TDACChemistryModel< CompType, ThermoType >::solve().

Here is the caller graph for this function:

◆ setActive()

void setActive ( const label  i)
inline

Definition at line 77 of file TDACChemistryModelI.H.

References TDACChemistryModel< CompType, ThermoType >::active(), and thermo.

Referenced by TDACChemistryModel< CompType, ThermoType >::mechRed().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ simplifiedToCompleteIndex()

Foam::DynamicList< Foam::label > & simplifiedToCompleteIndex ( )
inline

Definition at line 113 of file TDACChemistryModelI.H.

Referenced by chemPointISAT< CompType, ThermoType >::chemPointISAT().

Here is the caller graph for this function:

◆ completeToSimplifiedIndex() [1/2]

Foam::Field< Foam::label > & completeToSimplifiedIndex ( )
inline

Definition at line 121 of file TDACChemistryModelI.H.

Referenced by chemPointISAT< CompType, ThermoType >::chemPointISAT().

Here is the caller graph for this function:

◆ completeToSimplifiedIndex() [2/2]

const Foam::Field< Foam::label > & completeToSimplifiedIndex ( ) const
inline

Definition at line 130 of file TDACChemistryModelI.H.

◆ specieComp()

Foam::List< Foam::List< Foam::specieElement > > & specieComp ( )
inline

Definition at line 162 of file TDACChemistryModelI.H.

Referenced by DAC< CompType, ThermoType >::DAC().

Here is the caller graph for this function:

◆ mechRed()

Foam::autoPtr< Foam::chemistryReductionMethod< CompType, ThermoType > > & mechRed ( )
inline

Definition at line 69 of file TDACChemistryModelI.H.

References TDACChemistryModel< CompType, ThermoType >::setActive().

Here is the call graph for this function:

◆ tabulationResults()

tmp<volScalarField> tabulationResults ( ) const
inline

◆ setTabulationResultsAdd()

void setTabulationResultsAdd ( const label  celli)

Definition at line 907 of file TDACChemistryModel.C.

References TDACChemistryModel< CompType, ThermoType >::setTabulationResultsGrow().

Referenced by TDACChemistryModel< CompType, ThermoType >::solve(), and TDACChemistryModel< CompType, ThermoType >::tabulationResults().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setTabulationResultsGrow()

void setTabulationResultsGrow ( const label  celli)

◆ setTabulationResultsRetrieve()

void setTabulationResultsRetrieve ( const label  celli)

◆ resetTabulationResults()

void resetTabulationResults ( )
inline

Definition at line 169 of file TDACChemistryModelI.H.

References forAll.

Referenced by TDACChemistryModel< CompType, ThermoType >::tabulationResults().

Here is the caller graph for this function:

◆ solve() [4/4]

Foam::scalar solve ( const DeltaTType &  deltaT)

The documentation for this class was generated from the following files: