buoyancyEnergy.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) 2018-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::buoyancyEnergy
29
30Group
31 grpFvOptionsSources
32
33Description
34 Applies buoyancy energy sources (i.e. \c Sb)
35 to the energy equation for compressible flows.
36
37 \f[
38 S_b = \rho (\vec{U} \cdot \vec{g})
39 \f]
40
41 where
42 \vartable
43 S_b | Buoyancy energy source term
44 \rho | Fluid density
45 \vec{U} | Velocity field
46 \vec{g} | Gravitational acceleration field
47 \endvartable
48
49 Sources applied to either of the below, if exist:
50 \verbatim
51 e | Internal energy [m2/s2]
52 h | Enthalphy [m2/s2]
53 \endverbatim
54
55 Required fields:
56 \verbatim
57 U | Velocity [m/s]
58 rho | Fluid density [kg/m3]
59 \endverbatim
60
61Usage
62 Minimal example by using \c constant/fvOptions:
63 \verbatim
64 buoyancyEnergy1
65 {
66 // Mandatory entries (unmodifiable)
67 type buoyancyEnergy;
68 fields (h);
69
70 // Optional entries (runtime modifiable)
71 U U;
72
73 // Mandatory/Optional (inherited) entries
74 ...
75 }
76 \endverbatim
77
78 where the entries mean:
79 \table
80 Property | Description | Type | Reqd | Dflt
81 type | Type name: buoyancyEnergy | word | yes | -
82 fields | Name of operand energy field | word | yes | -
83 U | Name of operand velocity field | word | no | U
84 \endtable
85
86 The inherited entries are elaborated in:
87 - \link fvOption.H \endlink
88
89Note
90 - The entry \c fields accepts only a single field name.
91 - The sources are applied onto the entire computational domain.
92
93See also
94 - Foam::fv::buoyancyForce
95 - Foam::fv::buoyancyTurbSource
96
97SourceFiles
98 buoyancyEnergy.C
99
100\*---------------------------------------------------------------------------*/
101
102#ifndef buoyancyEnergy_H
103#define buoyancyEnergy_H
104
105#include "fvOption.H"
107
108// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
109
110namespace Foam
111{
112namespace fv
113{
114
115/*---------------------------------------------------------------------------*\
116 Class buoyancyEnergy Declaration
117\*---------------------------------------------------------------------------*/
118
119class buoyancyEnergy
120:
121 public fv::option
122{
123 // Private Data
124
125 //- Name of operand velocity field
126 word UName_;
127
128
129public:
130
131 //- Runtime type information
132 TypeName("buoyancyEnergy");
133
134
135 // Constructors
136
137 //- Construct from explicit source name and mesh
139 (
140 const word& sourceName,
141 const word& modelType,
142 const dictionary& dict,
143 const fvMesh& mesh
144 );
145
146 //- No copy construct
147 buoyancyEnergy(const buoyancyEnergy&) = delete;
148
149 //- No copy assignment
150 void operator=(const buoyancyEnergy&) = delete;
151
152
153 //- Destructor
154 virtual ~buoyancyEnergy() = default;
155
156
157 // Member Functions
159 //- Add explicit contribution to compressible momentum equation
160 virtual void addSup
161 (
162 const volScalarField& rho,
163 fvMatrix<scalar>& eqn,
164 const label fieldi
165 );
166
167
168 //- Read source dictionary
169 virtual bool read(const dictionary& dict);
170};
172
173// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174
175} // End namespace fv
176} // End namespace Foam
177
178// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179
180#endif
181
182// ************************************************************************* //
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 energy sources (i.e. Sb) to the energy equation for compressible flows.
virtual void addSup(const volScalarField &rho, fvMatrix< scalar > &eqn, const label fieldi)
Add explicit contribution to compressible momentum equation.
buoyancyEnergy(const buoyancyEnergy &)=delete
No copy construct.
virtual bool read(const dictionary &dict)
Read source dictionary.
virtual ~buoyancyEnergy()=default
Destructor.
TypeName("buoyancyEnergy")
Runtime type information.
void operator=(const buoyancyEnergy &)=delete
No copy assignment.
buoyancyEnergy(const word &sourceName, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from explicit source name and mesh.
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.
labelList fv(nPoints)
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73