Relaxation.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-2020 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::DampingModels::Relaxation
26 
27 Description
28  Relaxation collisional damping model.
29 
30  Particle velocities are relaxed towards the local mean over a time-scale.
31 
32  Reference:
33  \verbatim
34  "An improved collision damping time for MP-PIC calculations of dense
35  particle flows with applications to polydisperse sedimenting beds and
36  colliding particle jets"
37  P O'Rourke and D Snider
38  Chemical Engineering Science
39  Volume 65, Issue 22, Pages 6014-6028, November 2010
40  \endverbatim
41 
42 SourceFiles
43  Relaxation.C
44 
45 \*---------------------------------------------------------------------------*/
46 
47 #ifndef Relaxation_H
48 #define Relaxation_H
49 
50 #include "DampingModel.H"
51 
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 
54 namespace Foam
55 {
56 namespace DampingModels
57 {
58 
59 /*---------------------------------------------------------------------------*\
60  Class Relaxation Declaration
61 \*---------------------------------------------------------------------------*/
62 
63 template<class CloudType>
64 class Relaxation
65 :
66  public DampingModel<CloudType>
67 {
68  // Private Data
69 
70  //- Velocity average
71  const AveragingMethod<vector>* uAverage_;
72 
73  //- Reciprocal of the time scale average
74  autoPtr<AveragingMethod<scalar>> oneByTimeScaleAverage_;
75 
76 
77 public:
78 
79  //- Runtime type information
80  TypeName("relaxation");
81 
82  // Constructors
83 
84  //- Construct from components
86 
87  //- Construct copy
89 
90  //- Construct and return a clone
91  virtual autoPtr<DampingModel<CloudType>> clone() const
92  {
94  (
95  new Relaxation<CloudType>(*this)
96  );
97  }
98 
99 
100  //- Destructor
101  virtual ~Relaxation();
102 
103 
104  //- Member Functions
105 
106  //- Calculate the damping time scales
107  virtual void cacheFields(const bool store);
108 
109  //- Calculate the velocity correction
110  virtual vector velocityCorrection
111  (
112  typename CloudType::parcelType& p,
113  const scalar deltaT
114  ) const;
115 };
116 
117 
118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119 
120 } // End namespace DampingModels
121 } // End namespace Foam
122 
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 
125 #ifdef NoRepository
126  #include "Relaxation.C"
127 #endif
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 #endif
132 
133 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
TypeName("relaxation")
Runtime type information.
Relaxation(const dictionary &dict, CloudType &owner)
Construct from components.
Definition: Relaxation.C:32
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:110
const CloudType & owner() const
Return const access to the owner cloud.
virtual void cacheFields(const bool store)
Member Functions.
Definition: Relaxation.C:66
Base class for lagrangian averaging methods.
Definition: MPPICParcel.H:55
virtual vector velocityCorrection(typename CloudType::parcelType &p, const scalar deltaT) const
Calculate the velocity correction.
Definition: Relaxation.C:137
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:221
Relaxation collisional damping model.
Definition: Relaxation.H:63
virtual autoPtr< DampingModel< CloudType > > clone() const
Construct and return a clone.
Definition: Relaxation.H:90
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
volScalarField & p
virtual ~Relaxation()
Destructor.
Definition: Relaxation.C:59
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:75
Base class for collisional damping models.
Definition: MPPICCloud.H:56
Namespace for OpenFOAM.