Implicit.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::PackingModels::Implicit
28 
29 Group
30  grpLagrangianIntermediateMPPICPackingSubModels
31 
32 Description
33  Implicit model for applying an inter-particle stress to the particles.
34 
35  The time evolution of particulate volume fraction is solved for implicitly
36  on the eulerian mesh. The computed flux is then applied to the lagrangian
37  field. The gravity force can optionally be applied to the particles as part
38  of this model, using the keyword "applyGravity".
39 
40 SourceFiles
41  Implicit.C
42 
43 \*---------------------------------------------------------------------------*/
44 
45 #ifndef Implicit_H
46 #define Implicit_H
47 
48 #include "PackingModel.H"
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
52 namespace Foam
53 {
54 namespace PackingModels
55 {
56 
57 /*---------------------------------------------------------------------------*\
58  Class Implicit Declaration
59 \*---------------------------------------------------------------------------*/
60 
61 template<class CloudType>
62 class Implicit
63 :
64  public PackingModel<CloudType>
65 {
66  //- Private data
67 
68  //- Volume fraction field
69  volScalarField alpha_;
70 
71  //- Correction flux
72  tmp<surfaceScalarField> phiCorrect_;
73 
74  //- Correction cell-centred velocity
75  tmp<volVectorField> uCorrect_;
76 
77  //- Flag to indicate whether implicit limiting is applied
78  Switch applyLimiting_;
79 
80  //- Flag to indicate whether gravity is applied
81  Switch applyGravity_;
82 
83  //- Minimum stable volume fraction
84  scalar alphaMin_;
85 
86  //- Minimum stable density
87  scalar rhoMin_;
88 
89 
90 public:
91 
92  //- Runtime type information
93  TypeName("implicit");
94 
95  // Constructors
96 
97  //- Construct from components
99 
100  //- Construct copy
101  Implicit(const Implicit<CloudType>& cm);
102 
103  //- Construct and return a clone
104  virtual autoPtr<PackingModel<CloudType>> clone() const
105  {
107  (
108  new Implicit<CloudType>(*this)
109  );
110  }
111 
112 
113  //- Destructor
114  virtual ~Implicit();
115 
116 
117  // Member Functions
118 
119  //- Calculate the inter particles stresses
120  virtual void cacheFields(const bool store);
121 
122  //- Calculate the velocity correction
124  (
125  typename CloudType::parcelType& p,
126  const scalar deltaT
127  ) const;
128 };
129 
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 } // End namespace PackingModels
134 } // End namespace Foam
135 
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 
138 #ifdef NoRepository
139  #include "Implicit.C"
140 #endif
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 #endif
145 
146 // ************************************************************************* //
Implicit model for applying an inter-particle stress to the particles.
Definition: Implicit.H:57
virtual void cacheFields(const bool store)
Calculate the inter particles stresses.
Definition: Implicit.C:95
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
Base class for packing models.
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, any/none. Also accepts 0/1 as a string and shortcuts t/f, y/n.
Definition: Switch.H:77
virtual ~Implicit()
Destructor.
Definition: Implicit.C:88
TypeName("implicit")
Runtime type information.
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:104
const CloudType & owner() const
Return const access to the owner cloud.
Implicit(const dictionary &dict, CloudType &owner)
Construct from components.
Definition: Implicit.C:34
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:290
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
virtual autoPtr< PackingModel< CloudType > > clone() const
Construct and return a clone.
Definition: Implicit.H:123
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
virtual vector velocityCorrection(typename CloudType::parcelType &p, const scalar deltaT) const
Calculate the velocity correction.
Definition: Implicit.C:327
volScalarField & p
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:67
Namespace for OpenFOAM.