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-2024 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 fvMesh& mesh,
97  const dictionary& dict
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  const volScalarField& he,
120  fvMatrix<scalar>& eqn
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  const volScalarField& he,
129  fvMatrix<scalar>& eqn
130  ) const;
131 
132 
133  // Mesh changes
134 
135  //- Update for mesh motion
136  virtual bool movePoints();
137 
138  //- Update topology using the given map
139  virtual void topoChange(const polyTopoChangeMap&);
140 
141  //- Update from another mesh using the given map
142  virtual void mapMesh(const polyMeshMap&);
143 
144  //- Redistribute or update using the given distribution map
145  virtual void distribute(const polyDistributionMap&);
146 
147 
148  // IO
149 
150  //- Read source dictionary
151  virtual bool read(const dictionary& dict);
152 
153 
154  // Member Operators
155 
156  //- Disallow default bitwise assignment
157  void operator=(const buoyancyEnergy&) = delete;
158 };
159 
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 } // End namespace fv
164 } // End namespace Foam
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 #endif
169 
170 // ************************************************************************* //
Generic GeometricField class.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvMatrix.H:118
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:99
Finite volume model abstract base class.
Definition: fvModel.H:59
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvModelI.H:53
const word & name() const
Return const access to the source name.
Definition: fvModelI.H:47
Calculates and applies the buoyancy energy source rho*(U&g) to the energy equation.
virtual bool movePoints()
Update for mesh motion.
virtual wordList addSupFields() const
Return the list of fields for which the fvModel adds source term.
buoyancyEnergy(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from explicit source name and mesh.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
virtual bool read(const dictionary &dict)
Read source dictionary.
virtual void addSup(const volScalarField &rho, const volScalarField &he, fvMatrix< scalar > &eqn) const
Add explicit contribution to compressible energy equation.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
TypeName("buoyancyEnergy")
Runtime type information.
void operator=(const buoyancyEnergy &)=delete
Disallow default bitwise assignment.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Definition: polyMeshMap.H:51
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
A class for handling words, derived from string.
Definition: word.H:62
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
Namespace for OpenFOAM.
thermo he()
labelList fv(nPoints)
dictionary dict