Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Friends | List of all members
Reaction< ReactionThermo > Class Template Referenceabstract

Simple extension of ReactionThermo to handle reaction kinetics in addition to the equilibrium thermodynamics already handled. More...

Inheritance diagram for Reaction< ReactionThermo >:
Inheritance graph
[legend]
Collaboration diagram for Reaction< ReactionThermo >:
Collaboration graph
[legend]

Classes

struct  specieCoeffs
 Class to hold the specie index and its coefficients in the. More...
 

Public Member Functions

 TypeName ("Reaction")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, Reaction, dictionary,(const speciesTable &species, const HashPtrTable< ReactionThermo > &thermoDatabase, const dictionary &dict),(species, thermoDatabase, dict))
 
 Reaction (const speciesTable &species, const List< specieCoeffs > &lhs, const List< specieCoeffs > &rhs, const HashPtrTable< ReactionThermo > &thermoDatabase)
 Construct from components. More...
 
 Reaction (const Reaction< ReactionThermo > &, const speciesTable &species)
 Construct as copy given new speciesTable. More...
 
 Reaction (const speciesTable &species, const HashPtrTable< ReactionThermo > &thermoDatabase, const dictionary &dict)
 Construct from dictionary. More...
 
virtual autoPtr< Reaction< ReactionThermo > > clone () const =0
 Construct and return a clone. More...
 
virtual autoPtr< Reaction< ReactionThermo > > clone (const speciesTable &species) const =0
 Construct and return a clone with new speciesTable. More...
 
void setLRhs (Istream &, const speciesTable &, List< specieCoeffs > &lhs, List< specieCoeffs > &rhs)
 Construct the left- and right-hand-side reaction coefficients. More...
 
virtual ~Reaction ()
 Destructor. More...
 
const wordname () const
 Return the name of the reaction. More...
 
scalar Tlow () const
 Return the lower temperature limit for the reaction. More...
 
scalar Thigh () const
 Return the upper temperature limit for the reaction. More...
 
const List< specieCoeffs > & lhs () const
 Return the components of the left hand side. More...
 
const List< specieCoeffs > & rhs () const
 Return the components of the right hand side. More...
 
const speciesTablespecies () const
 Return the specie list. More...
 
void ddot (const scalar p, const scalar T, const scalarField &c, scalarField &d) const
 Forward reaction rate. More...
 
void fdot (const scalar p, const scalar T, const scalarField &c, scalarField &f) const
 Backward reaction rate. More...
 
void omega (const scalar p, const scalar T, const scalarField &c, scalarField &dcdt) const
 Net reaction rate for individual species. More...
 
scalar omega (const scalar p, const scalar T, const scalarField &c, scalar &pf, scalar &cf, label &lRef, scalar &pr, scalar &cr, label &rRef) const
 Net reaction rate. More...
 
virtual scalar kf (const scalar p, const scalar T, const scalarField &c) const =0
 Forward rate constant. More...
 
virtual scalar kr (const scalar kfwd, const scalar p, const scalar T, const scalarField &c) const =0
 Reverse rate constant from the given forward rate constant. More...
 
virtual scalar kr (const scalar p, const scalar T, const scalarField &c) const =0
 Reverse rate constant. More...
 
void dwdc (const scalar p, const scalar T, const scalarField &c, scalarSquareMatrix &J, scalarField &dcdt, scalar &omegaI, scalar &kfwd, scalar &kbwd, const bool reduced, const List< label > &c2s) const
 Derivative of the net reaction rate for each species involved. More...
 
void dwdT (const scalar p, const scalar T, const scalarField &c, const scalar omegaI, const scalar kfwd, const scalar kbwd, scalarSquareMatrix &J, const bool reduced, const List< label > &c2s, const label indexT) const
 Derivative of the net reaction rate for each species involved. More...
 
virtual scalar dkfdT (const scalar p, const scalar T, const scalarField &c) const =0
 Temperature derivative of forward rate. More...
 
virtual scalar dkrdT (const scalar p, const scalar T, const scalarField &c, const scalar dkfdT, const scalar kr) const =0
 Temperature derivative of reverse rate. More...
 
virtual const List< Tuple2< label, scalar > > & beta () const =0
 Third-body efficiencies (beta = 1-alpha) More...
 
