Implicit.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::PackingModels::Implicit
26 
27 Description
28  Implicit model for applying an inter-particle stress to the particles.
29 
30  The time evolution of particulate volume fraction is solved for implicitly
31  on the eulerian mesh. The computed flux is then applied to the lagrangian
32  field. The gravity force can optionally be applied to the particles as part
33  of this model, using the keyword "applyGravity".
34 
35 SourceFiles
36  Implicit.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef Implicit_H
41 #define Implicit_H
42 
43 #include "PackingModel.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 namespace PackingModels
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class Implicit Declaration
54 \*---------------------------------------------------------------------------*/
55 
56 template<class CloudType>
57 class Implicit
58 :
59  public PackingModel<CloudType>
60 {
61  // Private data
62 
63  //- Volume fraction field
64  volScalarField alpha_;
65 
66  //- Correction flux
67  tmp<surfaceScalarField> phiCorrect_;
68 
69  //- Correction cell-centred velocity
70  tmp<volVectorField> uCorrect_;
71 
72  //- Flag to indicate whether implicit limiting is applied
73  Switch applyLimiting_;
74 
75  //- Flag to indicate whether gravity is applied
76  Switch applyGravity_;
77 
78  //- Minimum stable volume fraction
79  scalar alphaMin_;
80 
81  //- Minimum stable density
82  scalar rhoMin_;
83 
84 
85 public:
86 
87  //- Runtime type information
88  TypeName("implicit");
89 
90  // Constructors
91 
92  //- Construct from components
94 
95  //- Construct copy
96  Implicit(const Implicit<CloudType>& cm);
97 
98  //- Construct and return a clone
99  virtual autoPtr<PackingModel<CloudType>> clone() const
100  {
102  (
103  new Implicit<CloudType>(*this)
104  );
105  }
106 
107 
108  //- Destructor
109  virtual ~Implicit();
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 "Implicit.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
Generic GeometricField class.
Base class for packing models.
Definition: PackingModel.H:65
Implicit model for applying an inter-particle stress to the particles.
Definition: Implicit.H:59
Implicit(const dictionary &dict, CloudType &owner)
Construct from components.
Definition: Implicit.C:40
virtual ~Implicit()
Destructor.
Definition: Implicit.C:101
virtual void cacheFields(const bool store)
Calculate the inter particles stresses.
Definition: Implicit.C:108
virtual vector velocityCorrection(typename CloudType::parcelType &p, const scalar deltaT) const
Calculate the velocity correction.
Definition: Implicit.C:330
virtual autoPtr< PackingModel< CloudType > > clone() const
Construct and return a clone.
Definition: Implicit.H:98
TypeName("implicit")
Runtime type information.
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:61
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
A class for managing temporary objects.
Definition: tmp.H:55
Namespace for OpenFOAM.
volScalarField & p