MPPICCloud.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) 2013-2017 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::MPPICCloud
28
29Group
30 grpLagrangianIntermediateClouds
31
32Description
33 Adds MPPIC modelling to kinematic clouds
34
35SourceFiles
36 MPPICCloudI.H
37 MPPICCloud.C
38
39\*---------------------------------------------------------------------------*/
40
41#ifndef MPPICCloud_H
42#define MPPICCloud_H
43
44#include "particle.H"
45#include "Cloud.H"
46#include "IOdictionary.H"
47#include "autoPtr.H"
48#include "fvMesh.H"
49#include "volFields.H"
50
51// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52
53namespace Foam
54{
55
56// Forward declaration of classes
57
58template<class CloudType>
59class PackingModel;
60
61template<class CloudType>
62class DampingModel;
63
64template<class CloudType>
65class IsotropyModel;
66
67/*---------------------------------------------------------------------------*\
68 Class MPPICCloud Declaration
69\*---------------------------------------------------------------------------*/
70
71template<class CloudType>
72class MPPICCloud
73:
74 public CloudType
75{
76public:
77
78 // Public typedefs
79
80 //- Type of cloud this cloud was instantiated for
81 typedef CloudType cloudType;
82
83 //- Type of parcel the cloud was instantiated for
84 typedef typename CloudType::parcelType parcelType;
85
86 //- Convenience typedef for this cloud type
88
89
90private:
91
92 // Private data
93
94 //- Cloud copy pointer
95 autoPtr<MPPICCloud<CloudType>> cloudCopyPtr_;
96
97
98 // Private Member Functions
99
100 //- No copy construct
101 MPPICCloud(const MPPICCloud&) = delete;
102
103 //- No copy assignment
104 void operator=(const MPPICCloud&) = delete;
105
106
107protected:
108
109 // Protected data
110
111 // References to the cloud sub-models
112
113 //- Packing model
115
116 //- Damping model
119
120 //- Exchange model
123
124
125 // Initialisation
126
127 //- Set cloud sub-models
128 void setModels();
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 volScalarField& mu,
142 const dimensionedVector& g,
143 bool readFields = true
144 );
145
146 //- Copy constructor with new name
148 (
150 const word& name
151 );
152
153 //- Copy constructor with new name - creates bare cloud
155 (
156 const fvMesh& mesh,
157 const word& name,
158 const MPPICCloud<CloudType>& c
159 );
160
161 //- Construct and return clone based on (this) with new name
163 {
165 (
166 new MPPICCloud(*this, name)
167 );
168 }
169
170 //- Construct and return bare clone based on (this) with new name
171 virtual autoPtr<Cloud<parcelType>> cloneBare(const word& name) const
172 {
174 (
175 new MPPICCloud(this->mesh(), name, *this)
176 );
177 }
178
179
180 //- Destructor
181 virtual ~MPPICCloud();
182
183
184 // Member Functions
185
186 // Access
187
188 //- Return a reference to the cloud copy
189 inline const MPPICCloud& cloudCopy() const;
190
191 //- Return const access to the packing model
193 packingModel() const;
194
195 //- Return a reference to the packing model
197
198 //- Return const access to the damping model
200 dampingModel() const;
201
202 //- Return a reference to the damping model
204
205 //- Return const access to the isotropy model
207 isotropyModel() const;
208
209 //- Return a reference to the isotropy model
211
212
213 // Cloud evolution functions
214
215 //- Store the current cloud state
216 void storeState();
217
218 //- Reset the current cloud to the previously stored state
219 void restoreState();
220
221 //- Evolve the cloud
222 void evolve();
223
224 //- Particle motion
225 template<class TrackCloudType>
226 void motion
227 (
228 TrackCloudType& cloud,
229 typename parcelType::trackingData& td
230 );
231
232
233 //- I-O
234
235 //- Print cloud information
236 void info();
237};
238
239
240// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
241
242} // End namespace Foam
243
244// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
245
246#include "MPPICCloudI.H"
247
248// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
249
250#ifdef NoRepository
251 #include "MPPICCloud.C"
252#endif
253
254// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
255
256#endif
257
258// ************************************************************************* //
const uniformDimensionedVectorField & g
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:75
const word & cloudName() const
Return the cloud type.
Definition: DSMCCloudI.H:37
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:220
const fvMesh & mesh() const
Return reference to the mesh.
Definition: DSMCCloudI.H:44
Base class for collisional damping models.
Definition: DampingModel.H:66
const word & name() const noexcept
Return the object name.
Definition: IOobjectI.H:65
autoPtr< IOobject > clone() const
Clone.
Definition: IOobject.H:459
Base class for collisional return-to-isotropy models.
Definition: IsotropyModel.H:66
Adds MPPIC modelling to kinematic clouds.
Definition: MPPICCloud.H:74
const DampingModel< MPPICCloud< CloudType > > & dampingModel() const
Return const access to the damping model.
Definition: MPPICCloudI.H:56
const IsotropyModel< MPPICCloud< CloudType > > & isotropyModel() const
Return const access to the isotropy model.
Definition: MPPICCloudI.H:72
void setModels()
Set cloud sub-models.
Definition: MPPICCloud.C:38
void motion(TrackCloudType &cloud, typename parcelType::trackingData &td)
Particle motion.
Definition: MPPICCloud.C:179
void storeState()
Store the current cloud state.
Definition: MPPICCloud.C:144
autoPtr< IsotropyModel< MPPICCloud< CloudType > > > isotropyModel_
Exchange model.
Definition: MPPICCloud.H:121
MPPICCloud< CloudType > MPPICCloudType
Convenience typedef for this cloud type.
Definition: MPPICCloud.H:86
virtual ~MPPICCloud()
Destructor.
Definition: MPPICCloud.C:137
const MPPICCloud & cloudCopy() const
Return a reference to the cloud copy.
Definition: MPPICCloudI.H:32
CloudType cloudType
Type of cloud this cloud was instantiated for.
Definition: MPPICCloud.H:80
virtual autoPtr< Cloud< parcelType > > clone(const word &name)
Construct and return clone based on (this) with new name.
Definition: MPPICCloud.H:161
virtual autoPtr< Cloud< parcelType > > cloneBare(const word &name) const
Construct and return bare clone based on (this) with new name.
Definition: MPPICCloud.H:170
void evolve()
Evolve the cloud.
Definition: MPPICCloud.C:165
autoPtr< PackingModel< MPPICCloud< CloudType > > > packingModel_
Packing model.
Definition: MPPICCloud.H:113
void info()
I-O.
Definition: MPPICCloud.C:280
void restoreState()
Reset the current cloud to the previously stored state.
Definition: MPPICCloud.C:157
CloudType::parcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: MPPICCloud.H:83
const PackingModel< MPPICCloud< CloudType > > & packingModel() const
Return const access to the packing model.
Definition: MPPICCloudI.H:40
autoPtr< DampingModel< MPPICCloud< CloudType > > > dampingModel_
Damping model.
Definition: MPPICCloud.H:117
Base class for packing models.
Definition: PackingModel.H:71
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A cloud is a registry collection of lagrangian particles.
Definition: cloud.H:60
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
A class for handling words, derived from Foam::string.
Definition: word.H:68
U
Definition: pEqn.H:72
const volScalarField & mu
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.