specieReactionRates.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) 2016-2025 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::specieReactionRates
26 
27 Description
28  Writes volume averaged reaction rates in [kg/m^3/s] for each specie and
29  each reaction into the file <timeDir>/specieReactionRates.dat
30 
31  Example of function object specification:
32  \verbatim
33  specieReactionRates1
34  {
35  type specieReactionRates;
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  specieReactionRates.C
54 
55 \*---------------------------------------------------------------------------*/
56 
57 #ifndef specieReactionRates_functionObject_H
58 #define specieReactionRates_functionObject_H
59 
60 #include "fvMeshFunctionObject.H"
61 #include "fvCellZone.H"
62 #include "logFiles.H"
63 #include "basicChemistryModel.H"
64 
65 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
66 
67 namespace Foam
68 {
69 namespace functionObjects
70 {
71 
72 /*---------------------------------------------------------------------------*\
73  Class specieReactionRates Declaration
74 \*---------------------------------------------------------------------------*/
75 
77 :
78  public fvMeshFunctionObject,
79  public logFiles
80 {
81  // Private Member Data
82 
83  //- cellZone
84  fvCellZone zone_;
85 
86  //- Name of the phase
87  const word phaseName_;
88 
89  //- Reference to the chemistry model
90  const basicChemistryModel& chemistryModel_;
91 
92  //- Whether or not to write the specie reaction rate fields
93  bool writeFields_;
94 
95 
96  // Private Member Functions
97 
98  //- File header information
99  virtual void writeFileHeader(const label i);
100 
101 
102 public:
103 
104  //- Runtime type information
105  TypeName("specieReactionRates");
106 
107 
108  // Constructors
109 
110  //- Construct from Time and dictionary
112  (
113  const word& name,
114  const Time& runTime,
115  const dictionary& dict
116  );
117 
118  //- Disallow default bitwise copy construction
119  specieReactionRates(const specieReactionRates&) = delete;
120 
121 
122  //- Destructor
123  virtual ~specieReactionRates();
124 
125 
126  // Member Functions
127 
128  //- Read the specieReactionRates data
129  virtual bool read(const dictionary&);
130 
131  //- Return the list of fields required
132  virtual wordList fields() const
133  {
134  return wordList::null();
135  }
136 
137  //- Do nothing
138  virtual bool execute();
139 
140  //- Write the specie reaction rates
141  virtual bool write();
142 
143 
144  // Mesh changes
145 
146  //- Update for mesh motion
147  virtual void movePoints(const polyMesh&);
148 
149  //- Update topology using the given map
150  virtual void topoChange(const polyTopoChangeMap&);
151 
152  //- Update from another mesh using the given map
153  virtual void mapMesh(const polyMeshMap&);
154 
155  //- Redistribute or update using the given distribution map
156  virtual void distribute(const polyDistributionMap&);
157 
158 
159  // Member Operators
160 
161  //- Disallow default bitwise assignment
162  void operator=(const specieReactionRates&) = delete;
163 };
164 
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 } // End namespace functionObjects
169 } // End namespace Foam
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 #endif
174 
175 // ************************************************************************* //
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
Base class for chemistry models.
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 [kg/m^3/s] for each specie and each reaction into the file <...
virtual wordList fields() const
Return the list of fields required.
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("specieReactionRates")
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.
void operator=(const specieReactionRates &)=delete
Disallow default bitwise assignment.
virtual bool write()
Write the specie reaction rates.
specieReactionRates(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
virtual bool read(const dictionary &)
Read the specieReactionRates 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:80
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
A class for handling words, derived from string.
Definition: word.H:62
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