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-2021 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>
60 
61 template<class CloudType>
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  parcelType& parcel,
261  const scalar lagrangianDt
262  );
263 
264  //- Check parcel properties
266  (
267  parcelType& parcel,
268  const scalar lagrangianDt,
269  const bool fullyDescribed
270  );
271 
272  //- Store the current cloud state
273  void storeState();
274 
275  //- Reset the current cloud to the previously stored state
276  void restoreState();
277 
278  //- Reset the cloud source terms
279  void resetSourceTerms();
280 
281  //- Evolve the cloud
282  void evolve();
283 
284 
285  // Mapping
286 
287  //- Remap the cells of particles corresponding to the
288  // mesh topology change with a default tracking data object
289  virtual void autoMap(const mapPolyMesh&);
290 
291 
292  // I-O
293 
294  //- Print cloud information
295  void info();
296 
297  //- Write the field data for the cloud
298  virtual void writeFields() const;
299 
300 
301  // Member Operators
302 
303  //- Disallow default bitwise assignment
304  void operator=(const ReactingMultiphaseCloud&) = delete;
305 };
306 
307 
308 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
309 
310 } // End namespace Foam
311 
312 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
313 
315 
316 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
317 
318 #ifdef NoRepository
319  #include "ReactingMultiphaseCloud.C"
320 #endif
321 
322 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
323 
324 #endif
325 
326 // ************************************************************************* //
ParcelType particleType
Definition: Cloud.H:105
TemplateName(blendedSchemeBase)
virtual autoPtr< Cloud< parcelType > > cloneBare(const word &name) const
Construct and return bare clone based on (this) with new name.
autoPtr< IOobject > clone() const
Clone.
Definition: IOobject.H:276
CloudType::particleType parcelType
Type of parcel the cloud was instantiated for.
const word & name() const
Return name.
Definition: IOobject.H:303
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
void setModels()
Set cloud sub-models.
const word & cloudName() const
Return the cloud type.
Definition: DSMCCloudI.H:34
parcelType::constantProperties constProps_
Parcel constant properties.
autoPtr< SurfaceReactionModel< ReactingMultiphaseCloud< CloudType > > > surfaceReactionModel_
Surface reaction model.
const dimensionedScalar c
Speed of light in a vacuum.
Templated base class for multiphase reacting cloud.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
void cloudReset(ReactingMultiphaseCloud< CloudType > &c)
Reset state of cloud.
void restoreState()
Reset the current cloud to the previously stored state.
virtual void autoMap(const mapPolyMesh &)
Remap the cells of particles corresponding to the.
A class for handling words, derived from string.
Definition: word.H:59
CloudType cloudType
Type of cloud this cloud was instantiated for.
Base-class for fluid thermodynamic properties.
Definition: fluidThermo.H:53
void resetSourceTerms()
Reset the cloud source terms.
void storeState()
Store the current cloud state.
virtual ~ReactingMultiphaseCloud()
Destructor.
ReactingMultiphaseCloud< CloudType > reactingMultiphaseCloudType
Convenience typedef for this cloud type.
autoPtr< DevolatilisationModel< ReactingMultiphaseCloud< CloudType > > > devolatilisationModel_
Devolatilisation model.
void setParcelThermoProperties(parcelType &parcel, const scalar lagrangianDt)
Set parcel thermo properties.
const fvMesh & mesh() const
Return references to the mesh.
Definition: DSMCCloudI.H:41
virtual void writeFields() const
Write the field data for the cloud.
Forward declarations of fvMatrix specialisations.
U
Definition: pEqn.H:72
const ReactingMultiphaseCloud & cloudCopy() const
Return a reference to the cloud copy.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
scalar dMassDevolatilisation_
Total mass transferred to continuous phase via devolatilisation.
const SurfaceReactionModel< ReactingMultiphaseCloud< CloudType > > & surfaceReaction() const
Return const access to reacting surface reaction model.
const parcelType::constantProperties & constProps() const
Return the constant properties.
void checkParcelProperties(parcelType &parcel, const scalar lagrangianDt, const bool fullyDescribed)
Check parcel properties.
void operator=(const ReactingMultiphaseCloud &)=delete
Disallow default bitwise assignment.
Templated devolatilisation model class.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
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.
const dimensionedVector & g
void info()
Print cloud information.
scalar dMassSurfaceReaction_
Total mass transferred to continuous phase via surface.
Templated surface reaction model class.
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:75
const DevolatilisationModel< ReactingMultiphaseCloud< CloudType > > & devolatilisation() const
Return const access to devolatilisation model.
Namespace for OpenFOAM.