ReversibleReaction.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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2017 OpenFOAM Foundation
9 Copyright (C) 2019-2021 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::ReversibleReaction
29
30Group
31 grpSpecieReactions
32
33Description
34 Simple extension of Reaction to handle reversible reactions using
35 equilibrium thermodynamics.
36
37SourceFiles
38 ReversibleReaction.C
39
40\*---------------------------------------------------------------------------*/
41
42#ifndef ReversibleReaction_H
43#define ReversibleReaction_H
44
45#include "Reaction.H"
46
47// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48
49namespace Foam
50{
51
52/*---------------------------------------------------------------------------*\
53 Class ReversibleReaction Declaration
54\*---------------------------------------------------------------------------*/
55
56template
57<
58 template<class> class ReactionType,
59 class ReactionThermo,
60 class ReactionRate
63:
64 public ReactionType<ReactionThermo>
65{
66 // Private Data
67
68 ReactionRate k_;
69
70
71 // Private Member Functions
72
73 //- No copy assignment
74 void operator=
75 (
77 <
78 ReactionType,
79 ReactionThermo,
80 ReactionRate
81 >&
82 ) = delete;
83
84
85public:
86
87 //- Runtime type information
88 TypeName("reversible");
89
90
91 // Constructors
92
93 //- Construct from components
95 (
96 const ReactionType<ReactionThermo>& reaction,
97 const ReactionRate& k
98 );
99
100 //- Construct as copy given new speciesTable
102 (
104 <
105 ReactionType,
106 ReactionThermo,
107 ReactionRate
108 >&,
109 const speciesTable& species
110 );
111
112 //- Construct from dictionary
114 (
115 const speciesTable& species,
116 const ReactionTable<ReactionThermo>& thermoDatabase,
117 const dictionary& dict
118 );
119
120 //- Construct and return a clone
122 {
124 (
126 <
127 ReactionType,
128 ReactionThermo,
129 ReactionRate
130 >(*this)
131 );
132 }
133
134 //- Construct and return a clone with new speciesTable
136 (
137 const speciesTable& species
138 ) const
139 {
141 (
143 <ReactionType, ReactionThermo, ReactionRate>
144 (
145 *this,
146 species
147 )
148 );
149 }
150
151
152 //- Destructor
153 virtual ~ReversibleReaction() = default;
154
155
156 // Member Functions
157
158 // ReversibleReaction rate coefficients
159
160 //- Forward rate constant
161 virtual scalar kf
162 (
163 const scalar p,
164 const scalar T,
165 const scalarField& c
166 ) const;
167
168 //- Reverse rate constant from the given formard rate constant
169 virtual scalar kr
170 (
171 const scalar kfwd,
172 const scalar p,
173 const scalar T,
174 const scalarField& c
175 ) const;
176
177 //- Reverse rate constant.
178 // Note this evaluates the forward rate constant and divides by
179 // the equilibrium constant
180 virtual scalar kr
181 (
182 const scalar p,
183 const scalar T,
184 const scalarField& c
185 ) const;
186
187
188 //- Write
189 virtual void write(Ostream&) const;
190};
191
192
193// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194
195} // End namespace Foam
196
197// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198
199#ifdef NoRepository
200 #include "ReversibleReaction.C"
201#endif
202
203// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204
205#endif
206
207// ************************************************************************* //
label k
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Simple extension of Reaction to handle reversible reactions using equilibrium thermodynamics.
TypeName("reversible")
Runtime type information.
virtual autoPtr< ReactionType< ReactionThermo > > clone(const speciesTable &species) const
Construct and return a clone with new speciesTable.
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.
virtual autoPtr< ReactionType< ReactionThermo > > clone() const
Construct and return a clone.
virtual ~ReversibleReaction()=default
Destructor.
virtual scalar kf(const scalar p, const scalar T, const scalarField &c) const
Forward rate constant.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A wordList with hashed named lookup, which can be faster in some situations than using the normal lis...
volScalarField & p
const volScalarField & T
CombustionModel< rhoReactionThermo > & reaction
Namespace for OpenFOAM.
runTime write()
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73