ReactingMultiphaseCloud.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) 2011-2024 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::ReactingMultiphaseCloud
26 
27 Description
28  Templated base class for multiphase reacting cloud
29 
30  - Adds to reacting cloud
31  - multiphase composition
32  - devolatilisation
33  - surface reactions
34 
35 SourceFiles
36  ReactingMultiphaseCloudI.H
37  ReactingMultiphaseCloud.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef ReactingMultiphaseCloud_H
42 #define ReactingMultiphaseCloud_H
43 
44 #include "volFieldsFwd.H"
45 #include "fvMatricesFwd.H"
46 #include "dimensionedTypes.H"
47 #include "fvMesh.H"
48 #include "fluidThermo.H"
49 #include "Cloud.H"
50 
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
53 namespace Foam
54 {
55 
56 // Forward declaration of classes
57 
58 template<class CloudType>
59 class DevolatilisationModel;
60 
61 template<class CloudType>
62 class SurfaceReactionModel;
63 
64 
65 /*---------------------------------------------------------------------------*\
66  Class ReactingMultiphaseCloudName Declaration
67 \*---------------------------------------------------------------------------*/
68 
70 
71 
72 /*---------------------------------------------------------------------------*\
73  Class ReactingMultiphaseCloud Declaration
74 \*---------------------------------------------------------------------------*/
75 
76 template<class CloudType>
78 :
79  public CloudType,
80  public ReactingMultiphaseCloudName
81 {
82 public:
83 
84  // Public Typedefs
85 
86  //- Type of cloud this cloud was instantiated for
87  typedef CloudType cloudType;
88 
89  //- Type of parcel the cloud was instantiated for
90  typedef typename CloudType::particleType parcelType;
91 
92  //- Convenience typedef for this cloud type
94 
95 
96 private:
97 
98  // Private Data
99 
100  //- Cloud copy pointer
102 
103 
104 protected:
105 
106  // Protected data
107 
108  //- Parcel constant properties
109  typename parcelType::constantProperties constProps_;
110 
111 
112  // References to the cloud sub-models
113 
114  //- Devolatilisation model
115  autoPtr
116  <
118  >
120 
121  //- Surface reaction model
122  autoPtr
123  <
125  >
127 
128 
129  // Check
130 
131  //- Total mass transferred to continuous phase via devolatilisation
132  scalar dMassDevolatilisation_;
133 
134  //- Total mass transferred to continuous phase via surface
135  // reactions
136  scalar dMassSurfaceReaction_;
137 
138 
139  // Protected Member Functions
140 
141  // Initialisation
142 
143  //- Set cloud sub-models
144  void setModels();
145 
146 
147  // Cloud evolution functions
148 
149  //- Reset state of cloud
151 
152 
153 public:
154 
155  // Constructors
156 
157  //- Construct given carrier fields and thermo
159  (
160  const word& cloudName,
161  const volScalarField& rho,
162  const volVectorField& U,
163  const dimensionedVector& g,
164  const fluidThermo& carrierThermo,
165  const bool readFields = true
166  );
167 
168  //- Copy constructor with new name
170  (
172  const word& name
173  );
174 
175  //- Copy constructor with new name - creates bare cloud
177  (
178  const fvMesh& mesh,
179  const word& name,
181  );
182 
183  //- Disallow default bitwise copy construction
185 
186  //- Construct and return clone based on (this) with new name
188  {
190  (
191  new ReactingMultiphaseCloud(*this, name)
192  );
193  }
194 
195  //- Construct and return bare clone based on (this) with new name
197  (
198  const word& name
199  ) const
200  {
202  (
203  new ReactingMultiphaseCloud(this->mesh(), name, *this)
204  );
205  }
206 
207 
208  //- Destructor
209  virtual ~ReactingMultiphaseCloud();
210 
211 
212  // Member Functions
213 
214  // Access
215 
216  //- Return a reference to the cloud copy
217  inline const ReactingMultiphaseCloud& cloudCopy() const;
218 
219  //- Return the constant properties
220  inline const typename parcelType::constantProperties&
221  constProps() const;
222 
223  //- Return access to the constant properties
224  inline typename parcelType::constantProperties& constProps();
225 
226 
227  // Sub-models
228 
229  //- Return const access to devolatilisation model
230  inline const DevolatilisationModel
231  <
233  >&
234  devolatilisation() const;
235 
236  //- Return reference to devolatilisation model
237  inline DevolatilisationModel
238  <
240  >&
242 
243  //- Return const access to reacting surface reaction model
244  inline const SurfaceReactionModel
245  <
247  >&
248  surfaceReaction() const;
249 
250  //- Return reference to reacting surface reaction model
251  inline SurfaceReactionModel
252  <
254  >&
255  surfaceReaction();
256 
257 
258  // Cloud evolution functions
259 
260  //- Set parcel thermo properties
262 
263  //- Check parcel properties
265  (
266  parcelType& parcel,
267  const label injectori
268  );
269 
270  //- Store the current cloud state
271  void storeState();
272 
273  //- Reset the current cloud to the previously stored state
274  void restoreState();
275 
276  //- Reset the cloud source terms
277  void resetSourceTerms();
278 
279  //- Evolve the cloud
280  void evolve();
281 
282 
283  // I-O
284 
285  //- Print cloud information
286  void info();
287 
288  //- Write the field data for the cloud
289  virtual void writeFields() const;
290 
291 
292  // Member Operators
293 
294  //- Disallow default bitwise assignment
295  void operator=(const ReactingMultiphaseCloud&) = delete;
296 };
297 
298 
299 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
300 
301 } // End namespace Foam
302 
303 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
304 
306 
307 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
308 
309 #ifdef NoRepository
310  #include "ReactingMultiphaseCloud.C"
311 #endif
312 
313 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
314 
315 #endif
316 
317 // ************************************************************************* //
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:80
const word & cloudName() const
Return the cloud type.
Definition: DSMCCloudI.H:34
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:225
const fvMesh & mesh() const
Return references to the mesh.
Definition: DSMCCloudI.H:41
Templated devolatilisation model class.
Generic GeometricField class.
autoPtr< IOobject > clone() const
Clone.
Definition: IOobject.H:280
const word & name() const
Return name.
Definition: IOobject.H:307
Templated base class for multiphase reacting cloud.
const parcelType::constantProperties & constProps() const
Return the constant properties.
autoPtr< SurfaceReactionModel< ReactingMultiphaseCloud< CloudType > > > surfaceReactionModel_
Surface reaction model.
void setModels()
Set cloud sub-models.
void storeState()
Store the current cloud state.
const ReactingMultiphaseCloud & cloudCopy() const
Return a reference to the cloud copy.
void operator=(const ReactingMultiphaseCloud &)=delete
Disallow default bitwise assignment.
const DevolatilisationModel< ReactingMultiphaseCloud< CloudType > > & devolatilisation() const
Return const access to devolatilisation model.
autoPtr< DevolatilisationModel< ReactingMultiphaseCloud< CloudType > > > devolatilisationModel_
Devolatilisation model.
scalar dMassSurfaceReaction_
Total mass transferred to continuous phase via surface.
scalar dMassDevolatilisation_
Total mass transferred to continuous phase via devolatilisation.
ReactingMultiphaseCloud(const word &cloudName, const volScalarField &rho, const volVectorField &U, const dimensionedVector &g, const fluidThermo &carrierThermo, const bool readFields=true)
Construct given carrier fields and thermo.
CloudType::particleType parcelType
Type of parcel the cloud was instantiated for.
virtual void writeFields() const
Write the field data for the cloud.
CloudType cloudType
Type of cloud this cloud was instantiated for.
ReactingMultiphaseCloud< CloudType > reactingMultiphaseCloudType
Convenience typedef for this cloud type.
parcelType::constantProperties constProps_
Parcel constant properties.
void info()
Print cloud information.
void restoreState()
Reset the current cloud to the previously stored state.
void cloudReset(ReactingMultiphaseCloud< CloudType > &c)
Reset state of cloud.
void checkParcelProperties(parcelType &parcel, const label injectori)
Check parcel properties.
void resetSourceTerms()
Reset the cloud source terms.
const SurfaceReactionModel< ReactingMultiphaseCloud< CloudType > > & surfaceReaction() const
Return const access to reacting surface reaction model.
void setParcelThermoProperties(parcelType &parcel)
Set parcel thermo properties.
virtual autoPtr< lagrangian::Cloud< parcelType > > cloneBare(const word &name) const
Construct and return bare clone based on (this) with new name.
virtual ~ReactingMultiphaseCloud()
Destructor.
Templated surface reaction model class.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
Base-class for fluid thermodynamic properties.
Definition: fluidThermo.H:56
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:96
A class for handling words, derived from string.
Definition: word.H:62
Forward declarations of fvMatrix specialisations.
U
Definition: pEqn.H:72
const dimensionedScalar c
Speed of light in a vacuum.
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
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const HashSet< word > &selectedFields, LIFOStack< regIOobject * > &storedObjects)
Read the selected GeometricFields of the specified type.
Definition: ReadFields.C:244
TemplateName(FvFaceCellWave)