Explicit.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::PackingModels::Explicit
26 
27 Description
28  Explicit model for applying an inter-particle stress to the particles.
29 
30  The inter-particle stress is calculated using current particle locations.
31  This force is then applied only to the particles that are moving towards
32  regions of close pack. The resulting velocity change is limited using an
33  abstracted correction velocity limiter.
34 
35  Reference:
36  \verbatim
37  "An Incompressible Three-Dimensional Multiphase Particle-in-Cell Model
38  for Dense Particle Flows"
39  D Snider
40  Journal of Computational Physics
41  Volume 170, Issue 2, Pages 523-549, July 2001
42  \endverbatim
43 
44 SourceFiles
45  Explicit.C
46 
47 \*---------------------------------------------------------------------------*/
48 
49 #ifndef Explicit_H
50 #define Explicit_H
51 
52 #include "PackingModel.H"
53 
54 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55 
56 namespace Foam
57 {
58 namespace PackingModels
59 {
60 
61 /*---------------------------------------------------------------------------*\
62  Class Explicit Declaration
63 \*---------------------------------------------------------------------------*/
64 
65 template<class CloudType>
66 class Explicit
67 :
68  public PackingModel<CloudType>
69 {
70  // Private Data
71 
72  //- Volume fraction average
73  const AveragingMethod<scalar>* volumeAverage_;
74 
75  //- Velocity average
76  const AveragingMethod<vector>* uAverage_;
77 
78  //- Stress average field
79  autoPtr<AveragingMethod<scalar>> stressAverage_;
80 
81  //- Correction limiter
82  autoPtr<CorrectionLimitingMethod> correctionLimiting_;
83 
84 
85 public:
86 
87  //- Runtime type information
88  TypeName("explicit");
89 
90  // Constructors
91 
92  //- Construct from components
94 
95  //- Construct copy
96  Explicit(const Explicit<CloudType>& cm);
97 
98  //- Construct and return a clone
99  virtual autoPtr<PackingModel<CloudType>> clone() const
100  {
102  (
103  new Explicit<CloudType>(*this)
104  );
105  }
106 
107 
108  //- Destructor
109  virtual ~Explicit();
110 
111 
112  // Member Functions
113 
114  //- Calculate the inter particles stresses
115  virtual void cacheFields(const bool store);
116 
117  //- Calculate the velocity correction
118  virtual vector velocityCorrection
119  (
120  typename CloudType::parcelType& p,
121  const scalar deltaT
122  ) const;
123 };
124 
125 
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 
128 } // End namespace PackingModels
129 } // End namespace Foam
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 #ifdef NoRepository
134  #include "Explicit.C"
135 #endif
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 #endif
140 
141 // ************************************************************************* //
const CloudType & owner() const
Return const access to the owner cloud.
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:80
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:225
Base class for packing models.
Definition: PackingModel.H:65
Explicit model for applying an inter-particle stress to the particles.
Definition: Explicit.H:68
TypeName("explicit")
Runtime type information.
virtual ~Explicit()
Destructor.
Definition: Explicit.C:64
virtual void cacheFields(const bool store)
Calculate the inter particles stresses.
Definition: Explicit.C:71
virtual vector velocityCorrection(typename CloudType::parcelType &p, const scalar deltaT) const
Calculate the velocity correction.
Definition: Explicit.C:138
Explicit(const dictionary &dict, CloudType &owner)
Construct from components.
Definition: Explicit.C:32
virtual autoPtr< PackingModel< CloudType > > clone() const
Construct and return a clone.
Definition: Explicit.H:98
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:110
Namespace for OpenFOAM.
volScalarField & p