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-2019 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 
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 // Forward declaration of classes
52 
53 template<class CloudType>
55 
56 template<class CloudType>
58 
59 /*---------------------------------------------------------------------------*\
60  Class ReactingMultiphaseCloud Declaration
61 \*---------------------------------------------------------------------------*/
62 
63 template<class CloudType>
65 :
66  public CloudType,
68 {
69 public:
70 
71  // Public Typedefs
72 
73  //- Type of cloud this cloud was instantiated for
74  typedef CloudType cloudType;
75 
76  //- Type of parcel the cloud was instantiated for
77  typedef typename CloudType::particleType parcelType;
78 
79  //- Convenience typedef for this cloud type
81 
82 
83 private:
84 
85  // Private Data
86 
87  //- Cloud copy pointer
89 
90 
91 protected:
92 
93  // Protected data
94 
95  //- Parcel constant properties
96  typename parcelType::constantProperties constProps_;
97 
98 
99  // References to the cloud sub-models
100 
101  //- Devolatilisation model
102  autoPtr
103  <
105  >
107 
108  //- Surface reaction model
109  autoPtr
110  <
112  >
114 
115 
116  // Check
117 
118  //- Total mass transferred to continuous phase via devolatilisation
119  scalar dMassDevolatilisation_;
120 
121  //- Total mass transferred to continuous phase via surface
122  // reactions
123  scalar dMassSurfaceReaction_;
124 
125 
126  // Protected Member Functions
127 
128  // Initialisation
129 
130  //- Set cloud sub-models
131  void setModels();
132 
133 
134  // Cloud evolution functions
135 
136  //- Reset state of cloud
138 
139 
140 public:
141 
142  // Constructors
143 
144  //- Construct given carrier gas fields
146  (
147  const word& cloudName,
148  const volScalarField& rho,
149  const volVectorField& U,
150  const dimensionedVector& g,
151  const SLGThermo& thermo,
152  bool readFields = true
153  );
154 
155 
156  //- Copy constructor with new name
158  (
160  const word& name
161  );
162 
163  //- Copy constructor with new name - creates bare cloud
165  (
166  const fvMesh& mesh,
167  const word& name,
169  );
170 
171  //- Disallow default bitwise copy construction
173 
174  //- Construct and return clone based on (this) with new name
175  virtual autoPtr<Cloud<parcelType>> clone(const word& name)
176  {
178  (
179  new ReactingMultiphaseCloud(*this, name)
180  );
181  }
182 
183  //- Construct and return bare clone based on (this) with new name
184  virtual autoPtr<Cloud<parcelType>> cloneBare(const word& name) const
185  {
187  (
188  new ReactingMultiphaseCloud(this->mesh(), name, *this)
189  );
190  }
191 
192 
193  //- Destructor
194  virtual ~ReactingMultiphaseCloud();
195 
196 
197  // Member Functions
198 
199  // Access
200 
201  //- Return a reference to the cloud copy
202  inline const ReactingMultiphaseCloud& cloudCopy() const;
203 
204  //- Return the constant properties
205  inline const typename parcelType::constantProperties&
206  constProps() const;
207 
208  //- Return access to the constant properties
209  inline typename parcelType::constantProperties& constProps();
210 
211 
212  // Sub-models
213 
214  //- Return const access to devolatilisation model
215  inline const DevolatilisationModel
216  <
218  >&
219  devolatilisation() const;
220 
221  //- Return reference to devolatilisation model
222  inline DevolatilisationModel
223  <
225  >&
227 
228  //- Return const access to reacting surface reaction model
229  inline const SurfaceReactionModel
230  <
232  >&
233  surfaceReaction() const;
234 
235  //- Return reference to reacting surface reaction model
236  inline SurfaceReactionModel
237  <
239  >&
240  surfaceReaction();
241 
242 
243  // Cloud evolution functions
244 
245  //- Set parcel thermo properties
247  (
248  parcelType& parcel,
249  const scalar lagrangianDt
250  );
251 
252  //- Check parcel properties
254  (
255  parcelType& parcel,
256  const scalar lagrangianDt,
257  const bool fullyDescribed
258  );
259 
260  //- Store the current cloud state
261  void storeState();
262 
263  //- Reset the current cloud to the previously stored state
264  void restoreState();
265 
266  //- Reset the cloud source terms
267  void resetSourceTerms();
268 
269  //- Evolve the cloud
270  void evolve();
271 
272 
273  // Mapping
274 
275  //- Remap the cells of particles corresponding to the
276  // mesh topology change with a default tracking data object
277  virtual void autoMap(const mapPolyMesh&);
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:105
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.
rhoReactionThermo & thermo
Definition: createFields.H:28
const dimensionedScalar & c
Speed of light in a vacuum.
autoPtr< SurfaceReactionModel< ReactingMultiphaseCloud< CloudType > > > surfaceReactionModel_
Surface reaction model.
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.
ReactingMultiphaseCloud(const word &cloudName, const volScalarField &rho, const volVectorField &U, const dimensionedVector &g, const SLGThermo &thermo, bool readFields=true)
Construct given carrier gas fields.
void resetSourceTerms()
Reset the cloud source terms.
Thermo package for (S)olids (L)iquids and (G)ases Takes reference to thermo package, and provides:
Definition: SLGThermo.H:62
void storeState()
Store the current cloud state.
Virtual abstract base class for templated reactingMultiphaseCloud.
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.
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
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:69
const DevolatilisationModel< ReactingMultiphaseCloud< CloudType > > & devolatilisation() const
Return const access to devolatilisation model.
Namespace for OpenFOAM.