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
131 
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:
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
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 // ************************************************************************* //
Foam::SurfaceReactionModel
Templated surface reaction model class.
Definition: ReactingMultiphaseCloud.H:61
Foam::ReactingMultiphaseCloud::cloudReset
void cloudReset(ReactingMultiphaseCloud< CloudType > &c)
Reset state of cloud.
Definition: ReactingMultiphaseCloud.C:61
Foam::ReactingMultiphaseCloud::cloneBare
virtual autoPtr< Cloud< parcelType > > cloneBare(const word &name) const
Construct and return bare clone based on (this) with new name.
Definition: ReactingMultiphaseCloud.H:194
Foam::ReactingMultiphaseCloud::reactingMultiphaseCloudType
ReactingMultiphaseCloud< CloudType > reactingMultiphaseCloudType
Convenience typedef for this cloud type.
Definition: ReactingMultiphaseCloud.H:84
Foam::ReactingMultiphaseCloud::restoreState
void restoreState()
Reset the current cloud to the previously stored state.
Definition: ReactingMultiphaseCloud.C:247
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::SLGThermo
Thermo package for (S)olids (L)iquids and (G)ases Takes reference to thermo package,...
Definition: SLGThermo.H:64
Foam::ReactingMultiphaseCloud::dMassSurfaceReaction_
scalar dMassSurfaceReaction_
Total mass transferred to continuous phase via surface.
Definition: ReactingMultiphaseCloud.H:136
Foam::ReactingMultiphaseCloud::storeState
void storeState()
Store the current cloud state.
Definition: ReactingMultiphaseCloud.C:234
Foam::ReactingMultiphaseCloud::constProps
const parcelType::constantProperties & constProps() const
Return the constant properties.
Definition: ReactingMultiphaseCloudI.H:40
reactingMultiphaseCloud.H
Foam::reactingMultiphaseCloud
Virtual abstract base class for templated reactingMultiphaseCloud.
Definition: reactingMultiphaseCloud.H:50
Foam::ReactingMultiphaseCloud::surfaceReaction
const SurfaceReactionModel< ReactingMultiphaseCloud< CloudType > > & surfaceReaction() const
Return const access to reacting surface reaction model.
thermo
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
Foam::ReactingMultiphaseCloud::dMassDevolatilisation_
scalar dMassDevolatilisation_
Total mass transferred to continuous phase via devolatilisation.
Definition: ReactingMultiphaseCloud.H:132
Foam::ReactingMultiphaseCloud::info
void info()
Print cloud information.
Definition: ReactingMultiphaseCloud.C:286
Foam::ReactingMultiphaseCloud::checkParcelProperties
void checkParcelProperties(parcelType &parcel, const scalar lagrangianDt, const bool fullyDescribed)
Check parcel properties.
Definition: ReactingMultiphaseCloud.C:197
Foam::ReactingMultiphaseCloud::writeFields
virtual void writeFields() const
Write the field data for the cloud.
Definition: ReactingMultiphaseCloud.C:296
rho
rho
Definition: readInitialConditions.H:88
Foam::ReactingMultiphaseCloud::surfaceReactionModel_
autoPtr< SurfaceReactionModel< ReactingMultiphaseCloud< CloudType > > > surfaceReactionModel_
Surface reaction model.
Definition: ReactingMultiphaseCloud.H:126
Foam::ReactingMultiphaseCloud::setModels
void setModels()
Set cloud sub-models.
Definition: ReactingMultiphaseCloud.C:37
Foam::DSMCCloud::cloudName
const word & cloudName() const
Return the cloud type.
Definition: DSMCCloudI.H:37
Foam::DSMCCloud::mesh
const fvMesh & mesh() const
Return reference to the mesh.
Definition: DSMCCloudI.H:44
Foam::DevolatilisationModel
Templated devolatilisation model class.
Definition: ReactingMultiphaseCloud.H:58
Foam::ReactingMultiphaseCloud::cloudType
CloudType cloudType
Type of cloud this cloud was instantiated for.
Definition: ReactingMultiphaseCloud.H:78
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:71
ReactingMultiphaseCloud.C
Foam::ReactingMultiphaseCloud::devolatilisation
const DevolatilisationModel< ReactingMultiphaseCloud< CloudType > > & devolatilisation() const
Return const access to devolatilisation model.
Foam::dimensioned< vector >
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam::Cloud::particleType
ParticleType particleType
Definition: Cloud.H:114
g
const uniformDimensionedVectorField & g
Definition: createFluidFields.H:26
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::ReactingMultiphaseCloud::constProps_
parcelType::constantProperties constProps_
Parcel constant properties.
Definition: ReactingMultiphaseCloud.H:109
Foam::ReactingMultiphaseCloud::~ReactingMultiphaseCloud
virtual ~ReactingMultiphaseCloud()
Destructor.
Definition: ReactingMultiphaseCloud.C:155
Foam::readFields
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type.
Definition: ReadFieldsTemplates.C:312
Foam::ReactingMultiphaseCloud::parcelType
CloudType::particleType parcelType
Type of parcel the cloud was instantiated for.
Definition: ReactingMultiphaseCloud.H:81
Foam::ReactingMultiphaseCloud::clone
virtual autoPtr< Cloud< parcelType > > clone(const word &name)
Construct and return clone based on (this) with new name.
Definition: ReactingMultiphaseCloud.H:185
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
U
U
Definition: pEqn.H:72
Foam::ReactingMultiphaseCloud::setParcelThermoProperties
void setParcelThermoProperties(parcelType &parcel, const scalar lagrangianDt)
Set parcel thermo properties.
Definition: ReactingMultiphaseCloud.C:163
Foam::ReactingMultiphaseCloud::evolve
void evolve()
Evolve the cloud.
Definition: ReactingMultiphaseCloud.C:262
Foam::ReactingMultiphaseCloud::cloudCopy
const ReactingMultiphaseCloud & cloudCopy() const
Return a reference to the cloud copy.
Definition: ReactingMultiphaseCloudI.H:32
Foam::ReactingMultiphaseCloud::resetSourceTerms
void resetSourceTerms()
Reset the cloud source terms.
Definition: ReactingMultiphaseCloud.C:255
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:161
Foam::constant::universal::c
const dimensionedScalar c
Speed of light in a vacuum.
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
Foam::ReactingMultiphaseCloud::autoMap
virtual void autoMap(const mapPolyMesh &)
Remap the cells of particles corresponding to the.
Definition: ReactingMultiphaseCloud.C:275
Foam::ReactingMultiphaseCloud::devolatilisationModel_
autoPtr< DevolatilisationModel< ReactingMultiphaseCloud< CloudType > > > devolatilisationModel_
Devolatilisation model.
Definition: ReactingMultiphaseCloud.H:119
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::ReactingMultiphaseCloud
Templated base class for multiphase reacting cloud.
Definition: ReactingMultiphaseCloud.H:68
ReactingMultiphaseCloudI.H