virtual void dcidc (const scalar p, const scalar T, const scalarField &c, scalarField &dcidc) const =0
 Species concentration derivative of the pressure dependent term. More...
 
virtual scalar dcidT (const scalar p, const scalar T, const scalarField &c) const =0
 Temperature derivative of the pressure dependent term. More...
 
virtual void write (Ostream &) const
 Write. More...
 

Static Public Member Functions

static autoPtr< Reaction< ReactionThermo > > New (const speciesTable &species, const HashPtrTable< ReactionThermo > &thermoDatabase, const dictionary &dict)
 Return a pointer to new patchField created on freestore from dict. More...
 

Static Public Attributes

static label nUnNamedReactions
 Number of un-named reactions. More...
 
static scalar TlowDefault
 Default temperature limits of applicability of reaction rates. More...
 
static scalar ThighDefault
 

Protected Member Functions

void reactionStrLeft (OStringStream &reaction) const
 Return string representation of the left of the reaction. More...
 
void reactionStrRight (OStringStream &reaction) const
 Return string representation of the right of the reaction. More...
 

Friends

Ostreamoperator (Ostream &, const Reaction< ReactionThermo > &)
 

Detailed Description

template<class ReactionThermo>
class Foam::Reaction< ReactionThermo >

Simple extension of ReactionThermo to handle reaction kinetics in addition to the equilibrium thermodynamics already handled.

Source files

Definition at line 55 of file Reaction.H.

Constructor & Destructor Documentation

◆ Reaction() [1/3]

Reaction ( const speciesTable species,
const List< specieCoeffs > &  lhs,
const List< specieCoeffs > &  rhs,
const HashPtrTable< ReactionThermo > &  thermoDatabase 
)

Construct from components.

Definition at line 159 of file Reaction.C.

Referenced by Reaction< ReactionThermo >::reactionStrRight(), and Reaction< ReactionThermo >::setLRhs().

Here is the caller graph for this function:

◆ Reaction() [2/3]

Reaction ( const Reaction< ReactionThermo > &  r,
const speciesTable species 
)

Construct as copy given new speciesTable.

Definition at line 180 of file Reaction.C.

References Reaction< ReactionThermo >::specieCoeffs::specieCoeffs().

Here is the call graph for this function:

◆ Reaction() [3/3]

Reaction ( const speciesTable species,
const HashPtrTable< ReactionThermo > &  thermoDatabase,
const dictionary dict 
)

Construct from dictionary.

Definition at line 335 of file Reaction.C.

References dictionary::lookup(), and Reaction< ReactionThermo >::New().

Here is the call graph for this function:

◆ ~Reaction()

virtual ~Reaction ( )
inlinevirtual

Member Function Documentation

◆ reactionStrLeft()

void reactionStrLeft ( OStringStream reaction) const
protected

Return string representation of the left of the reaction.

Definition at line 44 of file Reaction.C.

References Foam::mag(), and Reaction< ReactionThermo >::reactionStrRight().

Here is the call graph for this function:

◆ reactionStrRight()

void reactionStrRight ( OStringStream reaction) const
protected

Return string representation of the right of the reaction.

Definition at line 69 of file Reaction.C.

References Foam::mag(), Reaction< ReactionThermo >::Reaction(), OStringStream::str(), and W().

Referenced by Reaction< ReactionThermo >::reactionStrLeft().

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

◆ TypeName()

TypeName ( "Reaction< ReactionThermo >"  )

Runtime type information.

◆ declareRunTimeSelectionTable()

