ReactionProxy.H
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) 2018 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::ReactionProxy
26 
27 Description
28  Proxy version of Reaction which provides dummy implementations of the
29  abstract virtual functions.
30 
31  Used for read-construction and format conversion.
32 
33 SourceFiles
34  ReactionProxy.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef ReactionProxy_H
39 #define ReactionProxy_H
40 
41 #include "Reaction.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class ReactionProxy Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 template<class ReactionThermo>
53 class ReactionProxy
54 :
55  public Reaction<ReactionThermo>
56 {
57 
58 public:
59 
60  // Constructors
61 
62  //- Construct from components
64  (
65  const speciesTable& species,
68  const HashPtrTable<ReactionThermo>& thermoDatabase
69  );
70 
71  //- Construct as copy given new speciesTable
73  (
75  const speciesTable& species
76  );
77 
78  //- Construct from dictionary
80  (
81  const speciesTable& species,
82  const HashPtrTable<ReactionThermo>& thermoDatabase,
83  const dictionary& dict
84  );
85 
86  //- Construct and return a clone
87  virtual autoPtr<Reaction<ReactionThermo>> clone() const;
88 
89  //- Construct and return a clone with new speciesTable
91  (
92  const speciesTable& species
93  ) const;
94 
95 
96  //- Destructor
97  virtual ~ReactionProxy()
98  {}
99 
100 
101  // Member Functions
102 
103  // Reaction rate coefficients
104 
105  //- Forward rate constant
106  virtual scalar kf
107  (
108  const scalar p,
109  const scalar T,
110  const scalarField& c
111  ) const;
112 
113  //- Reverse rate constant from the given forward rate constant
114  virtual scalar kr
115  (
116  const scalar kfwd,
117  const scalar p,
118  const scalar T,
119  const scalarField& c
120  ) const;
121 
122  //- Reverse rate constant
123  virtual scalar kr
124  (
125  const scalar p,
126  const scalar T,
127  const scalarField& c
128  ) const;
129 
130 
131  // Jacobian coefficients
132 
133  //- Temperature derivative of forward rate
134  virtual scalar dkfdT
135  (
136  const scalar p,
137  const scalar T,
138  const scalarField& c
139  ) const;
140 
141  //- Temperature derivative of reverse rate
142  virtual scalar dkrdT
143  (
144  const scalar p,
145  const scalar T,
146  const scalarField& c,
147  const scalar dkfdT,
148  const scalar kr
149  ) const;
150 
151  //- Third-body efficiencies (beta = 1-alpha)
152  // non-empty only for third-body reactions
153  // with enhanced molecularity (alpha != 1)
154  virtual const List<Tuple2<label, scalar>>& beta() const;
155 
156  //- Species concentration derivative of the pressure dependent term
157  virtual void dcidc
158  (
159  const scalar p,
160  const scalar T,
161  const scalarField& c,
163  ) const;
164 
165  //- Temperature derivative of the pressure dependent term
166  virtual scalar dcidT
167  (
168  const scalar p,
169  const scalar T,
170  const scalarField& c
171  ) const;
172 };
173 
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 } // End namespace Foam
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 #ifdef NoRepository
182  #include "ReactionProxy.C"
183 #endif
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 #endif
188 
189 // ************************************************************************* //
virtual scalar dkrdT(const scalar p, const scalar T, const scalarField &c, const scalar dkfdT, const scalar kr) const
Temperature derivative of reverse rate.
dictionary dict
const List< specieCoeffs > & lhs() const
Return the components of the left hand side.
Definition: ReactionI.H:58
virtual scalar dcidT(const scalar p, const scalar T, const scalarField &c) const
Temperature derivative of the pressure dependent term.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:60
Proxy version of Reaction which provides dummy implementations of the abstract virtual functions...
Definition: ReactionProxy.H:52
virtual scalar kf(const scalar p, const scalar T, const scalarField &c) const
Forward rate constant.
A HashTable specialization for hashing pointers.
Definition: HashPtrTable.H:50
Class to hold the specie index and its coefficients in the.
Definition: Reaction.H:95
Simple extension of ReactionThermo to handle reaction kinetics in addition to the equilibrium thermod...
Definition: Reaction.H:55
const speciesTable & species() const
Return the specie list.
Definition: Reaction.C:805
virtual autoPtr< Reaction< ReactionThermo > > clone() const
Construct and return a clone.
Definition: ReactionProxy.C:83
virtual ~ReactionProxy()
Destructor.
Definition: ReactionProxy.H:96
ReactionProxy(const speciesTable &species, const List< typename Reaction< ReactionThermo >::specieCoeffs > &lhs, const List< typename Reaction< ReactionThermo >::specieCoeffs > &rhs, const HashPtrTable< ReactionThermo > &thermoDatabase)
Construct from components.
Definition: ReactionProxy.C:32
virtual scalar dkfdT(const scalar p, const scalar T, const scalarField &c) const
Temperature derivative of forward rate.
virtual const List< Tuple2< label, scalar > > & beta() const
Third-body efficiencies (beta = 1-alpha)
virtual void dcidc(const scalar p, const scalar T, const scalarField &c, scalarField &dcidc) const
Species concentration derivative of the pressure dependent term.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
A wordList with hashed indices for faster lookup by name.
const dimensionedScalar c
Speed of light in a vacuum.
virtual scalar kr(const scalar kfwd, const scalar p, const scalar T, const scalarField &c) const
Reverse rate constant from the given forward rate constant.
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
const List< specieCoeffs > & rhs() const
Return the components of the right hand side.
Definition: ReactionI.H:66
Namespace for OpenFOAM.