buoyancyTurbSource.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) 2020 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::fv::buoyancyTurbSource
28 
29 Group
30  grpFvOptionsSources
31 
32 Description
33  Applies sources on turbulent kinetic energy (i.e. \c k)
34  and either turbulent kinetic energy dissipation rate (i.e. \c epsilon)
35  or specific dissipation rate (i.e. \c omega) to incorporate effects
36  of buoyancy on turbulence in incompressible and compressible flows.
37 
38  For incompressible cases:
39 
40  Sources applied to:
41  \verbatim
42  k | Turbulent kinetic energy [m2/s2]
43  \endverbatim
44 
45  Sources applied to either of the below, if exist:
46  \verbatim
47  epsilon | Turbulent kinetic energy dissipation rate [m2/s3]
48  omega | Specific dissipation rate [1/s]
49  \endverbatim
50 
51  Required fields:
52  \verbatim
53  k | Turbulent kinetic energy [m2/s2]
54  omega | Specific dissipation rate [1/s]
55  alphat | Kinematic turbulent thermal conductivity [m2/s]
56  T | Temperature [K]
57  \endverbatim
58 
59 
60  For compressible cases:
61 
62  Sources applied to:
63  \verbatim
64  k | Turbulent kinetic energy [m2/s2]
65  \endverbatim
66 
67  Required fields:
68  \verbatim
69  k | Turbulent kinetic energy [m2/s2]
70  rho | Fluid density [kg/m3]
71  \endverbatim
72 
73  References:
74  \verbatim
75  Buoyancy modifier for incompressible flow cases (tag:BMA):
76  Barakos, G., Mitsoulis, E., & Assimacopoulos, D. O. (1994).
77  Natural convection flow in a square cavity revisited:
78  laminar and turbulent models with wall functions.
79  Int. J. for Numerical Methods in Fluids, 18(7), 695-719.
80  DOI:10.1002/fld.1650180705
81 
82  Buoyancy modifier for compressible flow cases (tag:DTR):
83  Devolder, B., Troch, P., & Rauwoens, P. (2018).
84  Performance of a buoyancy-modified k-ω and k-ω
85  SST turbulence model for simulating wave breaking
86  under regular waves using OpenFOAM.
87  Coastal Engineering, 138, 49-65.
88  DOI:10.1016/j.coastaleng.2018.04.011
89  \endverbatim
90 
91 Usage
92  Minimal example by using \c constant/fvOptions:
93  \verbatim
94  buoyancyTurbSource1
95  {
96  // Mandatory entries (unmodifiable)
97  type buoyancyTurbSource;
98 
99  // Optional entries (unmodifiable)
100  beta 3.3e-03;
101  rho rho;
102  alphat alphat;
103  T T;
104 
105  // Mandatory/Optional (inherited) entries
106  ...
107  }
108  \endverbatim
109 
110  where the entries mean:
111  \table
112  Property | Description | Type | Reqd | Dflt
113  type | Type name: buoyancyTurbSource | word | yes | -
114  beta | Thermal expansion coefficient for incompressible cases <!--
115  --> | scalar | no | 3.3e-03
116  rho | Name of operand density field | word | no | rho
117  alphat | Name of operand kinematic turbulent thermal <!--
118  --> conductivity field | word | no | alphat
119  T | Name of operand temperature field | word | no | T
120  \endtable
121 
122  The inherited entries are elaborated in:
123  - \link fvOption.H \endlink
124  - \link cellSetOption.H \endlink
125 
126 Note
127  - Personal communication with Dr. Devolder
128  for compressible cases (28 Oct 2020):
129 
130  "Eq. 21 of my publication is the buoyancy source term. This term
131  appears when the transport equation for the TKE is fundamentally
132  derived from the Favre-averaged (density weighted) low Mach number
133  equations, as reported in:
134 
135  Van Maele, K., & Merci, B. (2006).
136  Application of two buoyancy-modified k–ε
137  turbulence models to different types of buoyant plumes.
138  Fire Safety Journal, 41(2), 122-138.
139  DOI:10.1016/j.firesaf.2005.11.003
140 
141  Van Maele, K., & Merci, B. (2006).
142  Importance of buoyancy and chemistry modelling in
143  steady RANS simulations of well-ventilated tunnel fires.
144  Turkish Jour. of Engineering and Environmental Sciences, 30(3), 145-155.
145 
146  Therefore, this term is generally applicable for
147  applications where density gradients exist such as
148  compressible heat transfer but also wave modelling
149  due to the VoF method."
150 
151  "Due to VoF, the interface between water and air is not
152  a jump but it is rather smooth. This means that there is
153  a finite density gradient and therefore I think that the
154  density must be included inside the differential operators."
155 
156 See also
157  - Foam::fv::buoyancyEnergy
158  - Foam::fv::buoyancyForce
159 
160 SourceFiles
161  buoyancyTurbSource.C
162  buoyancyTurbSourceTemplates.C
163 
164 \*---------------------------------------------------------------------------*/
165 
166 #ifndef fv_buoyancyTurbSource_H
167 #define fv_buoyancyTurbSource_H
168 
169 #include "cellSetOption.H"
170 #include "turbulentTransportModel.H"
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 namespace Foam
175 {
176 namespace fv
177 {
178 
179 /*---------------------------------------------------------------------------*\
180  Class buoyancyTurbSource Declaration
181 \*---------------------------------------------------------------------------*/
182 
183 class buoyancyTurbSource
184 :
185  public fv::cellSetOption
186 {
187  // Private Data
188 
189  //- Flag to determine the working field is epsilon or omega (internal)
190  bool isEpsilon_;
191 
192  //- Name of operand density field
193  const word rhoName_;
194 
195  //- Name of operand kinematic turbulent thermal conductivity field
196  const word alphatName_;
197 
198  //- Name of operand temperature field
199  const word Tname_;
200 
201  //- Thermal expansion coefficient for incompressible cases [1/K]
202  const dimensionedScalar beta_;
203 
204  //- Gravitational acceleration vector [m/s2]
205  const dimensionedVector g_;
206 
207 
208  // Private Member Functions
209 
210  //- Compute buoyancy production term for incompressible cases [m2/s3]
211  tmp<volScalarField::Internal> B() const;
212 
213  //- Apply buoyancyTurbSource to epsilon field for incompressible cases
214  void buoyancyTurbSourceEpsilon(fvMatrix<scalar>& eqn) const;
215 
216  //- Apply buoyancyTurbSource to omega field for incompressible cases
217  void buoyancyTurbSourceOmega(fvMatrix<scalar>& eqn) const;
218 
219  //- Apply buoyancyTurbSource to k field for incompressible cases
220  void buoyancyTurbSourceK(fvMatrix<scalar>& eqn) const;
221 
222  //- Apply buoyantTurbSource to k field for compressible cases
223  template<class AlphaFieldType, class RhoFieldType>
224  void buoyancyTurbSourceK
225  (
226  const AlphaFieldType& alpha,
227  const RhoFieldType& rho,
228  fvMatrix<scalar>& eqn,
229  const label fieldi
230  ) const;
231 
232 
233 public:
234 
235  //- Runtime type information
236  TypeName("buoyancyTurbSource");
237 
238 
239  // Constructors
240 
241  //- Construct from explicit source name and mesh
243  (
244  const word& sourceName,
245  const word& modelType,
246  const dictionary& dict,
247  const fvMesh& mesh
248  );
249 
250  //- No copy construct
251  buoyancyTurbSource(const buoyancyTurbSource&) = delete;
252 
253  //- No copy assignment
254  void operator=(const buoyancyTurbSource&) = delete;
255 
256 
257  //- Destructor
258  virtual ~buoyancyTurbSource() = default;
259 
260 
261  // Member Functions
262 
263  //- Add explicit contribution to k and epsilon/omega equation
264  //- for incompressible flow computations
265  virtual void addSup
266  (
267  fvMatrix<scalar>& eqn,
268  const label fieldi
269  );
270 
271  //- Add explicit contribution to k equation
272  //- for compressible flow computations
273  virtual void addSup
274  (
275  const volScalarField& rho,
276  fvMatrix<scalar>& eqn,
277  const label fieldi
278  );
279 
280  //- Add explicit contribution to k equation
281  //- for multiphase flow computations
282  virtual void addSup
283  (
284  const volScalarField& alpha,
285  const volScalarField& rho,
286  fvMatrix<scalar>& eqn,
287  const label fieldi
288  );
289 
290  //- Read source dictionary - no-op
291  virtual bool read(const dictionary& dict)
292  {
293  return true;
294  }
295 };
296 
297 
298 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
299 
300 } // End namespace fv
301 } // End namespace Foam
302 
303 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
304 
305 #ifdef NoRepository
307 #endif
308 
309 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
310 
311 #endif
312 
313 // ************************************************************************* //
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::fv::cellSetOption
Intermediate abstract class for handling cell-set options for the derived fvOptions.
Definition: cellSetOption.H:163
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::fv::buoyancyTurbSource::TypeName
TypeName("buoyancyTurbSource")
Runtime type information.
Foam::constant::atomic::alpha
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Definition: readThermalProperties.H:212
Foam::fv::buoyancyTurbSource::read
virtual bool read(const dictionary &dict)
Read source dictionary - no-op.
Definition: buoyancyTurbSource.H:330
Foam::fv::buoyancyTurbSource::addSup
virtual void addSup(fvMatrix< scalar > &eqn, const label fieldi)
Definition: buoyancyTurbSource.C:217
turbulentTransportModel.H
Foam::fv::buoyancyTurbSource::operator=
void operator=(const buoyancyTurbSource &)=delete
No copy assignment.
rho
rho
Definition: readInitialConditions.H:88
cellSetOption.H
Foam::dimensionedVector
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Definition: dimensionedVector.H:50
buoyancyTurbSourceTemplates.C
Foam::fv::buoyancyTurbSource
Applies sources on turbulent kinetic energy (i.e. k) and either turbulent kinetic energy dissipation ...
Definition: buoyancyTurbSource.H:222
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:42
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::dimensioned
Generic dimensioned Type class.
Definition: dimensionedScalarFwd.H:42
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::fv::buoyancyTurbSource::buoyancyTurbSource
buoyancyTurbSource(const word &sourceName, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from explicit source name and mesh.
Definition: buoyancyTurbSource.C:130
fv
labelList fv(nPoints)
Foam::fv::option::mesh
const fvMesh & mesh() const noexcept
Return const access to the mesh database.
Definition: fvOptionI.H:37
Foam::fvMatrix
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvPatchField.H:68
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::fv::buoyancyTurbSource::~buoyancyTurbSource
virtual ~buoyancyTurbSource()=default
Destructor.