buoyancyForce.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) 2015-2017 OpenFOAM Foundation
9 Copyright (C) 2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::fv::buoyancyForce
29
30Group
31 grpFvOptionsSources
32
33Description
34 Applies buoyancy force sources (i.e. \c Sf) to the momentum
35 equation for incompressible and compressible flows.
36
37 \f[
38 S_f = \rho \vec{g}
39 \f]
40
41 where
42 \vartable
43 S_f | Buoyancy force source term
44 \rho | Fluid density
45 \vec{g} | Gravitational acceleration field
46 \endvartable
47
48 Sources applied to:
49 \verbatim
50 U | Velocity [m/s]
51 \endverbatim
52
53 Required fields:
54 \verbatim
55 U | Velocity [m/s]
56 \endverbatim
57
58Usage
59 Minimal example by using \c constant/fvOptions:
60 \verbatim
61 buoyancyForce1
62 {
63 // Mandatory entries (unmodifiable)
64 type buoyancyForce;
65 fields (U);
66
67 // Mandatory/Optional (inherited) entries
68 ...
69 }
70 \endverbatim
71
72 where the entries mean:
73 \table
74 Property | Description | Type | Reqd | Dflt
75 type | Type name: buoyancyEnergy | word | yes | -
76 fields | Name of operand vector field | word | yes | -
77 \endtable
78
79 The inherited entries are elaborated in:
80 - \link fvOption.H \endlink
81
82Note
83 - The entry \c fields accepts only a single vector field name.
84
85See also
86 - Foam::fv::buoyancyEnergy
87 - Foam::fv::buoyancyTurbSource
88
89SourceFiles
90 buoyancyForce.C
91
92\*---------------------------------------------------------------------------*/
93
94#ifndef buoyancyForce_H
95#define buoyancyForce_H
96
97#include "fvOption.H"
99
100// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
101
102namespace Foam
103{
104namespace fv
105{
106
107/*---------------------------------------------------------------------------*\
108 Class buoyancyForce Declaration
109\*---------------------------------------------------------------------------*/
110
111class buoyancyForce
112:
113 public fv::option
114{
115 // Private Data
116
118
119
120public:
121
122 //- Runtime type information
123 TypeName("buoyancyForce");
124
125
126 // Constructors
127
128 //- Construct from explicit source name and mesh
130 (
131 const word& sourceName,
132 const word& modelType,
133 const dictionary& dict,
134 const fvMesh& mesh
135 );
136
137 //- No copy construct
138 buoyancyForce(const buoyancyForce&) = delete;
139
140 //- No copy assignment
141 void operator=(const buoyancyForce&) = delete;
142
143
144 //- Destructor
145 virtual ~buoyancyForce() = default;
146
147
148 // Member Functions
149
150 //- Add explicit contribution to momentum equation
151 virtual void addSup
153 fvMatrix<vector>& eqn,
154 const label fieldi
155 );
156
157 //- Add explicit contribution to compressible momentum equation
158 virtual void addSup
159 (
160 const volScalarField& rho,
161 fvMatrix<vector>& eqn,
162 const label fieldi
163 );
164
165
166 //- Read source dictionary
167 virtual bool read(const dictionary& dict);
168};
169
171// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172
173} // End namespace fv
174} // End namespace Foam
175
176// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177
178#endif
179
180// ************************************************************************* //
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvMatrix.H:121
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Applies buoyancy force sources (i.e. Sf) to the momentum equation for incompressible and compressible...
buoyancyForce(const word &sourceName, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from explicit source name and mesh.
Definition: buoyancyForce.C:49
virtual ~buoyancyForce()=default
Destructor.
virtual bool read(const dictionary &dict)
Read source dictionary.
Definition: buoyancyForce.C:94
buoyancyForce(const buoyancyForce &)=delete
No copy construct.
TypeName("buoyancyForce")
Runtime type information.
void operator=(const buoyancyForce &)=delete
No copy assignment.
virtual void addSup(fvMatrix< vector > &eqn, const label fieldi)
Add explicit contribution to momentum equation.
Definition: buoyancyForce.C:74
Base abstract class for handling finite volume options (i.e. fvOption).
Definition: fvOption.H:127
const fvMesh & mesh() const noexcept
Return const access to the mesh database.
Definition: fvOptionI.H:37
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
UniformDimensionedField< vector > uniformDimensionedVectorField
labelList fv(nPoints)
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73