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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2017 OpenFOAM Foundation
9  Copyright (C) 2019-2021 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::IrreversibleReaction
29 
30 Group
31  grpSpecieReactions
32 
33 Description
34  Simple extension of Reaction to handle reversible reactions using
35  equilibrium thermodynamics.
36 
37 SourceFiles
38  IrreversibleReaction.C
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef IrreversibleReaction_H
43 #define IrreversibleReaction_H
44 
45 #include "Reaction.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class IrreversibleReaction Declaration
54 \*---------------------------------------------------------------------------*/
55 
56 template
57 <
58  template<class> class ReactionType,
59  class ReactionThermo,
60  class ReactionRate
61 >
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 
85 public:
86 
87  //- Runtime type information
88  TypeName("irreversible");
89 
90 
91  // Constructors
92 
93  //- Construct from components
95  (
96  const ReactionType<ReactionThermo>& reaction,
97  const ReactionRate& reactionRate
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
121  virtual autoPtr<Reaction<ReactionThermo>> clone() const
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  <
144  ReactionType,
145  ReactionThermo,
146  ReactionRate
147  >
148  (
149  *this,
150  species
151  )
152  );
153  }
154 
155 
156  //- Destructor
157  virtual ~IrreversibleReaction() = default;
158 
159 
160  // Member Functions
161 
162  // IrreversibleReaction rate coefficients
163 
164  //- Forward rate constant
165  virtual scalar kf
166  (
167  const scalar p,
168  const scalar T,
169  const scalarField& c
170  ) const;
171 
172 
173  //- Write
174  virtual void write(Ostream&) const;
175 };
176 
177 
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 
180 } // End namespace Foam
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 #ifdef NoRepository
185  #include "IrreversibleReaction.C"
186 #endif
187 
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 
190 #endif
191 
192 // ************************************************************************* //
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::IrreversibleReaction::~IrreversibleReaction
virtual ~IrreversibleReaction()=default
Destructor.
Foam::IrreversibleReaction
Simple extension of Reaction to handle reversible reactions using equilibrium thermodynamics.
Definition: IrreversibleReaction.H:61
Foam::IrreversibleReaction::TypeName
TypeName("irreversible")
Runtime type information.
Foam::IrreversibleReaction::IrreversibleReaction
IrreversibleReaction(const ReactionType< ReactionThermo > &reaction, const ReactionRate &reactionRate)
Construct from components.
Definition: IrreversibleReaction.C:41
Foam::IrreversibleReaction::clone
virtual autoPtr< Reaction< ReactionThermo > > clone() const
Construct and return a clone.
Definition: IrreversibleReaction.H:120
Foam::Field< scalar >
Foam::hashedWordList
A wordList with hashed named lookup, which can be faster in some situations than using the normal lis...
Definition: hashedWordList.H:54
Foam::IrreversibleReaction::kf
virtual scalar kf(const scalar p, const scalar T, const scalarField &c) const
Forward rate constant.
Definition: IrreversibleReaction.C:102
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:58
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Reaction.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
reaction
CombustionModel< rhoReactionThermo > & reaction
Definition: setRegionFluidFields.H:3
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::HashPtrTable< ThermoType >
Foam::constant::universal::c
const dimensionedScalar c
Speed of light in a vacuum.
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::IrreversibleReaction::write
virtual void write(Ostream &) const
Write.
Definition: IrreversibleReaction.C:120
IrreversibleReaction.C