IrreversibleReaction.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2019 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 \*---------------------------------------------------------------------------*/
25 
26 #include "IrreversibleReaction.H"
27 
28 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
29 
30 template<class ReactionThermo, class ReactionRate>
33 (
34  const Reaction<ReactionThermo>& reaction,
35  const ReactionRate& k
36 )
37 :
39  k_(k)
40 {}
41 
42 
43 template<class ReactionThermo, class ReactionRate>
46 (
47  const speciesTable& species,
48  const HashPtrTable<ReactionThermo>& thermoDatabase,
49  const dictionary& dict
50 )
51 :
52  Reaction<ReactionThermo>(species, thermoDatabase, dict),
53  k_(species, dict)
54 {}
55 
56 
57 template<class ReactionThermo, class ReactionRate>
60 (
61  const speciesTable& species,
62  const HashPtrTable<ReactionThermo>& thermoDatabase,
63  const objectRegistry& ob,
64  const dictionary& dict
65 )
66 :
67  Reaction<ReactionThermo>(species, thermoDatabase, dict),
68  k_(species, ob, dict)
69 {}
70 
71 
72 template<class ReactionThermo, class ReactionRate>
75 (
77  const speciesTable& species
78 )
79 :
80  Reaction<ReactionThermo>(irr, species),
81  k_(irr.k_)
82 {}
83 
84 
85 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
86 
87 template<class ReactionThermo, class ReactionRate>
89 (
90  const scalar p,
91  const scalar T,
92  const scalarField& c,
93  const label li
94 ) const
95 {
96  return k_(p, T, c, li);
97 }
98 
99 
100 template<class ReactionThermo, class ReactionRate>
102 (
103  const scalar kfwd,
104  const scalar p,
105  const scalar T,
106  const scalarField& c,
107  const label li
108 ) const
109 {
110  return 0;
111 }
112 
113 
114 template<class ReactionThermo, class ReactionRate>
116 (
117  const scalar p,
118  const scalar T,
119  const scalarField& c,
120  const label li
121 ) const
122 {
123  return 0;
124 }
125 
126 
127 template<class ReactionThermo, class ReactionRate>
129 (
130  const scalar p,
131  const scalar T,
132  const scalarField& c,
133  const label li
134 ) const
135 {
136  return k_.ddT(p, T, c, li);
137 }
138 
139 
140 template<class ReactionThermo, class ReactionRate>
142 (
143  const scalar p,
144  const scalar T,
145  const scalarField& c,
146  const label li,
147  const scalar dkfdT,
148  const scalar kr
149 ) const
150 {
151  return 0;
152 }
153 
154 
155 template<class ReactionThermo, class ReactionRate>
158 {
159  return k_.beta();
160 }
161 
162 
163 template<class ReactionThermo, class ReactionRate>
165 (
166  const scalar p,
167  const scalar T,
168  const scalarField& c,
169  const label li,
170  scalarField& dcidc
171 ) const
172 {
173  k_.dcidc(p, T, c, li, dcidc);
174 }
175 
176 
177 template<class ReactionThermo, class ReactionRate>
179 (
180  const scalar p,
181  const scalar T,
182  const scalarField& c,
183  const label li
184 ) const
185 {
186  return k_.dcidT(p, T, c, li);
187 }
188 
189 
190 template<class ReactionThermo, class ReactionRate>
192 (
193  Ostream& os
194 ) const
195 {
197  k_.write(os);
198 }
199 
200 
201 // ************************************************************************* //
dictionary dict
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
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:158
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
virtual scalar dkfdT(const scalar p, const scalar T, const scalarField &c, const label li) const
Temperature derivative of forward rate.
A HashTable specialization for hashing pointers.
Definition: HashPtrTable.H:50
Simple extension of ReactionThermo to handle reaction kinetics in addition to the equilibrium thermod...
Definition: Reaction.H:56
virtual const List< Tuple2< label, scalar > > & beta() const
Third-body efficiencies (beta = 1-alpha)
CombustionModel< rhoReactionThermo > & reaction
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
virtual scalar dcidT(const scalar p, const scalar T, const scalarField &c, const label li) const
Temperature derivative of the pressure dependent term.
virtual scalar kf(const scalar p, const scalar T, const scalarField &c, const label li) const
Forward rate constant.
IrreversibleReaction(const Reaction< ReactionThermo > &reaction, const ReactionRate &reactionRate)
Construct from components.
A wordList with hashed indices for faster lookup by name.
virtual scalar dkrdT(const scalar p, const scalar T, const scalarField &c, const label li, const scalar dkfdT, const scalar kr) const
Temperature derivative of reverse rate.
virtual scalar kr(const scalar kfwd, const scalar p, const scalar T, const scalarField &c, const label li) const
Reverse rate constant from the given forward rate constant.
Registry of regIOobjects.
virtual void dcidc(const scalar p, const scalar T, const scalarField &c, const label li, scalarField &dcidc) const
Species concentration derivative of the pressure dependent term.
Simple extension of Reaction to handle irreversible reactions.