MPPICCloud.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2013-2024 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 clouds
29 
30 SourceFiles
31  MPPICCloudI.H
32  MPPICCloud.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef MPPICCloud_H
37 #define MPPICCloud_H
38 
39 #include "volFieldsFwd.H"
40 #include "fvMatricesFwd.H"
41 #include "dimensionedTypes.H"
42 #include "fvMesh.H"
43 #include "fluidThermo.H"
44 #include "Cloud.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 /*---------------------------------------------------------------------------*\
64  Class MPPICCloudName Declaration
65 \*---------------------------------------------------------------------------*/
66 
68 
69 
70 /*---------------------------------------------------------------------------*\
71  Class MPPICCloud Declaration
72 \*---------------------------------------------------------------------------*/
73 
74 template<class CloudType>
75 class MPPICCloud
76 :
77  public CloudType,
78  public MPPICCloudName
79 {
80 public:
81 
82  // Public Typedefs
83 
84  //- Type of cloud this cloud was instantiated for
85  typedef CloudType cloudType;
86 
87  //- Type of parcel the cloud was instantiated for
88  typedef typename CloudType::parcelType parcelType;
89 
90  //- Convenience typedef for this cloud type
92 
93 
94 private:
95 
96  // Private Data
97 
98  //- Cloud copy pointer
99  autoPtr<MPPICCloud<CloudType>> cloudCopyPtr_;
100 
101 
102 protected:
103 
104  // Protected data
105 
106  // References to the cloud sub-models
107 
108  //- Packing model
111 
112  //- Damping model
115 
116  //- Exchange model
119 
120 
121  // Initialisation
122 
123  //- Set cloud sub-models
124  void setModels();
125 
126  //- Reset state of cloud
128 
129 
130 public:
131 
132  // Constructors
133 
134  //- Construct given carrier fields
135  MPPICCloud
136  (
137  const word& cloudName,
138  const volScalarField& rho,
139  const volVectorField& U,
140  const volScalarField& mu,
141  const dimensionedVector& g,
142  const bool readFields = true
143  );
144 
145  //- Construct given carrier fields and thermo
146  MPPICCloud
147  (
148  const word& cloudName,
149  const volScalarField& rho,
150  const volVectorField& U,
151  const dimensionedVector& g,
152  const fluidThermo& carrierThermo,
153  const bool readFields = true
154  );
155 
156  //- Copy constructor with new name
157  MPPICCloud
158  (
160  const word& name
161  );
162 
163  //- Copy constructor with new name - creates bare cloud
164  MPPICCloud
165  (
166  const fvMesh& mesh,
167  const word& name,
168  const MPPICCloud<CloudType>& c
169  );
170 
171  //- Disallow default bitwise copy construction
172  MPPICCloud(const MPPICCloud&) = delete;
173 
174  //- Construct and return clone based on (this) with new name
176  {
178  (
179  new MPPICCloud(*this, name)
180  );
181  }
182 
183  //- Construct and return bare clone based on (this) with new name
185  (
186  const word& name
187  ) const
188  {
190  (
191  new MPPICCloud(this->mesh(), name, *this)
192  );
193  }
194 
195 
196  //- Destructor
197  virtual ~MPPICCloud();
198 
199 
200  // Member Functions
201 
202  // Access
203 
204  //- Return a reference to the cloud copy
205  inline const MPPICCloud& cloudCopy() const;
206 
207  //- Return const access to the packing model
209  packingModel() const;
210 
211  //- Return a reference to the packing model
213 
214  //- Return condt access to the damping model
216  dampingModel() const;
217 
218  //- Return a reference to the damping model
220 
221  //- Return condt access to the isotropy model
223  isotropyModel() const;
224 
225  //- Return a reference to the isotropy model
227 
228 
229  // Cloud evolution functions
230 
231  //- Store the current cloud state
232  void storeState();
233 
234  //- Reset the current cloud to the previously stored state
235  void restoreState();
236 
237  //- Evolve the cloud
238  void evolve();
239 
240  //- Particle motion
241  template<class TrackCloudType>
242  void motion
243  (
244  TrackCloudType& cloud,
245  typename parcelType::trackingData& td
246  );
247 
248 
249  //- I-O
250 
251  //- Print cloud information
252  void info();
253 
254 
255  // Member Operators
256 
257  //- Disallow default bitwise assignment
258  void operator=(const MPPICCloud&) = delete;
259 };
260 
261 
262 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
263 
264 } // End namespace Foam
265 
266 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
267 
268 #include "MPPICCloudI.H"
269 
270 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
271 
272 #ifdef NoRepository
273  #include "MPPICCloud.C"
274 #endif
275 
276 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
277 
278 #endif
279 
280 // ************************************************************************* //
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:80
const word & cloudName() const
Return the cloud type.
Definition: DSMCCloudI.H:34
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:225
const fvMesh & mesh() const
Return references to the mesh.
Definition: DSMCCloudI.H:41
Base class for collisional damping models.
Definition: DampingModel.H:60
Generic GeometricField class.
autoPtr< IOobject > clone() const
Clone.
Definition: IOobject.H:280
const word & name() const
Return name.
Definition: IOobject.H:307
Base class for collisional return-to-isotropy models.
Definition: IsotropyModel.H:60
Adds MPPIC modelling to clouds.
Definition: MPPICCloud.H:78
const DampingModel< MPPICCloud< CloudType > > & dampingModel() const
Return condt access to the damping model.
Definition: MPPICCloudI.H:54
const IsotropyModel< MPPICCloud< CloudType > > & isotropyModel() const
Return condt access to the isotropy model.
Definition: MPPICCloudI.H:70
void setModels()
Set cloud sub-models.
Definition: MPPICCloud.C:36
void motion(TrackCloudType &cloud, typename parcelType::trackingData &td)
Particle motion.
Definition: MPPICCloud.C:201
void storeState()
Store the current cloud state.
Definition: MPPICCloud.C:165
autoPtr< IsotropyModel< MPPICCloud< CloudType > > > isotropyModel_
Exchange model.
Definition: MPPICCloud.H:117
MPPICCloud< CloudType > MPPICCloudType
Convenience typedef for this cloud type.
Definition: MPPICCloud.H:90
virtual ~MPPICCloud()
Destructor.
Definition: MPPICCloud.C:158
void operator=(const MPPICCloud &)=delete
Disallow default bitwise assignment.
const MPPICCloud & cloudCopy() const
Return a reference to the cloud copy.
Definition: MPPICCloudI.H:30
CloudType cloudType
Type of cloud this cloud was instantiated for.
Definition: MPPICCloud.H:84
void evolve()
Evolve the cloud.
Definition: MPPICCloud.C:187
autoPtr< PackingModel< MPPICCloud< CloudType > > > packingModel_
Packing model.
Definition: MPPICCloud.H:109
void info()
I-O.
Definition: MPPICCloud.C:308
void restoreState()
Reset the current cloud to the previously stored state.
Definition: MPPICCloud.C:178
void cloudReset(MPPICCloud< CloudType > &c)
Reset state of cloud.
Definition: MPPICCloud.C:66
MPPICCloud(const word &cloudName, const volScalarField &rho, const volVectorField &U, const volScalarField &mu, const dimensionedVector &g, const bool readFields=true)
Construct given carrier fields.
Definition: MPPICCloud.C:80
CloudType::parcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: MPPICCloud.H:87
const PackingModel< MPPICCloud< CloudType > > & packingModel() const
Return const access to the packing model.
Definition: MPPICCloudI.H:38
virtual autoPtr< lagrangian::Cloud< parcelType > > cloneBare(const word &name) const
Construct and return bare clone based on (this) with new name.
Definition: MPPICCloud.H:184
autoPtr< DampingModel< MPPICCloud< CloudType > > > dampingModel_
Damping model.
Definition: MPPICCloud.H:113
Base class for packing models.
Definition: PackingModel.H:65
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
Base class for clouds. Provides a basic evolution algorithm, models, and a database for caching deriv...
Definition: cloud.H:63
Base-class for fluid thermodynamic properties.
Definition: fluidThermo.H:56
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:96
A class for handling words, derived from string.
Definition: word.H:62
Forward declarations of fvMatrix specialisations.
U
Definition: pEqn.H:72
const dimensionedScalar mu
Atomic mass unit.
const dimensionedScalar c
Speed of light in a vacuum.
Namespace for OpenFOAM.
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
TemplateName(FvFaceCellWave)