constantCoefficientVirtualMass.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::constantCoefficientVirtualMass
26 
27 Description
28  Constant-coefficient virtual mass model
29 
30 Usage
31  Example specification:
32  \verbatim
33  <LagrangianModelName>
34  {
35  type constantCoefficientVirtualMass;
36  Cvm 0.5;
37  }
38  \endverbatim
39 
40 SourceFiles
41  constantCoefficientVirtualMass.C
42 
43 \*---------------------------------------------------------------------------*/
44 
45 #ifndef constantCoefficientVirtualMass_H
46 #define constantCoefficientVirtualMass_H
47 
48 #include "cloudLagrangianModel.H"
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
52 namespace Foam
53 {
54 namespace Lagrangian
55 {
56 
57 /*---------------------------------------------------------------------------*\
58  Class constantCoefficientVirtualMass Declaration
59 \*---------------------------------------------------------------------------*/
60 
62 :
63  public LagrangianModel,
64  private cloudLagrangianModel
65 {
66 private:
67 
68  // Private Data
69 
70  //- The virtual mass coefficient
71  const dimensionedScalar Cvm_;
72 
73 
74  // Private Member Functions
75 
76  //- Calculate the added mass
78  (
79  const LagrangianModelRef& model,
80  const LagrangianSubMesh& subMesh
81  ) const;
82 
83  //- Add a source term to the velocity equation
84  void addUSup
85  (
86  const LagrangianSubScalarField& deltaT,
89  ) const;
90 
91 
92 public:
93 
94  //- Runtime type information
95  TypeName("constantCoefficientVirtualMass");
96 
97 
98  // Public Data
99 
100  //- Added mass
102 
103 
104  // Constructors
105 
106  //- Construct from components
108  (
109  const word& name,
110  const LagrangianMesh& mesh,
111  const dictionary& modelDict,
112  const dictionary& stateDict
113  );
114 
115 
116  // Member Functions
117 
118  //- Return the name of the velocity field
119  virtual wordList addSupFields() const;
120 
121  //- Add a source term to the velocity equation
122  virtual void addSup
123  (
124  const LagrangianSubScalarField& deltaT,
127  ) const;
128 
129  //- Add a source term to the momentum equation
130  virtual void addSup
131  (
132  const LagrangianSubScalarField& deltaT,
133  const LagrangianSubScalarSubField& vOrM,
136  ) const;
137 };
138 
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 } // End namespace Lagrangian
143 } // End namespace Foam
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 #endif
148 
149 // ************************************************************************* //
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.
TypeName("constantCoefficientVirtualMass")
Runtime type information.
constantCoefficientVirtualMass(const word &name, const LagrangianMesh &mesh, const dictionary &modelDict, const dictionary &stateDict)
Construct from components.
virtual void addSup(const LagrangianSubScalarField &deltaT, const LagrangianSubVectorSubField &U, LagrangianEqn< vector > &eqn) const
Add a source term to the velocity equation.
const CloudDerivedField< scalar > & vOrMAdd
Added mass.
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.