Reaction< ReactionThermo > Class Template Reference

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

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

Classes

struct  specieCoeffs
 

Public Member Functions

 TypeName ("Reaction")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, Reaction, dictionary,(const speciesTable &species, const ReactionTable< ReactionThermo > &thermoDatabase, const dictionary &dict),(species, thermoDatabase, dict))
 
 Reaction (const speciesTable &species, const List< specieCoeffs > &lhs, const List< specieCoeffs > &rhs, const ReactionTable< ReactionThermo > &thermoDatabase, bool initReactionThermo=true)
 Construct from components. More...
 
 Reaction (const Reaction< ReactionThermo > &, const speciesTable &species)
 Construct as copy given new speciesTable. More...
 
 Reaction (const speciesTable &species, const ReactionTable< ReactionThermo > &thermoDatabase, const dictionary &dict, bool initReactionThermo=true, bool failUnknownSpecie=true)
 Construct from dictionary. More...
 
virtual autoPtr< Reaction< ReactionThermo > > clone () const
 Construct and return a clone. More...
 
virtual autoPtr< Reaction< ReactionThermo > > clone (const speciesTable &species) const
 Construct and return a clone with new speciesTable. More...
 
virtual ~Reaction ()=default
 Destructor. More...
 
const wordname () const noexcept
 Name of reaction. More...
 
const speciesTablespecies () const noexcept
 Access to specie list. More...
 
const List< specieCoeffs > & lhs () const noexcept
 Specie info for the left-hand-side of the reaction. More...
 
const List< specieCoeffs > & rhs () const noexcept
 Specie info for the right-hand-side of the reaction. More...
 
virtual const speciesTablegasSpecies () const
 Access to gas specie list. More...
 
virtual const List< specieCoeffs > & grhs () const
 Access to gas components of the reaction. More...
 
virtual const List< specieCoeffs > & glhs () const
 
void setLRhs (Istream &, const speciesTable &, List< specieCoeffs > &lhs, List< specieCoeffs > &rhs, bool failUnknownSpecie=true)
 Construct the left- and right-hand-side reaction coefficients. More...
 
virtual scalar kf (const scalar p, const scalar T, const scalarField &c) const
 Forward rate constant. More...
 
virtual scalar kr (const scalar kfwd, const scalar p, const scalar T, const scalarField &c) const
 Reverse rate constant from the given forward rate constant. More...
 
virtual scalar kr (const scalar p, const scalar T, const scalarField &c) const
 Reverse rate constant. More...
 
virtual void write (Ostream &os) const
 Write. More...
 

Static Public Member Functions

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

Static Public Attributes

static label nUnNamedReactions = 0
 Number of un-named reactions. More...
 

Protected Member Functions

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

Static Protected Member Functions

static void reactionStr (OStringStream &reaction, const speciesTable &species, const List< specieCoeffs > &reactCoeffs)
 Add string representation for given species reaction coeffs. 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 70 of file Reaction.H.

Constructor & Destructor Documentation

◆ Reaction() [1/3]

Reaction ( const speciesTable species,
const List< specieCoeffs > &  lhs,
const List< specieCoeffs > &  rhs,
const ReactionTable< ReactionThermo > &  thermoDatabase,
bool  initReactionThermo = true 
)

Construct from components.

Definition at line 156 of file Reaction.C.

◆ Reaction() [2/3]

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

Construct as copy given new speciesTable.

Definition at line 179 of file Reaction.C.

References Foam::name().

Here is the call graph for this function:

◆ Reaction() [3/3]

Reaction ( const speciesTable species,
const ReactionTable< ReactionThermo > &  thermoDatabase,
const dictionary dict,
bool  initReactionThermo = true,
bool  failUnknownSpecie = true 
)

Construct from dictionary.

NOTE: initReactionThermo is used by solidReaction where there is no need of setting a lhs - rhs thermo type for each reaction. This is needed for mechanism with reversible reactions

Definition at line 322 of file Reaction.C.

◆ ~Reaction()

virtual ~Reaction ( )
virtualdefault

Destructor.

Member Function Documentation

◆ reactionStr()

void reactionStr ( OStringStream reaction,
const speciesTable species,
const List< specieCoeffs > &  reactCoeffs 
)
staticprotected

Add string representation for given species reaction coeffs.

Definition at line 41 of file Reaction.C.

