Loading...
Searching...
No Matches
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>
57
58
59/*---------------------------------------------------------------------------*\
60 Class ReactingHeterogeneousCloud Declaration
61\*---------------------------------------------------------------------------*/
62
63template<class CloudType>
64class ReactingHeterogeneousCloud
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
80 typedef ReactingHeterogeneousCloud<CloudType>
83
84private:
85
86 // Private Data
87
88 //- Cloud copy pointer
90
91
92 // Private Member Functions
93
94 //- No copy construct
95 ReactingHeterogeneousCloud(const ReactingHeterogeneousCloud&) = delete;
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 <
112 ReactingHeterogeneousCloud<CloudType>
113 >
115
116
117 // Protected Member Functions
118
119 // Initialisation
120
121 //- Set cloud sub-models
122 void setModels();
124
125 // Cloud evolution functions
126
127 //- Reset state of cloud
128 void cloudReset(ReactingHeterogeneousCloud<CloudType>& c);
129
130
131public:
132
133 // Constructors
134
135 //- Construct given carrier gas fields
136 ReactingHeterogeneousCloud
137 (
138 const word& cloudName,
139 const volScalarField& rho,
140 const volVectorField& U,
142 const SLGThermo& thermo,
143 bool readFields = true
144 );
145
146 //- Copy constructor with new name
147 ReactingHeterogeneousCloud
148 (
149 ReactingHeterogeneousCloud<CloudType>& c, const word& name
150 );
152 //- Copy constructor with new name - creates bare cloud
153 ReactingHeterogeneousCloud
154 (
155 const fvMesh& mesh,
156 const word& name,
157 const ReactingHeterogeneousCloud<CloudType>& c
158 );
159
160 //- Construct and return clone based on (this) with new name
162 {
165 new ReactingHeterogeneousCloud(*this, name)
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
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
194 // Sub-models
195
196 //- Return reference to model
197 inline const HeterogeneousReactingModel
198 <
199 ReactingHeterogeneousCloud<CloudType>
200 >& heterogeneousReaction() const;
201
202
204 <
205 ReactingHeterogeneousCloud<CloudType>
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
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();
232 //- Evolve the cloud
233 void evolve();
234
235
236 // Mapping
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// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
266
267// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
268
269#ifdef NoRepository
271#endif
272
273// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
275#endif
276
277// ************************************************************************* //
const uniformDimensionedVectorField & g
ParticleType particleType
Definition Cloud.H:130
const word & cloudName() const
const fvMesh & mesh() const
Base class for heterogeneous reacting models.
autoPtr< IOobject > clone() const
Clone.
Definition IOobject.H:641
ReactingHeterogeneousCloud(const word &cloudName, const volScalarField &rho, const volVectorField &U, const dimensionedVector &g, const SLGThermo &thermo, bool readFields=true)
Construct given carrier gas fields.
HeterogeneousReactingModel< ReactingHeterogeneousCloud< CloudType > > & heterogeneousReaction()
void storeState()
Store the current cloud state.
ReactingHeterogeneousCloud(const fvMesh &mesh, const word &name, const ReactingHeterogeneousCloud< CloudType > &c)
Copy constructor with new name - creates bare cloud.
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< ReactingCloud< ThermoCloud< KinematicCloud< Cloud< basicHeterogeneousReactingParcel > > > > > > > heterogeneousReactionModel_
virtual ~ReactingHeterogeneousCloud()=default
Destructor.
const ReactingHeterogeneousCloud & cloudCopy() const
Return a reference to the cloud copy.
ReactingCloud< ThermoCloud< KinematicCloud< Cloud< basicHeterogeneousReactingParcel > > > >::particleType parcelType
virtual void writeFields() const
Write the field data for the cloud.
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.
ReactingHeterogeneousCloud(ReactingHeterogeneousCloud< CloudType > &c, const word &name)
Copy constructor with new name.
void cloudReset(ReactingHeterogeneousCloud< CloudType > &c)
Reset state of cloud.
ReactingHeterogeneousCloud< ReactingCloud< ThermoCloud< KinematicCloud< Cloud< basicHeterogeneousReactingParcel > > > > > reactingHeterogeneousCloudType
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:63
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Registry of regIOobjects.
reactingHeterogeneousCloud()=default
Null constructor.
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:66
U
Definition pEqn.H:72
Namespace for OpenFOAM.
DSMCCloud< dsmcParcel > CloudType
GeometricField< vector, fvPatchField, volMesh > volVectorField
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const NameMatchPredicate &selectedFields, DynamicList< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type and store on the objectRegistry.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.