IrreversibleReaction.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-2017 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::IrreversibleReaction
26 
27 Description
28  Simple extension of Reaction to handle reversible reactions using
29  equilibrium thermodynamics.
30 
31 SourceFiles
32  IrreversibleReaction.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef IrreversibleReaction_H
37 #define IrreversibleReaction_H
38 
39 #include "Reaction.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class IrreversibleReaction 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 k_;
63 
64 
65  // Private Member Functions
66 
67  //- Disallow default bitwise assignment
68  void operator=
69  (
71  <
72  ReactionType,
73  ReactionThermo,
74  ReactionRate
75  >&
76  );
77 
78 
79 public:
80 
81  //- Runtime type information
82  TypeName("irreversible");
83 
84 
85  // Constructors
86 
87  //- Construct from components
89  (
90  const ReactionType<ReactionThermo>& reaction,
91  const ReactionRate& reactionRate
92  );
93 
94  //- Construct as copy given new speciesTable
96  (
98  <
99  ReactionType,
100  ReactionThermo,
101  ReactionRate
102  >&,
103  const speciesTable& species
104  );
105 
106  //- Construct from dictionary
108  (
109  const speciesTable& species,
110  const HashPtrTable<ReactionThermo>& thermoDatabase,
111  const dictionary& dict
112  );
113 
114  //- Construct and return a clone
115  virtual autoPtr<Reaction<ReactionThermo>> clone() const
116  {
118  (
120  <
121  ReactionType,
122  ReactionThermo,
123  ReactionRate
124  >(*this)
125  );
126  }
127 
128  //- Construct and return a clone with new speciesTable
130  (
131  const speciesTable& species
132  ) const
133  {
135  (
137  <
138  ReactionType,
139  ReactionThermo,
140  ReactionRate
141  >
142  (
143  *this,
144  species
145  )
146  );
147  }
148 
149 
150  //- Destructor
151  virtual ~IrreversibleReaction()
152  {}
153 
154 
155  // Member Functions
156 
157  // IrreversibleReaction rate coefficients
158 
159  //- Forward rate constant
160  virtual scalar kf
161  (
162  const scalar p,
163  const scalar T,
164  const scalarField& c
165  ) const;
166 
167 
168  //- Write
169  virtual void write(Ostream&) const;
170 };
171 
172 
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 
175 } // End namespace Foam
176 
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 
179 #ifdef NoRepository
180  #include "IrreversibleReaction.C"
181 #endif
182 
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 
185 #endif
186 
187 // ************************************************************************* //
dictionary dict
virtual void write(Ostream &) const
Write.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
virtual ~IrreversibleReaction()
Destructor.
TypeName("irreversible")
Runtime type information.
virtual autoPtr< Reaction< ReactionThermo > > clone() const
Construct and return a clone.
A HashTable specialization for hashing pointers.
Definition: HashPtrTable.H:50
virtual scalar kf(const scalar p, const scalar T, const scalarField &c) const
Forward rate constant.
IrreversibleReaction(const ReactionType< ReactionThermo > &reaction, const ReactionRate &reactionRate)
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)
A wordList with hashed indices for faster lookup by name.
Info<< "Creating reaction model\"<< 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:52
volScalarField & p
Simple extension of Reaction to handle reversible reactions using equilibrium thermodynamics.
Namespace for OpenFOAM.