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 | Copyright (C) 2013-2016 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::MPPICCloud
26 
27 Description
28  Adds MPPIC modelling to kinematic clouds
29 
30 SourceFiles
31  MPPICCloudI.H
32  MPPICCloud.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef MPPICCloud_H
37 #define MPPICCloud_H
38 
39 #include "particle.H"
40 #include "Cloud.H"
41 #include "IOdictionary.H"
42 #include "autoPtr.H"
43 #include "fvMesh.H"
44 #include "volFields.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 // Forward declaration of classes
52 
53 template<class CloudType>
54 class PackingModel;
55 
56 template<class CloudType>
57 class DampingModel;
58 
59 template<class CloudType>
60 class IsotropyModel;
61 
62 /*---------------------------------------------------------------------------*\
63  Class MPPICCloud Declaration
64 \*---------------------------------------------------------------------------*/
65 
66 template<class CloudType>
67 class MPPICCloud
68 :
69  public CloudType
70 {
71 public:
72 
73  // Public typedefs
74 
75  //- Type of cloud this cloud was instantiated for
76  typedef CloudType cloudType;
77 
78  //- Type of parcel the cloud was instantiated for
79  typedef typename CloudType::parcelType parcelType;
80 
81  //- Convenience typedef for this cloud type
83 
84 
85 private:
86 
87  // Private data
88 
89  //- Cloud copy pointer
90  autoPtr<MPPICCloud<CloudType>> cloudCopyPtr_;
91 
92 
93  // Private Member Functions
94 
95  //- Disallow default bitwise copy construct
96  MPPICCloud(const MPPICCloud&);
97 
98  //- Disallow default bitwise assignment
99  void operator=(const MPPICCloud&);
100 
101 
102 protected:
103 
104  // Protected data
105 
106  // References to the cloud sub-models
107 
108  //- Packing model
110 
111  //- Damping model
114 
115  //- Exchange model
118 
119 
120  // Initialisation
121 
122  //- Set cloud sub-models
123  void setModels();
124 
125 
126 public:
127 
128  // Constructors
129 
130  //- Construct given carrier gas fields
131  MPPICCloud
132  (
133  const word& cloudName,
134  const volScalarField& rho,
135  const volVectorField& U,
136  const volScalarField& mu,
137  const dimensionedVector& g,
138  bool readFields = true
139  );
140 
141  //- Copy constructor with new name
142  MPPICCloud
143  (
145  const word& name
146  );
147 
148  //- Copy constructor with new name - creates bare cloud
149  MPPICCloud
150  (
151  const fvMesh& mesh,
152  const word& name,
153  const MPPICCloud<CloudType>& c
154  );
155 
156  //- Construct and return clone based on (this) with new name
157  virtual autoPtr<Cloud<parcelType>> clone(const word& name)
158  {
160  (
161  new MPPICCloud(*this, name)
162  );
163  }
164 
165  //- Construct and return bare clone based on (this) with new name
166  virtual autoPtr<Cloud<parcelType>> cloneBare(const word& name) const
167  {
169  (
170  new MPPICCloud(this->mesh(), name, *this)
171  );
172  }
173 
174 
175  //- Destructor
176  virtual ~MPPICCloud();
177 
178 
179  // Member Functions
180 
181  // Access
182 
183  //- Return a reference to the cloud copy
184  inline const MPPICCloud& cloudCopy() const;
185 
186  //- Return const access to the packing model
188  packingModel() const;
189 
190  //- Return a reference to the packing model
192 
193  //- Return condt access to the damping model
195  dampingModel() const;
196 
197  //- Return a reference to the damping model
199 
200  //- Return condt access to the isotropy model
202  isotropyModel() const;
203 
204  //- Return a reference to the isotropy model
206 
207 
208  // Cloud evolution functions
209 
210  //- Store the current cloud state
211  void storeState();
212 
213  //- Reset the current cloud to the previously stored state
214  void restoreState();
215 
216  //- Evolve the cloud
217  void evolve();
218 
219  //- Particle motion
220  template<class TrackData>
221  void motion(TrackData& td);
222 
223 
224  //- I-O
225 
226  //- Print cloud information
227  void info();
228 };
229 
230 
231 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
232 
233 } // End namespace Foam
234 
235 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
236 
237 #include "MPPICCloudI.H"
238 
239 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
240 
241 #ifdef NoRepository
242  #include "MPPICCloud.C"
243 #endif
244 
245 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
246 
247 #endif
248 
249 // ************************************************************************* //
virtual ~MPPICCloud()
Destructor.
Definition: MPPICCloud.C:135
autoPtr< IOobject > clone() const
Clone.
Definition: IOobject.H:264
U
Definition: pEqn.H:83
const word & name() const
Return name.
Definition: IOobject.H:291
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const HashSet< word > &selectedFields, LIFOStack< regIOobject *> &storedObjects)
Read the selected GeometricFields of the specified type.
Definition: ReadFields.C:244
const word & cloudName() const
Return the cloud type.
Definition: DSMCCloudI.H:34
virtual autoPtr< Cloud< parcelType > > cloneBare(const word &name) const
Construct and return bare clone based on (this) with new name.
Definition: MPPICCloud.H:165
void storeState()
Store the current cloud state.
Definition: MPPICCloud.C:142
CloudType::parcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: MPPICCloud.H:78
Base class for packing models.
Definition: MPPICCloud.H:53
const IsotropyModel< MPPICCloud< CloudType > > & isotropyModel() const
Return condt access to the isotropy model.
Definition: MPPICCloudI.H:70
autoPtr< DampingModel< MPPICCloud< CloudType > > > dampingModel_
Damping model.
Definition: MPPICCloud.H:112
const MPPICCloud & cloudCopy() const
Return a reference to the cloud copy.
Definition: MPPICCloudI.H:30
void info()
I-O.
Definition: MPPICCloud.C:261
autoPtr< IsotropyModel< MPPICCloud< CloudType > > > isotropyModel_
Exchange model.
Definition: MPPICCloud.H:116
MPPICCloud< CloudType > MPPICCloudType
Convenience typedef for this cloud type.
Definition: MPPICCloud.H:81
A class for handling words, derived from string.
Definition: word.H:59
CloudType cloudType
Type of cloud this cloud was instantiated for.
Definition: MPPICCloud.H:75
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:218
const dimensionedVector & g
Adds MPPIC modelling to kinematic clouds.
Definition: MPPICCloud.H:66
const PackingModel< MPPICCloud< CloudType > > & packingModel() const
Return const access to the packing model.
Definition: MPPICCloudI.H:38
const DampingModel< MPPICCloud< CloudType > > & dampingModel() const
Return condt access to the damping model.
Definition: MPPICCloudI.H:54
const dimensionedScalar mu
Atomic mass unit.
Base class for collisional return-to-isotropy models.
Definition: MPPICCloud.H:59
const fvMesh & mesh() const
Return refernce to the mesh.
Definition: DSMCCloudI.H:41
void setModels()
Set cloud sub-models.
Definition: MPPICCloud.C:36
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
void motion(TrackData &td)
Particle motion.
Definition: MPPICCloud.C:177
const dimensionedScalar c
Speed of light in a vacuum.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
void evolve()
Evolve the cloud.
Definition: MPPICCloud.C:163
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:69
Base class for collisional damping models.
Definition: MPPICCloud.H:56
autoPtr< PackingModel< MPPICCloud< CloudType > > > packingModel_
Packing model.
Definition: MPPICCloud.H:108
void restoreState()
Reset the current cloud to the previously stored state.
Definition: MPPICCloud.C:155
Namespace for OpenFOAM.