Loading...
Searching...
No Matches
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
87 typedef MPPICCloud<CloudType> MPPICCloudType;
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
124
125 // Initialisation
126
127 //- Set cloud sub-models
128 void setModels();
130
131public:
132
133 // Constructors
134
135 //- Construct given carrier gas fields
136 MPPICCloud
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
147 MPPICCloud
148 (
149 MPPICCloud<CloudType>& c,
150 const word& name
151 );
152
153 //- Copy constructor with new name - creates bare cloud
154 MPPICCloud
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
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;
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,
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
247
248// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
249
250#ifdef NoRepository
251 #include "MPPICCloud.C"
252#endif
253
254// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
255
256#endif
257
258// ************************************************************************* //
const word & cloudName() const
const fvMesh & mesh() const
particle::trackingData trackingData
Definition DSMCParcel.H:155
Base class for collisional damping models.
autoPtr< IOobject > clone() const
Clone.
Definition IOobject.H:641
Base class for collisional return-to-isotropy models.
const volVectorField & U() const
Return carrier gas velocity.
const volScalarField & rho() const
Return carrier gas density.
const dimensionedVector & g() const
Gravity.
const fvMesh & mesh() const
Return reference to the mesh.
const volScalarField & mu() const
Return carrier gas dynamic viscosity.
const DampingModel< MPPICCloud< CloudType > > & dampingModel() const
Return const access to the damping model.
Definition MPPICCloudI.H:49
const IsotropyModel< MPPICCloud< CloudType > > & isotropyModel() const
Return const access to the isotropy model.
Definition MPPICCloudI.H:65
void setModels()
Set cloud sub-models.
Definition MPPICCloud.C:31
void motion(TrackCloudType &cloud, typename parcelType::trackingData &td)
Particle motion.
Definition MPPICCloud.C:172
void storeState()
Store the current cloud state.
Definition MPPICCloud.C:137
autoPtr< IsotropyModel< MPPICCloud< KinematicCloud< Cloud< basicKinematicMPPICParcel > > > > > isotropyModel_
Definition MPPICCloud.H:135
MPPICCloud< KinematicCloud< Cloud< basicKinematicMPPICParcel > > > MPPICCloudType
Definition MPPICCloud.H:88
virtual ~MPPICCloud()
Destructor.
Definition MPPICCloud.C:130
const MPPICCloud & cloudCopy() const
Return a reference to the cloud copy.
Definition MPPICCloudI.H:25
MPPICCloud(MPPICCloud< CloudType > &c, const word &name)
Copy constructor with new name.
Definition MPPICCloud.C:100
KinematicCloud< Cloud< basicKinematicMPPICParcel > > cloudType
Definition MPPICCloud.H:78
virtual autoPtr< Cloud< parcelType > > clone(const word &name)
Construct and return clone based on (this) with new name.
Definition MPPICCloud.H:185
virtual autoPtr< Cloud< parcelType > > cloneBare(const word &name) const
Construct and return bare clone based on (this) with new name.
Definition MPPICCloud.H:196
PackingModel< MPPICCloud< CloudType > > & packingModel()
Return a reference to the packing model.
Definition MPPICCloudI.H:41
void evolve()
Evolve the cloud.
Definition MPPICCloud.C:158
IsotropyModel< MPPICCloud< CloudType > > & isotropyModel()
Return a reference to the isotropy model.
Definition MPPICCloudI.H:73
autoPtr< PackingModel< MPPICCloud< KinematicCloud< Cloud< basicKinematicMPPICParcel > > > > > packingModel_
Definition MPPICCloud.H:123
void info()
I-O.
Definition MPPICCloud.C:273
void restoreState()
Reset the current cloud to the previously stored state.
Definition MPPICCloud.C:150
MPPICCloud(const word &cloudName, const volScalarField &rho, const volVectorField &U, const volScalarField &mu, const dimensionedVector &g, bool readFields=true)
Construct given carrier gas fields.
Definition MPPICCloud.C:64
DampingModel< MPPICCloud< CloudType > > & dampingModel()
Return a reference to the damping model.
Definition MPPICCloudI.H:57
MPPICCloud(const fvMesh &mesh, const word &name, const MPPICCloud< CloudType > &c)
Copy constructor with new name - creates bare cloud.
Definition MPPICCloud.C:114
KinematicCloud< Cloud< basicKinematicMPPICParcel > >::parcelType parcelType
Definition MPPICCloud.H:83
const PackingModel< MPPICCloud< CloudType > > & packingModel() const
Return const access to the packing model.
Definition MPPICCloudI.H:33
autoPtr< DampingModel< MPPICCloud< KinematicCloud< Cloud< basicKinematicMPPICParcel > > > > > dampingModel_
Definition MPPICCloud.H:129
Base class for packing models.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A cloud is a registry collection of lagrangian particles.
Definition cloud.H:56
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
A class for handling words, derived from Foam::string.
Definition word.H:66
wallPoints::trackData td(isBlockedFace, regionToBlockSize)
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.