gravity.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) 2025 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::gravity
26 
27 Description
28  Gravity force model
29 
30 Usage
31  Example specification:
32  \verbatim
33  <LagrangianModelName>
34  {
35  type gravity;
36  }
37  \endverbatim
38 
39 SourceFiles
40  gravity.C
41 
42 \*---------------------------------------------------------------------------*/
43 
44 #ifndef gravity_H
45 #define gravity_H
46 
47 #include "cloudLagrangianModel.H"
48 #include "dimensionedTypes.H"
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
52 namespace Foam
53 {
54 namespace Lagrangian
55 {
56 
57 /*---------------------------------------------------------------------------*\
58  Class gravity Declaration
59 \*---------------------------------------------------------------------------*/
60 
61 class gravity
62 :
63  public LagrangianModel,
64  private cloudLagrangianModel
65 {
66 private:
67 
68  // Private Member Data
69 
70  //- Gravitational acceleration
71  const dimensionedVector& g;
72 
73 
74 public:
75 
76  //- Runtime type information
77  TypeName("gravity");
78 
79 
80  // Constructors
81 
82  //- Construct from components
83  gravity
84  (
85  const word& name,
86  const LagrangianMesh& mesh,
87  const dictionary& modelDict,
88  const dictionary& stateDict
89  );
90 
91 
92  // Member Functions
93 
94  //- Return the name of the velocity field
95  virtual wordList addSupFields() const;
96 
97  //- Add a source term to the velocity equation
98  virtual void addSup
99  (
100  const LagrangianSubScalarField& deltaT,
103  ) const;
104 
105  //- Add a source term to the momentum equation
106  virtual void addSup
107  (
108  const LagrangianSubScalarField& deltaT,
109  const LagrangianSubScalarSubField& vOrM,
112  ) const;
113 };
114 
115 
116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117 
118 } // End namespace Lagrangian
119 } // End namespace Foam
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 #endif
124 
125 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
This class stores the coefficients of a Lagrangian equation, and facilitates solving that equation an...
Definition: LagrangianEqn.H:56
Class containing Lagrangian geometry and topology.
Base class for Lagrangian models.
const LagrangianMesh & mesh() const
The mesh.
const word & name() const
The source name.
virtual wordList addSupFields() const
Return the name of the velocity field.
Definition: gravity.C:63
virtual void addSup(const LagrangianSubScalarField &deltaT, const LagrangianSubVectorSubField &U, LagrangianEqn< vector > &eqn) const
Add a source term to the velocity equation.
Definition: gravity.C:70
TypeName("gravity")
Runtime type information.
gravity(const word &name, const LagrangianMesh &mesh, const dictionary &modelDict, const dictionary &stateDict)
Construct from components.
Definition: gravity.C:48
Base class for Lagrangian models that refer to a cloud. Not a Lagrangian model in itself....
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
static dictionary stateDict(const word &name, const objectRegistry &db)
Construct and return the state dictionary for reading.
Definition: stateModel.C:137
A class for handling words, derived from string.
Definition: word.H:62
U
Definition: pEqn.H:72
Namespace for OpenFOAM.