ReactingMultiphaseCloud.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::ReactingMultiphaseCloud
28 
29 Group
30  grpLagrangianIntermediateClouds
31 
32 Description
33  Templated base class for multiphase reacting cloud
34 
35  - Adds to reacting cloud
36  - multiphase composition
37  - devolatilisatsion
38  - surface reactions
39 
40 SourceFiles
41  ReactingMultiphaseCloudI.H
42  ReactingMultiphaseCloud.C
43 
44 \*---------------------------------------------------------------------------*/
45 
46 #ifndef ReactingMultiphaseCloud_H
47 #define ReactingMultiphaseCloud_H
48 
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  Class ReactingMultiphaseCloud Declaration
66 \*---------------------------------------------------------------------------*/
67 
68 template<class CloudType>
70 :
71  public CloudType,
73 {
74 public:
75 
76  // Public typedefs
77 
78  //- Type of cloud this cloud was instantiated for
79  typedef CloudType cloudType;
80 
81  //- Type of parcel the cloud was instantiated for
82  typedef typename CloudType::particleType parcelType;
83 
84  //- Convenience typedef for this cloud type
86 
87 
88 private:
89 
90  // Private data
91 
92  //- Cloud copy pointer
94 
95 
96  // Private member functions
97 
98  //- No copy construct
100 
101  //- No copy assignment
102  void operator=(const ReactingMultiphaseCloud&) = delete;
103 
104 
105 protected:
106 
107  // Protected data
108 
109  //- Parcel constant properties
110  typename parcelType::constantProperties constProps_;
111 
112 
113  // References to the cloud sub-models
114 
115  //- Devolatilisation model
116  autoPtr
117  <
119  >
121 
122  //- Surface reaction model
123  autoPtr
124  <
126  >
128 
129 
130  // Check
132  //- Total mass transferred to continuous phase via devolatilisation
133  scalar dMassDevolatilisation_;
134 
135  //- Total mass transferred to continuous phase via surface
136  // reactions
137  scalar dMassSurfaceReaction_;
138 
139 
140  // Protected Member Functions
141 
142  // Initialisation
143 
144  //- Set cloud sub-models
145  void setModels();
146 
147 
148  // Cloud evolution functions
149 
150  //- Reset state of cloud
152 
153 
154 public:
156  // Constructors
157 
158  //- Construct given carrier gas fields
160  (
161  const word& cloudName,
162  const volScalarField& rho,
163  const volVectorField& U,
164  const dimensionedVector& g,
165  const SLGThermo& thermo,
166  bool readFields = true
167  );
168 
169 
170  //- Copy constructor with new name
172  (
174  const word& name
175  );
176 
177  //- Copy constructor with new name - creates bare cloud
179  (
180  const fvMesh& mesh,
181  const word& name,
183  );
184 
185  //- Construct and return clone based on (this) with new name
186  virtual autoPtr<Cloud<parcelType>> clone(const word& name)
187  {
189  (
190  new ReactingMultiphaseCloud(*this, name)
191  );
192  }
193 
194  //- Construct and return bare clone based on (this) with new name
195  virtual autoPtr<Cloud<parcelType>> cloneBare(const word& name) const
196  {
198  (
199  new ReactingMultiphaseCloud(this->mesh(), name, *this)
200  );
201  }
202 
203 
204  //- Destructor
205  virtual ~ReactingMultiphaseCloud();
206 
207 
208  // Member Functions
209 
210  // Access
211 
212  //- Return a reference to the cloud copy
213  inline const ReactingMultiphaseCloud& cloudCopy() const;
214 
215  //- Return the constant properties
216  inline const typename parcelType::constantProperties&
217  constProps() const;
218 
219  //- Return access to the constant properties
220  inline typename parcelType::constantProperties& constProps();
221 
222 
223  // Sub-models
224 
225  //- Return const access to devolatilisation model
226  inline const DevolatilisationModel
227  <
229  >&
230  devolatilisation() const;
231 
232  //- Return reference to devolatilisation model
233  inline DevolatilisationModel
234  <
236  >&
238 
239  //- Return const access to reacting surface reaction model
240  inline const SurfaceReactionModel
241  <
243  >&
244  surfaceReaction() const;
245 
246  //- Return reference to reacting surface reaction model
247  inline SurfaceReactionModel
248  <
250  >&
251  surfaceReaction();
252 
253 
254  // Cloud evolution functions
255 
256  //- Set parcel thermo properties
258  (
259  parcelType& parcel,
260  const scalar lagrangianDt
261  );
262 
263  //- Check parcel properties
265  (
266  parcelType& parcel,
267  const scalar lagrangianDt,
268  const bool fullyDescribed
269  );
270 
271  //- Store the current cloud state
272  void storeState();
273 
274  //- Reset the current cloud to the previously stored state
275  void restoreState();
276 
277  //- Reset the cloud source terms
278  void resetSourceTerms();
279 
280  //- Evolve the cloud
281  void evolve();
282 
283 
284  // Mapping
285 
286  //- Remap the cells of particles corresponding to the
287  // mesh topology change with a default tracking data object
288  virtual void autoMap(const mapPolyMesh&);
289 
290 
291  // I-O
292 
293  //- Print cloud information
294  void info();
295 
296  //- Write the field data for the cloud
297  virtual void writeFields() const;
298 };
299 
300 
301 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
302 
303 } // End namespace Foam
304 
305 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
306 
308 
309 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
310 
311 #ifdef NoRepository
312  #include "ReactingMultiphaseCloud.C"
313 #endif
314 
315 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
316 
317 #endif
318 
319 // ************************************************************************* //
ParcelType particleType
Definition: Cloud.H:130
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:570
CloudType::particleType parcelType
Type of parcel the cloud was instantiated for.
void setModels()
Set cloud sub-models.
const word & cloudName() const
Return the cloud type.
Definition: DSMCCloudI.H:30
const word & name() const noexcept
Return the object name.
Definition: IOobjectI.H:150
parcelType::constantProperties constProps_
Parcel constant properties.
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:157
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 Foam::string.
Definition: word.H:63
CloudType cloudType
Type of cloud this cloud was instantiated for.
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:60
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:290
void storeState()
Store the current cloud state.
const uniformDimensionedVectorField & g
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 reference to the mesh.
Definition: DSMCCloudI.H:37
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:79
const dimensionedScalar c
Speed of light in a vacuum.
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.
Templated devolatilisation model class.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject *> &storedObjects)
Read the selected GeometricFields of the templated type.
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:67
const DevolatilisationModel< ReactingMultiphaseCloud< CloudType > > & devolatilisation() const
Return const access to devolatilisation model.
Namespace for OpenFOAM.