References Reaction< ReactionThermo >::specieCoeffs::exponent, Reaction< ReactionThermo >::specieCoeffs::index, Foam::mag(), reaction, UList< T >::size(), and Reaction< ReactionThermo >::specieCoeffs::stoichCoeff.

Here is the call graph for this function:

◆ reactionStrLeft()

void reactionStrLeft ( OStringStream reaction) const
protected

Add string representation of the left of the reaction.

Definition at line 70 of file Reaction.C.

References reaction.

◆ reactionStrRight()

void reactionStrRight ( OStringStream reaction) const
protected

Add string representation of the right of the reaction.

Definition at line 80 of file Reaction.C.

References reaction.

◆ TypeName()

TypeName ( "Reaction< ReactionThermo >"  )

Runtime type information.

◆ declareRunTimeSelectionTable()

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

◆ clone() [1/2]

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

Construct and return a clone.

Reimplemented in solidReaction< ReactionThermo >.

Definition at line 232 of file Reaction.H.

References Reaction< ReactionThermo >::New().

Here is the call graph for this function:

◆ clone() [2/2]

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

Construct and return a clone with new speciesTable.

Reimplemented in solidReaction< ReactionThermo >.

Definition at line 238 of file Reaction.H.

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

Here is the call graph for this function:

◆ New()

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

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

Definition at line 355 of file Reaction.C.

References dict, Foam::exit(), Foam::FatalIOError, FatalIOErrorInLookup, and dictionary::get().

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

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

◆ name()

const word & name ( ) const
inlinenoexcept

Name of reaction.

Definition at line 267 of file Reaction.H.

Referenced by ReactionList< ThermoType >::write().

Here is the caller graph for this function:

◆ species()

const speciesTable & species ( ) const
inlinenoexcept

Access to specie list.

Definition at line 270 of file Reaction.H.

Referenced by solidReaction< ReactionThermo >::clone(), Reaction< ReactionThermo >::clone(), and solidReaction< ReactionThermo >::solidReaction().

Here is the caller graph for this function:

◆ lhs()

const List< specieCoeffs > & lhs ( ) const
inlinenoexcept

Specie info for the left-hand-side of the reaction.

Definition at line 273 of file Reaction.H.

◆ rhs()

const List< specieCoeffs > & rhs ( ) const
inlinenoexcept

Specie info for the right-hand-side of the reaction.

Definition at line 276 of file Reaction.H.

◆ gasSpecies()

const Foam::speciesTable & gasSpecies
virtual

Access to gas specie list.

Reimplemented in solidReaction< ReactionThermo >.

Definition at line 432 of file Reaction.C.

References NotImplemented.

◆ grhs()

const Foam::List< typename Foam::Reaction< ReactionThermo >::specieCoeffs > & grhs
virtual

Access to gas components of the reaction.

Reimplemented in solidReaction< ReactionThermo >.

Definition at line 450 of file Reaction.C.

References NotImplemented.

◆ glhs()

const Foam::List< typename Foam::Reaction< ReactionThermo >::specieCoeffs > & glhs
virtual

Reimplemented in solidReaction< ReactionThermo >.

Definition at line 441 of file Reaction.C.

References NotImplemented.

◆ setLRhs()

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

Construct the left- and right-hand-side reaction coefficients.

Definition at line 247 of file Reaction.C.

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

Here is the caller graph for this function:

◆ kf()

Foam::scalar kf ( const scalar  p,
const scalar  T,
const scalarField c 
) const
virtual

Forward rate constant.

Definition at line 395 of file Reaction.C.

◆ kr() [1/2]

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

Reverse rate constant from the given forward rate constant.

Definition at line 407 of file Reaction.C.

◆ kr() [2/2]

Foam::scalar kr ( const scalar  p,
const scalar  T,
const scalarField c 
) const
virtual

Reverse rate constant.

Note this evaluates the forward rate constant and divides by the equilibrium constant

Definition at line 420 of file Reaction.C.

◆ write()

void write ( Ostream os) const
virtual

Write.

Reimplemented in solidReaction< ReactionThermo >.

Definition at line 387 of file Reaction.C.

References os(), reaction, and Ostream::writeEntry().

Referenced by ReactionList< ThermoType >::write().

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 = 0
static

Number of un-named reactions.

Definition at line 79 of file Reaction.H.


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