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 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::MPPICCloud
28 
29 Group
30  grpLagrangianIntermediateClouds
31 
32 Description
33  Adds MPPIC modelling to kinematic clouds
34 
35 SourceFiles
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 
53 namespace Foam
54 {
55 
56 // Forward declaration of classes
57 
58 template<class CloudType>
59 class PackingModel;
60 
61 template<class CloudType>
62 class DampingModel;
63 
64 template<class CloudType>
65 class IsotropyModel;
66 
67 /*---------------------------------------------------------------------------*\
68  Class MPPICCloud Declaration
69 \*---------------------------------------------------------------------------*/
70 
71 template<class CloudType>
72 class MPPICCloud
73 :
74  public CloudType
75 {
76 public:
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 
90 private:
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 
107 protected:
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 
131 public:
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  (
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
162  virtual autoPtr<Cloud<parcelType>> clone(const word& 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 // ************************************************************************* //
volFields.H
Foam::MPPICCloud::dampingModel
const DampingModel< MPPICCloud< CloudType > > & dampingModel() const
Return const access to the damping model.
Definition: MPPICCloudI.H:56
Foam::MPPICCloud::setModels
void setModels()
Set cloud sub-models.
Definition: MPPICCloud.C:38
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::constant::physicoChemical::mu
const dimensionedScalar mu
Atomic mass unit.
Definition: createFieldRefs.H:4
MPPICCloud.C
Foam::MPPICCloud::storeState
void storeState()
Store the current cloud state.
Definition: MPPICCloud.C:144
Cloud.H
Foam::MPPICCloud::dampingModel_
autoPtr< DampingModel< MPPICCloud< CloudType > > > dampingModel_
Damping model.
Definition: MPPICCloud.H:117
Foam::MPPICCloud::motion
void motion(TrackCloudType &cloud, typename parcelType::trackingData &td)
Particle motion.
Definition: MPPICCloud.C:179
Foam::MPPICCloud::cloudType
CloudType cloudType
Type of cloud this cloud was instantiated for.
Definition: MPPICCloud.H:80
Foam::DampingModel
Base class for collisional damping models.
Definition: KinematicCloud.H:101
Foam::MPPICCloud::packingModel
const PackingModel< MPPICCloud< CloudType > > & packingModel() const
Return const access to the packing model.
Definition: MPPICCloudI.H:40
rho
rho
Definition: readInitialConditions.H:88
Foam::MPPICCloud::evolve
void evolve()
Evolve the cloud.
Definition: MPPICCloud.C:165
Foam::DSMCCloud::cloudName
const word & cloudName() const
Return the cloud type.
Definition: DSMCCloudI.H:37
Foam::DSMCCloud::mesh
const fvMesh & mesh() const
Return reference to the mesh.
Definition: DSMCCloudI.H:44
Foam::MPPICCloud::cloudCopy
const MPPICCloud & cloudCopy() const
Return a reference to the cloud copy.
Definition: MPPICCloudI.H:32
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:71
Foam::MPPICCloud::parcelType
CloudType::parcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: MPPICCloud.H:83
Foam::PackingModel
Base class for packing models.
Definition: KinematicCloud.H:98
Foam::dimensioned< vector >
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
fvMesh.H
g
const uniformDimensionedVectorField & g
Definition: createFluidFields.H:26
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::MPPICCloud::MPPICCloudType
MPPICCloud< CloudType > MPPICCloudType
Convenience typedef for this cloud type.
Definition: MPPICCloud.H:86
Foam::readFields
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type.
Definition: ReadFieldsTemplates.C:312
MPPICCloudI.H
Foam::MPPICCloud::info
void info()
I-O.
Definition: MPPICCloud.C:280
IOdictionary.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::cloud
A cloud is a registry collection of lagrangian particles.
Definition: cloud.H:57
Foam::MPPICCloud::restoreState
void restoreState()
Reset the current cloud to the previously stored state.
Definition: MPPICCloud.C:157
U
U
Definition: pEqn.H:72
Foam::MPPICCloud::packingModel_
autoPtr< PackingModel< MPPICCloud< CloudType > > > packingModel_
Packing model.
Definition: MPPICCloud.H:113
Foam::MPPICCloud::cloneBare
virtual autoPtr< Cloud< parcelType > > cloneBare(const word &name) const
Construct and return bare clone based on (this) with new name.
Definition: MPPICCloud.H:170
Foam::MPPICCloud::isotropyModel
const IsotropyModel< MPPICCloud< CloudType > > & isotropyModel() const
Return const access to the isotropy model.
Definition: MPPICCloudI.H:72
particle.H
Foam::constant::universal::c
const dimensionedScalar c
Speed of light in a vacuum.
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
Foam::MPPICCloud::clone
virtual autoPtr< Cloud< parcelType > > clone(const word &name)
Construct and return clone based on (this) with new name.
Definition: MPPICCloud.H:161
Foam::MPPICCloud::isotropyModel_
autoPtr< IsotropyModel< MPPICCloud< CloudType > > > isotropyModel_
Exchange model.
Definition: MPPICCloud.H:121
Foam::DSMCCloud::parcelType
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:220
Foam::IsotropyModel
Base class for collisional return-to-isotropy models.
Definition: KinematicCloud.H:104
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::MPPICCloud
Adds MPPIC modelling to kinematic clouds.
Definition: MPPICCloud.H:71
Foam::MPPICCloud::~MPPICCloud
virtual ~MPPICCloud()
Destructor.
Definition: MPPICCloud.C:137
autoPtr.H