atmBuoyancyTurbSource.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 ENERCON GmbH
9  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::fv::atmBuoyancyTurbSource
29 
30 Group
31  grpFvOptionsSources
32 
33 Description
34  Applies sources on \c k and either \c epsilon or \c omega to incorporate
35  effects of buoyancy for atmospheric boundary layer modelling.
36 
37  Corrections applied to:
38  \verbatim
39  k | Turbulent kinetic energy [m2/s2]
40  \endverbatim
41 
42  Corrections applied to either of the below, if exist:
43  \verbatim
44  epsilon | Turbulent kinetic energy dissipation rate [m2/s3]
45  omega | Specific dissipation rate [1/s]
46  \endverbatim
47 
48  Required fields:
49  \verbatim
50  k | Turbulent kinetic energy [m2/s2]
51  epsilon/omega | Dissipation rate OR Spec. dissipation rate [m2/s3]/[1/s]
52  T | Temperature [K]
53  alphat | Kinematic turbulent thermal conductivity [m2/s]
54  \endverbatim
55 
56  References:
57  \verbatim
58  Buoyancy effects (tags:SKL, ARAL):
59  Sogachev, A., Kelly, M., & Leclerc, M. Y. (2012).
60  Consistent two-equation closure modelling for atmospheric
61  research: buoyancy and vegetation implementations.
62  Boundary-layer meteorology, 145(2), 307-327.
63  DOI:10.1007/s10546-012-9726-5
64 
65  Alletto, M., Radi, A., Adib, J., Langner, J.,
66  Peralta, C., Altmikus, A., & Letzel, M. (2018).
67  E-Wind: Steady state CFD approach for stratified flows
68  used for site assessment at Enercon.
69  In Journal of Physics: Conference Series, 1037(7).
70  DOI:10.1088/1742-6596/1037/7/072020
71 
72  Mixing-length scale limiter for omega (tag:L):
73  Langner, J. (2016).
74  Implementierung und validierung von RANS-modellen der
75  thermisch geschichteten, atmosphärischen grenzschicht.
76  Masterarbeit zum thema, Technische Universität Berlin.
77 
78  Mixing-length scale estimation (tag:P):
79  Pope, S. B. (2000).
80  Turbulent flows.
81  Cambridge, UK: Cambridge Univ. Press
82  DOI:10.1017/CBO9780511840531
83  \endverbatim
84 
85 Usage
86  Example by using \c constant/fvOptions:
87  \verbatim
88  atmBuoyancyTurbSource1
89  {
90  // Mandatory entries (unmodifiable)
91  type atmBuoyancyTurbSource;
92 
93  atmBuoyancyTurbSourceCoeffs
94  {
95  // Mandatory (inherited) entries (unmodifiable)
96  selectionMode all;
97 
98  // Optional (unmodifiable)
99  rho rho;
100  Lmax 41.575;
101  beta 3.3e-03;
102  }
103 
104  // Optional (inherited) entries
105  ...
106  }
107  \endverbatim
108 
109  where the entries mean:
110  \table
111  Property | Description | Type | Req'd | Dflt
112  type | Type name: atmBuoyancyTurbSource | word | yes | -
113  rho | Name of density field | word | no | rho
114  Lmax | Maximum mixing-length scale | scalar | no | 41.575
115  beta | Thermal expansion coefficient | scalar | no | 3.3e-03
116  \endtable
117 
118  The inherited entries are elaborated in:
119  - \link fvOption.H \endlink
120  - \link cellSetOption.H \endlink
121 
122 SourceFiles
123  atmBuoyancyTurbSource.C
124  atmBuoyancyTurbSourceTemplates.C
125 
126 \*---------------------------------------------------------------------------*/
127 
128 #ifndef fv_atmBuoyancyTurbSource_H
129 #define fv_atmBuoyancyTurbSource_H
130 
131 #include "cellSetOption.H"
132 #include "turbulentTransportModel.H"
133 #include "gravityMeshObject.H"
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 namespace Foam
138 {
139 namespace fv
140 {
141 
142 /*---------------------------------------------------------------------------*\
143  Class atmBuoyancyTurbSource Declaration
144 \*---------------------------------------------------------------------------*/
145 
146 class atmBuoyancyTurbSource
147 :
148  public fv::cellSetOption
149 {
150  // Private Data
151 
152  //- Internal flag to determine the working field is epsilon or omega
153  Switch isEpsilon_;
154 
155  //- Name of density field
156  const word rhoName_;
157 
158  //- Maximum mixing-length scale [m]
159  const dimensionedScalar Lmax_;
160 
161  //- Thermal expansion coefficient [1/K]
162  const dimensionedScalar beta_;
163 
164  //- Required turbulence model coefficients (copied from turb model)
165  dimensionedScalar Cmu_;
166  dimensionedScalar C1_;
167  dimensionedScalar C2_;
168 
169  //- Gravitational acceleration vector [m/s2]
170  const dimensionedVector g_;
171 
172 
173  // Fields
174 
175  //- Buoyancy production term [m2/s3]
177 
178 
179  // Private Member Functions
180 
181  //- Compute the buoyancy production term B_
182  void calcB();
183 
184  //- Return the buoyancy-effect modifier for epsilon-based models
186  (
190  ) const;
191 
192  //- Return the buoyancy-effect modifier for omega-based models
194  (
196  const volScalarField::Internal& omega,
200  ) const;
201 
202  //- Apply atmBuoyancyTurbSource to epsilon field
203  template<class AlphaFieldType, class RhoFieldType>
204  void atmBuoyancyTurbSourceEpsilon
205  (
206  const AlphaFieldType& alpha,
207  const RhoFieldType& rho,
208  fvMatrix<scalar>& eqn,
209  const label fieldi
210  ) const;
211 
212  //- Apply atmBuoyancyTurbSource to omega field
213  template<class AlphaFieldType, class RhoFieldType>
214  void atmBuoyancyTurbSourceOmega
215  (
216  const AlphaFieldType& alpha,
217  const RhoFieldType& rho,
218  fvMatrix<scalar>& eqn,
219  const label fieldi
220  ) const;
221 
222  //- Apply atmBuoyancyTurbSource to k field
223  template<class AlphaFieldType, class RhoFieldType>
224  void atmBuoyancyTurbSourceK
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("atmBuoyancyTurbSource");
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
252 
253  //- No copy assignment
254  void operator=(const atmBuoyancyTurbSource&) = delete;
255 
256 
257  // Member Functions
258 
259  //- Add explicit contribution to epsilon or omega equation
260  //- for incompressible flow computations
261  virtual void addSup
262  (
263  fvMatrix<scalar>& eqn,
264  const label fieldi
265  );
266 
267  //- Add explicit contribution to epsilon or omega equation
268  //- for compressible flow computations
269  virtual void addSup
270  (
271  const volScalarField& rho,
272  fvMatrix<scalar>& eqn,
273  const label fieldi
274  );
275 
276  //- Add explicit contribution to epsilon or omega equation
277  //- for multiphase flow computations
278  virtual void addSup
279  (
280  const volScalarField& alpha,
281  const volScalarField& rho,
282  fvMatrix<scalar>& eqn,
283  const label fieldi
284  );
285 
286  //- Read source dictionary (effectively no-op)
287  virtual bool read(const dictionary& dict)
288  {
289  return true;
290  }
291 };
292 
293 
294 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
295 
296 } // End namespace fv
297 } // End namespace Foam
298 
299 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
300 
301 #ifdef NoRepository
303 #endif
304 
305 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
306 
307 #endif
308 
309 // ************************************************************************* //
Foam::Switch
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:77
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::constant::universal::G
const dimensionedScalar G
Newtonian constant of gravitation.
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::fv::atmBuoyancyTurbSource::addSup
virtual void addSup(fvMatrix< scalar > &eqn, const label fieldi)
Definition: atmBuoyancyTurbSource.C:246
Foam::constant::atomic::alpha
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Definition: readThermalProperties.H:212
Foam::fv::atmBuoyancyTurbSource::operator=
void operator=(const atmBuoyancyTurbSource &)=delete
No copy assignment.
turbulentTransportModel.H
gravityMeshObject.H
atmBuoyancyTurbSourceTemplates.C
rho
rho
Definition: readInitialConditions.H:88
cellSetOption.H
Foam::dimensionedVector
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
Definition: dimensionedVector.H:50
Foam::fv::atmBuoyancyTurbSource
Applies sources on k and either epsilon or omega to incorporate effects of buoyancy for atmospheric b...
Definition: atmBuoyancyTurbSource.H:175
Foam::GeometricField< scalar, fvPatchField, volMesh >::Internal
DimensionedField< scalar, volMesh > Internal
Type of the internal field from which this GeometricField is derived.
Definition: GeometricField.H:107
beta
dimensionedScalar beta("beta", dimless/dimTemperature, laminarTransport)
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
fv
labelList fv(nPoints)
Foam::fv::atmBuoyancyTurbSource::TypeName
TypeName("atmBuoyancyTurbSource")
Runtime type information.
Foam::fv::option::mesh
const fvMesh & mesh() const noexcept
Return const access to the mesh database.
Definition: fvOptionI.H:37
gamma
const scalar gamma
Definition: EEqn.H:9
k
label k
Boltzmann constant.
Definition: LISASMDCalcMethod2.H:41
Foam::fvMatrix
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvPatchField.H:68
epsilon
scalar epsilon
Definition: evaluateNearWall.H:7
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::fv::atmBuoyancyTurbSource::read
virtual bool read(const dictionary &dict)
Read source dictionary (effectively no-op)
Definition: atmBuoyancyTurbSource.H:316
Foam::fv::atmBuoyancyTurbSource::atmBuoyancyTurbSource
atmBuoyancyTurbSource(const word &sourceName, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from explicit source name and mesh.
Definition: atmBuoyancyTurbSource.C:129