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