declareRunTimeSelectionTable ( autoPtr  ,
Reaction< ReactionThermo >  ,
dictionary  ,
(const speciesTable &species, const HashPtrTable< ReactionThermo > &thermoDatabase, const dictionary &dict ,
(species, thermoDatabase, dict  
)

◆ clone() [1/2]

virtual autoPtr<Reaction<ReactionThermo> > clone ( ) const
pure virtual

Construct and return a clone.

Implemented in ReactionProxy< ReactionThermo >.

◆ clone() [2/2]

virtual autoPtr<Reaction<ReactionThermo> > clone ( const speciesTable species) const
pure virtual

Construct and return a clone with new speciesTable.

Implemented in ReactionProxy< ReactionThermo >.

◆ setLRhs()

void setLRhs ( Istream is,
const speciesTable species,
List< specieCoeffs > &  lhs,
List< specieCoeffs > &  rhs 
)

◆ New()

Foam::autoPtr< Foam::Reaction< ReactionThermo > > New ( const speciesTable species,
const HashPtrTable< ReactionThermo > &  thermoDatabase,
const dictionary dict 
)
static

Return a pointer to new patchField created on freestore from dict.

Definition at line 363 of file Reaction.C.

References dict, Foam::exit(), Foam::FatalError, FatalErrorInFunction, dictionary::lookup(), and Foam::nl.

Referenced by Reaction< ReactionThermo >::Reaction().

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

◆ name()

const word & name ( ) const
inline

Return the name of the reaction.

Definition at line 36 of file ReactionI.H.

Referenced by ReactionList< Foam::sutherlandTransport >::write(), and Reaction< ReactionThermo >::~Reaction().

Here is the caller graph for this function:

◆ Tlow()

scalar Tlow ( ) const
inline

Return the lower temperature limit for the reaction.

Definition at line 43 of file ReactionI.H.

Referenced by Reaction< ReactionThermo >::~Reaction().

Here is the caller graph for this function:

◆ Thigh()

scalar Thigh ( ) const
inline

Return the upper temperature limit for the reaction.

Definition at line 50 of file ReactionI.H.

Referenced by Reaction< ReactionThermo >::~Reaction().

Here is the caller graph for this function:

◆ lhs()

const List< typename Reaction< ReactionThermo >::specieCoeffs > & lhs ( ) const
inline

◆ rhs()

const List< typename Reaction< ReactionThermo >::specieCoeffs > & rhs ( ) const
inline

◆ species()

const Foam::speciesTable & species ( ) const

Return the specie list.

Definition at line 805 of file Reaction.C.

Referenced by Reaction< ReactionThermo >::specieCoeffs::specieCoeffs(), and Reaction< ReactionThermo >::~Reaction().

Here is the caller graph for this function:

◆ ddot()

void ddot ( const scalar  p,
const scalar  T,
const scalarField c,
scalarField d 
) const

Forward reaction rate.

Definition at line 404 of file Reaction.C.

References Reaction< ReactionThermo >::fdot().

Referenced by Reaction< ReactionThermo >::write(), and Reaction< ReactionThermo >::~Reaction().

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

◆ fdot()

void fdot ( const scalar  p,
const scalar  T,
const scalarField c,
scalarField f 
) const

Backward reaction rate.

Definition at line 416 of file Reaction.C.

References Reaction< ReactionThermo >::omega().

Referenced by Reaction< ReactionThermo >::ddot(), and Reaction< ReactionThermo >::~Reaction().

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

◆ omega() [1/2]

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

◆ omega() [2/2]

Foam::scalar omega ( const scalar  p,
const scalar  T,
const scalarField c,
scalar &  pf,
scalar &  cf,
label lRef,
scalar &  pr,
scalar &  cr,
label rRef 
) const

Net reaction rate.

Definition at line 460 of file Reaction.C.

References Reaction< ReactionThermo >::dwdc(), Foam::exp(), Foam::max(), Foam::min(), Foam::pow(), and s().

Here is the call graph for this function:

◆ kf()

virtual scalar kf ( const scalar  p,
const scalar  T,
const scalarField c 
) const
pure virtual

◆ kr() [1/2]

virtual scalar kr ( const scalar  kfwd,
const scalar  p,
const scalar  T,
const scalarField c 
) const
pure virtual

Reverse rate constant from the given forward rate constant.

Implemented in ReactionProxy< ReactionThermo >.

Referenced by TDACChemistryModel< CompType, ThermoType >::omega(), and Reaction< ReactionThermo >::~Reaction().

Here is the caller graph for this function:

◆ kr() [2/2]

virtual scalar kr ( const scalar  p,
const scalar  T,
const scalarField c 
) const
pure virtual

Reverse rate constant.

Implemented in ReactionProxy< ReactionThermo >.

◆ dwdc()

void dwdc ( const scalar  p,
const scalar  T,
const scalarField c,
scalarSquareMatrix J,
scalarField dcdt,
scalar &  omegaI,
scalar &  kfwd,
scalar &  kbwd,
const bool  reduced,
const List< label > &  c2s 
) const

Derivative of the net reaction rate for each species involved.

w.r.t. the species concentration

Definition at line 574 of file Reaction.C.

References beta(), Reaction< ReactionThermo >::dwdT(), UList< T >::first(), forAll, Foam::notNull(), Foam::pow(), List< T >::size(), Foam::SMALL, and Foam::VSMALL.

Referenced by TDACChemistryModel< CompType, ThermoType >::jacobian(), StandardChemistryModel< CompType, ThermoType >::jacobian(), Reaction< ReactionThermo >::omega(), and Reaction< ReactionThermo >::~Reaction().

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

◆ dwdT()

void dwdT ( const scalar  p,
const scalar  T,
const scalarField c,
const scalar  omegaI,
const scalar  kfwd,
const scalar  kbwd,
scalarSquareMatrix J,
const bool  reduced,
const List< label > &  c2s,
const label  indexT 
) const

Derivative of the net reaction rate for each species involved.

w.r.t. the temperature

Definition at line 737 of file Reaction.C.

References forAll, Foam::pow(), and T.

Referenced by Reaction< ReactionThermo >::dwdc(), TDACChemistryModel< CompType, ThermoType >::jacobian(), StandardChemistryModel< CompType, ThermoType >::jacobian(), and Reaction< ReactionThermo >::~Reaction().

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

◆ dkfdT()

virtual scalar dkfdT ( const scalar  p,
const scalar  T,
const scalarField c 
) const
pure virtual

Temperature derivative of forward rate.

Implemented in ReactionProxy< ReactionThermo >.

Referenced by Reaction< ReactionThermo >::~Reaction().

Here is the caller graph for this function:

◆ dkrdT()

virtual scalar dkrdT ( const scalar  p,
const scalar  T,
const scalarField c,
const scalar  dkfdT,
const scalar  kr 
) const
pure virtual

Temperature derivative of reverse rate.

Implemented in ReactionProxy< ReactionThermo >.

Referenced by Reaction< ReactionThermo >::~Reaction().

Here is the caller graph for this function:

◆ beta()

virtual const List<Tuple2<label, scalar> >& beta ( ) const
pure virtual

Third-body efficiencies (beta = 1-alpha)

non-empty only for third-body reactions with enhanced molecularity (alpha != 1)

Implemented in ReactionProxy< ReactionThermo >.

Referenced by Reaction< ReactionThermo >::~Reaction().

Here is the caller graph for this function:

◆ dcidc()

virtual void dcidc ( const scalar  p,
const scalar  T,
const scalarField c,
scalarField dcidc 
) const
pure virtual

Species concentration derivative of the pressure dependent term.

Implemented in ReactionProxy< ReactionThermo >.

Referenced by Reaction< ReactionThermo >::~Reaction().

Here is the caller graph for this function:

◆ dcidT()

virtual scalar dcidT ( const scalar  p,
const scalar  T,
const scalarField c 
) const
pure virtual

Temperature derivative of the pressure dependent term.

Implemented in ReactionProxy< ReactionThermo >.

Referenced by Reaction< ReactionThermo >::~Reaction().

Here is the caller graph for this function:

◆ write()

void write ( Ostream os) const
virtual

Write.

Reimplemented in SolidReaction< ReactionThermo >.

Definition at line 394 of file Reaction.C.

References Reaction< ReactionThermo >::ddot(), Foam::nl, reaction, and Ostream::writeKeyword().

Referenced by ReactionList< Foam::sutherlandTransport >::write(), and Reaction< ReactionThermo >::~Reaction().

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

Friends And Related Function Documentation

◆ operator

Ostream& operator ( Ostream ,
const Reaction< ReactionThermo > &   
)
friend

Member Data Documentation

◆ nUnNamedReactions

Foam::label nUnNamedReactions
static

Number of un-named reactions.

Definition at line 86 of file Reaction.H.

◆ TlowDefault

Foam::scalar TlowDefault
static

Default temperature limits of applicability of reaction rates.

Definition at line 89 of file Reaction.H.

◆ ThighDefault

Foam::scalar ThighDefault
static

Definition at line 89 of file Reaction.H.


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