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-2018 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:
69 
70  // Private data
71 
72  //- Velocity average
73  const AveragingMethod<vector>* uAverage_;
74 
75  //- Reciprocal of the time scale average
76  autoPtr<AveragingMethod<scalar>> oneByTimeScaleAverage_;
77 
78 
79 public:
80 
81  //- Runtime type information
82  TypeName("relaxation");
83 
84  // Constructors
85 
86  //- Construct from components
88 
89  //- Construct copy
91 
92  //- Construct and return a clone
93  virtual autoPtr<DampingModel<CloudType>> clone() const
94  {
96  (
97  new Relaxation<CloudType>(*this)
98  );
99  }
100 
101 
102  //- Destructor
103  virtual ~Relaxation();
104 
105 
106  //- Member Functions
107 
108  //- Calculate the damping time scales
109  virtual void cacheFields(const bool store);
110 
111  //- Calculate the velocity correction
112  virtual vector velocityCorrection
113  (
114  typename CloudType::parcelType& p,
115  const scalar deltaT
116  ) const;
117 };
118 
119 
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 
122 } // End namespace DampingModels
123 } // End namespace Foam
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 #ifdef NoRepository
128  #include "Relaxation.C"
129 #endif
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 #endif
134 
135 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
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:218
Relaxation collisional damping model.
Definition: Relaxation.H:63
virtual autoPtr< DampingModel< CloudType > > clone() const
Construct and return a clone.
Definition: Relaxation.H:92
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:69
Base class for collisional damping models.
Definition: MPPICCloud.H:56
Namespace for OpenFOAM.