All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
buoyancyEnergy.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) 2015-2021 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::fv::buoyancyEnergy
26 
27 Description
28  Calculates and applies the buoyancy energy source rho*(U&g) to the energy
29  equation.
30 
31 Usage
32  Example usage:
33  \verbatim
34  buoyancyEnergy1
35  {
36  type buoyancyEnergy;
37 
38  U U; // Name of the velocity field
39  }
40  \endverbatim
41 
42 SourceFiles
43  buoyancyEnergy.C
44 
45 \*---------------------------------------------------------------------------*/
46 
47 #ifndef buoyancyEnergy_H
48 #define buoyancyEnergy_H
49 
50 #include "fvModel.H"
52 
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 
55 namespace Foam
56 {
57 namespace fv
58 {
59 
60 /*---------------------------------------------------------------------------*\
61  Class buoyancyEnergy Declaration
62 \*---------------------------------------------------------------------------*/
63 
64 class buoyancyEnergy
65 :
66  public fvModel
67 {
68  // Private Data
69 
70  //- Optional phase name
71  word phaseName_;
72 
73  //- Name of velocity field; default = U.<phase>
74  word UName_;
75 
76 
77  // Private Member Functions
78 
79  //- Non-virtual read
80  void readCoeffs();
81 
82 
83 public:
84 
85  //- Runtime type information
86  TypeName("buoyancyEnergy");
87 
88 
89  // Constructors
90 
91  //- Construct from explicit source name and mesh
93  (
94  const word& name,
95  const word& modelType,
96  const dictionary& dict,
97  const fvMesh& mesh
98  );
99 
100  //- Disallow default bitwise copy construction
101  buoyancyEnergy(const buoyancyEnergy&) = delete;
102 
103 
104  // Member Functions
105 
106  // Checks
107 
108  //- Return the list of fields for which the fvModel adds source term
109  // to the transport equation
110  virtual wordList addSupFields() const;
111 
112 
113  // Evaluate
114 
115  //- Add explicit contribution to compressible energy equation
116  virtual void addSup
117  (
118  const volScalarField& rho,
119  fvMatrix<scalar>& eqn,
120  const word& fieldName
121  ) const;
122 
123  //- Add explicit contribution to phase energy equation
124  virtual void addSup
125  (
126  const volScalarField& alpha,
127  const volScalarField& rho,
128  fvMatrix<scalar>& eqn,
129  const word& fieldName
130  ) const;
131 
132 
133  // IO
134 
135  //- Read source dictionary
136  virtual bool read(const dictionary& dict);
137 
138 
139  // Member Operators
140 
141  //- Disallow default bitwise assignment
142  void operator=(const buoyancyEnergy&) = delete;
143 };
144 
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 } // End namespace fv
149 } // End namespace Foam
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 #endif
154 
155 // ************************************************************************* //
dictionary dict
const word & name() const
Return const access to the source name.
Definition: fvModelI.H:28
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
volScalarField alpha(IOobject("alpha", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
Calculates and applies the buoyancy energy source rho*(U&g) to the energy equation.
Finite volume model abstract base class.
Definition: fvModel.H:55
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvModelI.H:34
TypeName("buoyancyEnergy")
Runtime type information.
A class for handling words, derived from string.
Definition: word.H:59
labelList fv(nPoints)
A special matrix type and solver, designed for finite volume solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise.
Definition: fvPatchField.H:72
buoyancyEnergy(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from explicit source name and mesh.
void operator=(const buoyancyEnergy &)=delete
Disallow default bitwise assignment.
virtual void addSup(const volScalarField &rho, fvMatrix< scalar > &eqn, const word &fieldName) const
Add explicit contribution to compressible energy equation.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
virtual bool read(const dictionary &dict)
Read source dictionary.
virtual wordList addSupFields() const
Return the list of fields for which the fvModel adds source term.
Namespace for OpenFOAM.