reactionRates.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) 2024-2026 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::functionObjects::reactionRates
26 
27 Description
28  Writes volume averaged reaction rates in [kmol/m^3/s] for
29  each reaction into the file <timeDir>/reactionRates.dat
30 
31  Example of function object specification:
32  \verbatim
33  reactionRates1
34  {
35  type reactionRates;
36  libs ("libchemistryModel.so");
37 
38  cellZone all; // Or points, cellSet, cellZone
39 
40  //phase <phaseName>; // Optional name of the phase
41 
42  //writeFields false; // Optionally also write the rate fields. Note
43  // that this can create a lot of data.
44  }
45  \endverbatim
46 
47 See also
48  Foam::functionObjects::fvMeshFunctionObject
49  Foam::fvCellZone
50  Foam::functionObjects::logFiles
51 
52 SourceFiles
53  reactionRates.C
54 
55 \*---------------------------------------------------------------------------*/
56 
57 #ifndef reactionRates_functionObject_H
58 #define reactionRates_functionObject_H
59 
60 #include "fvMeshFunctionObject.H"
61 #include "fvCellZone.H"
62 #include "logFiles.H"
63 
64 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
65 
66 namespace Foam
67 {
68 namespace functionObjects
69 {
70 
71 /*---------------------------------------------------------------------------*\
72  Class reactionRates Declaration
73 \*---------------------------------------------------------------------------*/
74 
75 class reactionRates
76 :
77  public fvMeshFunctionObject,
78  public logFiles
79 {
80  // Private Data
81 
82  //- cellZone
83  fvCellZone zone_;
84 
85  //- Name of the phase
86  const word phaseName_;
87 
88  //- Whether or not to write the reaction rate fields
89  bool writeFields_;
90 
91 
92  // Private Member Functions
93 
94  //- File header information
95  virtual void writeFileHeader(const label i);
96 
97 
98 public:
99 
100  //- Runtime type information
101  TypeName("reactionRates");
102 
103 
104  // Constructors
105 
106  //- Construct from Time and dictionary
108  (
109  const word& name,
110  const Time& runTime,
111  const dictionary& dict
112  );
113 
114  //- Disallow default bitwise copy construction
115  reactionRates(const reactionRates&) = delete;
116 
117 
118  //- Destructor
119  virtual ~reactionRates();
120 
121 
122  // Member Functions
123 
124  //- Read the reactionRates data
125  virtual bool read(const dictionary&);
126 
127  //- Return the list of fields required
128  virtual wordList fields() const
129  {
130  return wordList::null();
131  }
132 
133  //- Do nothing
134  virtual bool execute();
135 
136  //- Write the reaction rates
137  virtual bool write();
138 
139 
140  // Mesh changes
141 
142  //- Update for mesh motion
143  virtual void movePoints(const polyMesh&);
144 
145  //- Update topology using the given map
146  virtual void topoChange(const polyTopoChangeMap&);
147 
148  //- Update from another mesh using the given map
149  virtual void mapMesh(const polyMeshMap&);
150 
151  //- Redistribute or update using the given distribution map
152  virtual void distribute(const polyDistributionMap&);
153 
154 
155  // Member Operators
156 
157  //- Disallow default bitwise assignment
158  void operator=(const reactionRates&) = delete;
159 };
160 
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 } // End namespace functionObjects
165 } // End namespace Foam
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 #endif
170 
171 // ************************************************************************* //
static const List< word > & null()
Return a null List.
Definition: ListI.H:118
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:76
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
const word & name() const
Return the name of this functionObject.
Specialisation of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
functionObject base class for creating, maintaining and writing log files e.g. integrated of averaged...
Definition: logFiles.H:60
Writes volume averaged reaction rates in [kmol/m^3/s] for each reaction into the file <timeDir>/react...
Definition: reactionRates.H:78
void operator=(const reactionRates &)=delete
Disallow default bitwise assignment.
virtual wordList fields() const
Return the list of fields required.
reactionRates(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
Definition: reactionRates.C:83
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
TypeName("reactionRates")
Runtime type information.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
virtual void movePoints(const polyMesh &)
Update for mesh motion.
virtual bool execute()
Do nothing.
virtual bool write()
Write the reaction rates.
virtual bool read(const dictionary &)
Read the reactionRates data.
cellZone selection or generation class with caching of zone volume
Definition: fvCellZone.H:94
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Definition: polyMeshMap.H:51
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:78
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
A class for handling words, derived from string.
Definition: word.H:63
Namespace for OpenFOAM.
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
dictionary dict