ReactingHeterogeneousCloud.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) 2018-2019 OpenCFD Ltd.
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::ReactingHeterogeneousCloud
28
29Group
30 grpLagrangianIntermediateClouds
31
32Description
33 Templated base class for reacting heterogeneous cloud
34
35 - Adds to reacting cloud:
36 - Heterogeneous reaction model
37
38SourceFiles
39 ReactingHeterogeneousCloudI.H
40 ReactingHeterogeneousCloud.C
41
42\*---------------------------------------------------------------------------*/
43
44#ifndef ReactingHeterogeneousCloud_H
45#define ReactingHeterogeneousCloud_H
46
48
49// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50
51namespace Foam
52{
53
54// Forward declaration of classes
55template<class CloudType>
56class HeterogeneousReactingModel;
57
58
59/*---------------------------------------------------------------------------*\
60 Class ReactingHeterogeneousCloud Declaration
61\*---------------------------------------------------------------------------*/
62
63template<class CloudType>
65:
66 public CloudType,
68{
69public:
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
82
83
84private:
85
86 // Private Data
87
88 //- Cloud copy pointer
90
91
92 // Private Member Functions
93
94 //- No copy construct
96
97 //- No copy assignment
98 void operator=(const ReactingHeterogeneousCloud&) = delete;
99
100
101protected:
102
103 // Protected Data
104
105 // References to the cloud sub-models
106
107 //- Heterogeneous reaction model
108 autoPtr
109 <
111 <
115
116
117 // Protected Member Functions
118
119 // Initialisation
120
121 //- Set cloud sub-models
122 void setModels();
123
124
125 // Cloud evolution functions
126
127 //- Reset state of cloud
129
130
131public:
132
133 // Constructors
134
135 //- Construct given carrier gas fields
137 (
138 const word& cloudName,
139 const volScalarField& rho,
140 const volVectorField& U,
141 const dimensionedVector& g,
142 const SLGThermo& thermo,
143 bool readFields = true
144 );
145
146 //- Copy constructor with new name
148 (
150 );
151
152 //- Copy constructor with new name - creates bare cloud
154 (
155 const fvMesh& mesh,
156 const word& name,
158 );
159
160 //- Construct and return clone based on (this) with new name
162 {
164 (
166 );
167 }
168
169 //- Construct and return bare clone based on (this) with new name
170 virtual autoPtr<Cloud<parcelType>> cloneBare(const word& name) const
171 {
173 (
174 new ReactingHeterogeneousCloud(this->mesh(), name, *this)
175 );
176 }
177
178
179 //- Destructor
180 virtual ~ReactingHeterogeneousCloud() = default;
181
182
183 // Member Functions
184
185 // Access
186
187 //- Return a reference to the cloud copy
188 inline const ReactingHeterogeneousCloud& cloudCopy() const;
189
190 //- Return progress variable dimension
191 inline label nF() const;
192
193
194 // Sub-models
195
196 //- Return reference to model
197 inline const HeterogeneousReactingModel
198 <
200 >& heterogeneousReaction() const;
201
202
204 <
207
208
209 // Cloud evolution functions
210
211 //- Set parcel thermo properties
213 (
214 parcelType& parcel,
215 const scalar lagrangianDt
216 );
217
218 //- Check parcel properties
220 (
221 parcelType& parcel,
222 const scalar lagrangianDt,
223 const bool fullyDescribed
224 );
225
226 //- Store the current cloud state
227 void storeState();
228
229 //- Reset the current cloud to the previously stored state
230 void restoreState();
231
232 //- Evolve the cloud
233 void evolve();
234
235
236 // Mapping
237
238 //- Remap the cells of particles corresponding to the
239 // mesh topology change with a default tracking data object
240 virtual void autoMap(const mapPolyMesh&);
241
242
243 // I-O
244
245 //- Print cloud information
246 void info();
247
248 //- Read particle fields as objects from the obr registry
249 virtual void readObjects(const objectRegistry& obr);
250
251 //- Write the field data for the cloud
252 virtual void writeFields() const;
253
254 //- Write particle fields as objects into the obr registry
255 virtual void writeObjects(objectRegistry& obr) const;
256};
257
258
259// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
260
261} // End namespace Foam
262
263// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
264
266
267// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
268
269#ifdef NoRepository
271#endif
272
273// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
274
275#endif
276
277// ************************************************************************* //
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
Base class for heterogeneous reacting models.
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 reacting heterogeneous cloud.
void storeState()
Store the current cloud state.
void setParcelThermoProperties(parcelType &parcel, const scalar lagrangianDt)
Set parcel thermo properties.
virtual void readObjects(const objectRegistry &obr)
Read particle fields as objects from the obr registry.
label nF() const
Return progress variable dimension.
void checkParcelProperties(parcelType &parcel, const scalar lagrangianDt, const bool fullyDescribed)
Check parcel properties.
autoPtr< HeterogeneousReactingModel< ReactingHeterogeneousCloud< CloudType > > > heterogeneousReactionModel_
Heterogeneous reaction model.
virtual ~ReactingHeterogeneousCloud()=default
Destructor.
const ReactingHeterogeneousCloud & cloudCopy() const
Return a reference to the cloud copy.
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.
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.
void cloudReset(ReactingHeterogeneousCloud< CloudType > &c)
Reset state of cloud.
ReactingHeterogeneousCloud< CloudType > reactingHeterogeneousCloudType
Convenience typedef for this cloud type.
void info()
Print cloud information.
void restoreState()
Reset the current cloud to the previously stored state.
const HeterogeneousReactingModel< ReactingHeterogeneousCloud< CloudType > > & heterogeneousReaction() const
Return reference to model.
virtual void writeObjects(objectRegistry &obr) const
Write particle fields as objects into the obr registry.
Thermo package for (S)olids (L)iquids and (G)ases Takes reference to thermo package,...
Definition: SLGThermo.H:67
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
Registry of regIOobjects.
Virtual abstract base class for templated ReactingCloud.
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.