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-2026 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::Lagrangian::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 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  //- Return true for the velocity field
98  virtual bool addsSupToField
99  (
100  const word& fieldName,
101  const word& eqnFieldName
102  ) const;
103 
104  //- Add a source term to the velocity equation
105  virtual void addSup
106  (
107  const LagrangianSubScalarField& deltaT,
110  ) const;
111 
112  //- Add a source term to the momentum equation
113  virtual void addSup
114  (
115  const LagrangianSubScalarField& deltaT,
116  const LagrangianSubScalarSubField& vOrM,
119  ) const;
120 };
121 
122 
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 
125 } // End namespace Lagrangian
126 } // End namespace Foam
127 
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 
130 #endif
131 
132 // ************************************************************************* //
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.
static word fieldName(const AlphaRhoFieldType &alphaRhoField, const AlphaRhoFieldTypes &... alphaRhoFields)
Return the name of the field associated with a source term.
const word & name() const
The source name.
Gravity force model.
Definition: gravity.H:64
virtual wordList addSupFields() const
Return the name of the velocity field.
Definition: gravity.C:63
virtual bool addsSupToField(const word &fieldName, const word &eqnFieldName) const
Return true for the velocity field.
Definition: gravity.C:70
virtual void addSup(const LagrangianSubScalarField &deltaT, const LagrangianSubVectorSubField &U, LagrangianEqn< vector > &eqn) const
Add a source term to the velocity equation.
Definition: gravity.C:82
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
Mix-in for Lagrangian models that refer to a cloud.
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:63
U
Definition: pEqn.H:72
Namespace for OpenFOAM.