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-2023 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
187  virtual autoPtr<Cloud<parcelType>> clone(const word& name)
188  {
190  (
191  new ReactingMultiphaseCloud(*this, name)
192  );
193  }
194 
195  //- Construct and return bare clone based on (this) with new name
196  virtual autoPtr<Cloud<parcelType>> cloneBare(const word& name) const
197  {
199  (
200  new ReactingMultiphaseCloud(this->mesh(), name, *this)
201  );
202  }
203 
204 
205  //- Destructor
206  virtual ~ReactingMultiphaseCloud();
207 
208 
209  // Member Functions
210 
211  // Access
212 
213  //- Return a reference to the cloud copy
214  inline const ReactingMultiphaseCloud& cloudCopy() const;
215 
216  //- Return the constant properties
217  inline const typename parcelType::constantProperties&
218  constProps() const;
219 
220  //- Return access to the constant properties
221  inline typename parcelType::constantProperties& constProps();
222 
223 
224  // Sub-models
225 
226  //- Return const access to devolatilisation model
227  inline const DevolatilisationModel
228  <
230  >&
231  devolatilisation() const;
232 
233  //- Return reference to devolatilisation model
234  inline DevolatilisationModel
235  <
237  >&
239 
240  //- Return const access to reacting surface reaction model
241  inline const SurfaceReactionModel
242  <
244  >&
245  surfaceReaction() const;
246 
247  //- Return reference to reacting surface reaction model
248  inline SurfaceReactionModel
249  <
251  >&
252  surfaceReaction();
253 
254 
255  // Cloud evolution functions
256 
257  //- Set parcel thermo properties
259 
260  //- Check parcel properties
262  (
263  parcelType& parcel,
264  const label injectori
265  );
266 
267  //- Store the current cloud state
268  void storeState();
269 
270  //- Reset the current cloud to the previously stored state
271  void restoreState();
272 
273  //- Reset the cloud source terms
274  void resetSourceTerms();
275 
276  //- Evolve the cloud
277  void evolve();
278 
279 
280  // I-O
281 
282  //- Print cloud information
283  void info();
284 
285  //- Write the field data for the cloud
286  virtual void writeFields() const;
287 
288 
289  // Member Operators
290 
291  //- Disallow default bitwise assignment
292  void operator=(const ReactingMultiphaseCloud&) = delete;
293 };
294 
295 
296 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
297 
298 } // End namespace Foam
299 
300 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
301 
303 
304 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
305 
306 #ifdef NoRepository
307  #include "ReactingMultiphaseCloud.C"
308 #endif
309 
310 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
311 
312 #endif
313 
314 // ************************************************************************* //
ParcelType particleType
Definition: Cloud.H:128
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:79
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:221
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:283
const word & name() const
Return name.
Definition: IOobject.H:310
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.
virtual autoPtr< Cloud< parcelType > > cloneBare(const word &name) const
Construct and return bare clone based on (this) with new name.
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 ~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:57
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:101
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)