NonEquilibriumReversibleReaction.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::NonEquilibriumReversibleReaction
26 
27 Description
28  Simple extension of Reaction to handle reversible reactions using
29  equilibrium thermodynamics.
30 
31 SourceFiles
32  NonEquilibriumReversibleReaction.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef NonEquilibriumReversibleReaction_H
37 #define NonEquilibriumReversibleReaction_H
38 
39 #include "Reaction.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class NonEquilibriumReversibleReaction Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 template
51 <
52  template<class> class ReactionType,
53  class ReactionThermo,
54  class ReactionRate
55 >
57 :
58  public ReactionType<ReactionThermo>
59 {
60  // Private data
61 
62  ReactionRate fk_;
63  ReactionRate rk_;
64 
65 
66  // Private Member Functions
67 
68  //- Disallow default bitwise assignment
69  void operator=
70  (
72  <ReactionType, ReactionThermo, ReactionRate>&
73  );
74 
75 
76 public:
77 
78  //- Runtime type information
79  TypeName("nonEquilibriumReversible");
80 
81 
82  // Constructors
83 
84  //- Construct from components
86  (
87  const ReactionType<ReactionThermo>& reaction,
88  const ReactionRate& forwardReactionRate,
89  const ReactionRate& reverseReactionRate
90  );
91 
92  //- Construct as copy given new speciesTable
94  (
96  <ReactionType, ReactionThermo, ReactionRate>&,
97  const speciesTable& species
98  );
99 
100  //- Construct from Istream
102  (
103  const speciesTable& species,
104  const HashPtrTable<ReactionThermo>& thermoDatabase,
105  Istream& is
106  );
107 
108  //- Construct from dictionary
110  (
111  const speciesTable& species,
112  const HashPtrTable<ReactionThermo>& thermoDatabase,
113  const dictionary& dict
114  );
115 
116  //- Construct and return a clone
118  {
120  (
122  <ReactionType, ReactionThermo, ReactionRate>(*this)
123  );
124  }
125 
126  //- Construct and return a clone with new speciesTable
128  (
129  const speciesTable& species
130  ) const
131  {
133  (
135  <ReactionType, ReactionThermo, ReactionRate>
136  (*this, species)
137  );
138  }
139 
140 
141  //- Destructor
143  {}
144 
145 
146  // Member Functions
147 
148  // NonEquilibriumReversibleReaction rate coefficients
149 
150  //- Forward rate constant
151  virtual scalar kf
152  (
153  const scalar p,
154  const scalar T,
155  const scalarField& c
156  ) const;
157 
158  //- Reverse rate constant from the given formard rate constant
159  virtual scalar kr
160  (
161  const scalar kfwd,
162  const scalar p,
163  const scalar T,
164  const scalarField& c
165  ) const;
166 
167  //- Reverse rate constant.
168  // Note this evaluates the forward rate constant and divides by the
169  // equilibrium constant
170  virtual scalar kr
171  (
172  const scalar p,
173  const scalar T,
174  const scalarField& c
175  ) const;
176 
177 
178  //- Write
179  virtual void write(Ostream&) const;
180 };
181 
182 
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 
185 } // End namespace Foam
186 
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 
189 #ifdef NoRepository
191 #endif
192 
193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 
195 #endif
196 
197 // ************************************************************************* //
dictionary dict
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
TypeName("nonEquilibriumReversible")
Runtime type information.
virtual autoPtr< ReactionType< ReactionThermo > > clone() const
Construct and return a clone.
Simple extension of Reaction to handle reversible reactions using equilibrium thermodynamics.
NonEquilibriumReversibleReaction(const ReactionType< ReactionThermo > &reaction, const ReactionRate &forwardReactionRate, const ReactionRate &reverseReactionRate)
Construct from components.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
virtual scalar kf(const scalar p, const scalar T, const scalarField &c) const
Forward rate constant.
A wordList with hashed indices for faster lookup by name.
Info<< "Creating reaction model\n"<< endl;autoPtr< combustionModels::psiCombustionModel > reaction(combustionModels::psiCombustionModel::New(mesh))
const dimensionedScalar c
Speed of light in a vacuum.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:53
virtual scalar kr(const scalar kfwd, const scalar p, const scalar T, const scalarField &c) const
Reverse rate constant from the given formard rate constant.
volScalarField & p
Namespace for OpenFOAM.