drag.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::drag
26 
27 Description
28  Base class for Lagrangian drag models
29 
30 SourceFiles
31  drag.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef drag_H
36 #define drag_H
37 
38 #include "cloudLagrangianModel.H"
39 #include "CloudDerivedField.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 namespace Lagrangian
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class drag Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 class drag
53 :
54  public LagrangianModel,
55  protected cloudLagrangianModel
56 {
57 private:
58 
59  // Private Member Functions
60 
61  //- Calculate the drag coefficient
62  virtual tmp<LagrangianSubScalarField> calcD
63  (
64  const LagrangianModelRef& model,
65  const LagrangianSubMesh& subMesh
66  ) const = 0;
67 
68  //- Add a source term to the velocity equation
69  void addUSup
70  (
73  ) const;
74 
75 
76 public:
77 
78  //- Runtime type information
79  TypeName("drag");
80 
81 
82  // Public Data
83 
84  //- Drag coefficient
86 
87 
88  // Constructors
89 
90  //- Construct from components
91  drag
92  (
93  const word& name,
94  const LagrangianMesh& mesh,
95  const dictionary& modelDict,
96  const dictionary& stateDict
97  );
98 
99 
100  // Member Functions
101 
102  //- Return the name of the velocity field
103  virtual wordList addSupFields() const;
104 
105  //- Add a source term to the velocity equation
106  virtual void addSup
107  (
108  const LagrangianSubScalarField& deltaT,
111  ) const;
112 
113  //- Add a source term to the momentum equation
114  virtual void addSup
115  (
116  const LagrangianSubScalarField& deltaT,
117  const LagrangianSubScalarSubField& vOrM,
120  ) const;
121 };
122 
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
126 } // End namespace Lagrangian
127 } // End namespace Foam
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 #endif
132 
133 // ************************************************************************* //
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.
Simple wrapper to provide an optional reference to a Lagrangian model.
Base class for Lagrangian models.
const LagrangianMesh & mesh() const
The mesh.
const word & name() const
The source name.
Mesh that relates to a sub-section of a Lagrangian mesh. This is used to construct fields that relate...
virtual wordList addSupFields() const
Return the name of the velocity field.
Definition: drag.C:98
drag(const word &name, const LagrangianMesh &mesh, const dictionary &modelDict, const dictionary &stateDict)
Construct from components.
Definition: drag.C:76
virtual void addSup(const LagrangianSubScalarField &deltaT, const LagrangianSubVectorSubField &U, LagrangianEqn< vector > &eqn) const
Add a source term to the velocity equation.
Definition: drag.C:105
TypeName("drag")
Runtime type information.
const CloudDerivedField< scalar > & D
Drag coefficient.
Definition: drag.H:84
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 managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:62
U
Definition: pEqn.H:72
Namespace for OpenFOAM.