GravityForce.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) 2011-2017 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::GravityForce
28 
29 Group
30  grpLagrangianIntermediateForceSubModels
31 
32 Description
33  Calculates particle gravity force
34 
35 SourceFiles
36  GravityForceI.H
37  GravityForce.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef Foam_GravityForce_H
42 #define Foam_GravityForce_H
43 
44 #include "ParticleForce.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 // Forward Declarations
52 class fvMesh;
53 
54 /*---------------------------------------------------------------------------*\
55  Class GravityForce Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 template<class CloudType>
59 class GravityForce
60 :
61  public ParticleForce<CloudType>
62 {
63  // Private Data
64 
65  //- Reference to the acceleration due to gravity
66  const vector& g_;
67 
68 
69 public:
70 
71  //- Runtime type information
72  TypeName("gravity");
73 
74 
75  // Constructors
76 
77  //- Construct from mesh
79  (
81  const fvMesh& mesh,
82  const dictionary& dict
83  );
84 
85  //- Construct copy
86  GravityForce(const GravityForce& gf);
87 
88  //- Construct and return a clone
90  {
92  (
93  new GravityForce<CloudType>(*this)
94  );
95  }
96 
97 
98  //- Destructor
99  virtual ~GravityForce();
100 
101 
102  // Member Functions
103 
104  // Access
105 
106  //- Return the acceleration due to gravity
107  const vector& g() const noexcept { return g_; }
108 
109 
110  // Evaluation
111 
112  //- Calculate the non-coupled force
113  virtual forceSuSp calcNonCoupled
114  (
115  const typename CloudType::parcelType& p,
116  const typename CloudType::parcelType::trackingData& td,
117  const scalar dt,
118  const scalar mass,
119  const scalar Re,
120  const scalar muc
121  ) const;
122 };
123 
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 } // End namespace Foam
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 #ifdef NoRepository
132  #include "GravityForce.C"
133 #endif
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 #endif
138 
139 // ************************************************************************* //
dictionary dict
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
virtual forceSuSp calcNonCoupled(const typename CloudType::parcelType &p, const typename CloudType::parcelType::trackingData &td, const scalar dt, const scalar mass, const scalar Re, const scalar muc) const
Calculate the non-coupled force.
Definition: GravityForce.C:57
Abstract base class for particle forces.
Definition: ParticleForce.H:54
GravityForce(CloudType &owner, const fvMesh &mesh, const dictionary &dict)
Construct from mesh.
Definition: GravityForce.C:27
virtual ~GravityForce()
Destructor.
Definition: GravityForce.C:49
TypeName("gravity")
Runtime type information.
const fvMesh & mesh() const noexcept
Return the mesh database.
Calculates particle gravity force.
Definition: GravityForce.H:54
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:290
const direction noexcept
Definition: Scalar.H:258
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
scalarField Re(const UList< complex > &cmplx)
Extract real component.
Definition: complexField.C:207
const CloudType & owner() const noexcept
Return const access to the cloud owner.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
virtual autoPtr< ParticleForce< CloudType > > clone() const
Construct and return a clone.
Definition: GravityForce.H:94
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
volScalarField & p
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:67
const vector & g() const noexcept
Return the acceleration due to gravity.
Definition: GravityForce.H:116
Namespace for OpenFOAM.