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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::ReactingMultiphaseCloud
28
29Group
30 grpLagrangianIntermediateClouds
31
32Description
33 Templated base class for multiphase reacting cloud
34
35 - Adds to reacting cloud
36 - multiphase composition
37 - devolatilisatsion
38 - surface reactions
39
40SourceFiles
41 ReactingMultiphaseCloudI.H
42 ReactingMultiphaseCloud.C
43
44\*---------------------------------------------------------------------------*/
45
46#ifndef ReactingMultiphaseCloud_H
47#define ReactingMultiphaseCloud_H
48
50
51// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52
53namespace Foam
54{
55
56// Forward declaration of classes
57
58template<class CloudType>
59class DevolatilisationModel;
60
61template<class CloudType>
62class SurfaceReactionModel;
63
64/*---------------------------------------------------------------------------*\
65 Class ReactingMultiphaseCloud Declaration
66\*---------------------------------------------------------------------------*/
67
68template<class CloudType>
70:
71 public CloudType,
73{
74public:
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
88private:
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
105protected:
106
107 // Protected data
108
109 //- Parcel constant properties
111
112
113 // References to the cloud sub-models
114
115 //- Devolatilisation model
116 autoPtr
117 <
121
122 //- Surface reaction model
123 autoPtr
124 <
128
129
130 // Check
131
132 //- Total mass transferred to continuous phase via devolatilisation
134
135 //- Total mass transferred to continuous phase via surface
136 // reactions
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
154public:
155
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
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
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
248 <
250 >&
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
313#endif
314
315// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
316
317#endif
318
319// ************************************************************************* //
const uniformDimensionedVectorField & g
ParticleType particleType
Definition: Cloud.H:114
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:75
const word & cloudName() const
Return the cloud type.
Definition: DSMCCloudI.H:37
const fvMesh & mesh() const
Return reference to the mesh.
Definition: DSMCCloudI.H:44
Class to hold DSMC particle constant properties.
Definition: DSMCParcel.H:82
Templated devolatilisation model class.
const word & name() const noexcept
Return the object name.
Definition: IOobjectI.H:65
autoPtr< IOobject > clone() const
Clone.
Definition: IOobject.H:459
Templated base class for multiphase reacting cloud.
const DevolatilisationModel< ReactingMultiphaseCloud< CloudType > > & devolatilisation() const
Return const access to devolatilisation model.
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 setParcelThermoProperties(parcelType &parcel, const scalar lagrangianDt)
Set parcel thermo properties.
void checkParcelProperties(parcelType &parcel, const scalar lagrangianDt, const bool fullyDescribed)
Check parcel properties.
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.
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.
virtual void autoMap(const mapPolyMesh &)
Remap the cells of particles corresponding to the.
virtual autoPtr< Cloud< parcelType > > clone(const word &name)
Construct and return clone based on (this) with new name.
virtual autoPtr< Cloud< parcelType > > cloneBare(const word &name) const
Construct and return bare clone based on (this) with new name.
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 resetSourceTerms()
Reset the cloud source terms.
const SurfaceReactionModel< ReactingMultiphaseCloud< CloudType > > & surfaceReaction() const
Return const access to reacting surface reaction model.
virtual ~ReactingMultiphaseCloud()
Destructor.
Thermo package for (S)olids (L)iquids and (G)ases Takes reference to thermo package,...
Definition: SLGThermo.H:67
Templated surface reaction model class.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:162
Virtual abstract base class for templated reactingMultiphaseCloud.
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
A class for handling words, derived from Foam::string.
Definition: word.H:68
U
Definition: pEqn.H:72
Namespace for OpenFOAM.
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type.