atmLengthScaleTurbSource.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-------------------------------------------------------------------------------
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::atmLengthScaleTurbSource
29
30Group
31 grpFvOptionsSources
32
33Description
34 Applies sources on either \c epsilon or \c omega to correct
35 mixing-length scale estimations for atmospheric boundary layer modelling.
36
37 Corrections applied to either of the below, if exist:
38 \verbatim
39 epsilon | Turbulent kinetic energy dissipation rate [m2/s3]
40 omega | Specific dissipation rate [1/s]
41 \endverbatim
42
43 Required fields, either of the below:
44 \verbatim
45 epsilon | Turbulent kinetic energy dissipation rate [m2/s3]
46 omega | Specific dissipation rate [1/s]
47 \endverbatim
48
49 References:
50 \verbatim
51 Mixing-length scale limiter for epsilon (tag:AC):
52 Apsley, D. D., & Castro, I. P. (1997).
53 A limited-length-scale k-ε model for the neutral and
54 stably-stratified atmospheric boundary layer.
55 Boundary-layer meteorology, 83(1), 75-98.
56 DOI:10.1023/A:1000252210512
57
58 Mixing-length scale limiter for omega (tag:L):
59 Langner, J. (2016).
60 Implementierung und validierung von RANS-modellen der
61 thermisch geschichteten, atmosphärischen grenzschicht.
62 Masterarbeit zum thema, Technische Universität Berlin.
63
64 Mixing-length scale estimation (tag:P):
65 Pope, S. B. (2000).
66 Turbulent flows.
67 Cambridge, UK: Cambridge Univ. Press
68 DOI:10.1017/CBO9780511840531
69 \endverbatim
70
71Usage
72 Example by using \c constant/fvOptions:
73 \verbatim
74 atmLengthScaleTurbSource1
75 {
76 // Mandatory entries (unmodifiable)
77 type atmLengthScaleTurbSource;
78
79 atmLengthScaleTurbSourceCoeffs
80 {
81 // Mandatory (inherited) entries (unmodifiable)
82 selectionMode all;
83
84 // Optional entries (unmodifiable)
85 rho rho;
86 Lmax 41.575;
87 n 3.0;
88 }
89
90 // Optional (inherited) entries
91 ...
92 }
93 \endverbatim
94
95 where the entries mean:
96 \table
97 Property | Description | Type | Req'd | Dflt
98 type | Type name: atmLengthScaleTurbSource | word | yes | -
99 rho | Name of density field | word | no | rho
100 Lmax | Maximum mixing-length scale [m] | scalar | no | 41.575
101 n | Mixing-length scale exponent | scalar | no | 3.0
102 \endtable
103
104 The inherited entries are elaborated in:
105 - \link fvOption.H \endlink
106 - \link cellSetOption.H \endlink
107
108See also
109 - cellSetOption.H
110
111SourceFiles
112 atmLengthScaleTurbSource.C
113 atmLengthScaleTurbSourceTemplates.C
114
115\*---------------------------------------------------------------------------*/
116
117#ifndef fv_atmLengthScaleTurbSource_H
118#define fv_atmLengthScaleTurbSource_H
119
120#include "cellSetOption.H"
122
123// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124
125namespace Foam
126{
127namespace fv
128{
129
130/*---------------------------------------------------------------------------*\
131 Class atmLengthScaleTurbSource Declaration
132\*---------------------------------------------------------------------------*/
133
134class atmLengthScaleTurbSource
135:
136 public fv::cellSetOption
137{
138 // Private Data
139
140 //- Internal flag to determine the working field is epsilon or omega
141 bool isEpsilon_;
142
143 //- Name of density field
144 const word rhoName_;
145
146 //- Maximum mixing-length scale [m]
147 const dimensionedScalar Lmax_;
148
149 //- Mixing-length scale exponent
150 const dimensionedScalar n_;
151
152 //- Required turbulence model coefficients (copied from turb model)
157
158
159 // Private Member Functions
160
161 //- Return mixing-length scale modifier for epsilon-based models
162 tmp<volScalarField::Internal> calcC1Star
166 ) const;
167
168 //- Return mixing-length scale modifier for omega-based models
170 (
172 const volScalarField::Internal& omega,
175 ) const;
176
177 //- Apply atmLengthScaleTurbSource to epsilon
178 template<class AlphaFieldType, class RhoFieldType>
179 void atmLengthScaleTurbSourceEpsilon
180 (
181 const AlphaFieldType& alpha,
182 const RhoFieldType& rho,
183 fvMatrix<scalar>& eqn,
184 const label fieldi
185 ) const;
186
187 //- Apply atmLengthScaleTurbSource to omega
188 template<class AlphaFieldType, class RhoFieldType>
189 void atmLengthScaleTurbSourceOmega
190 (
191 const AlphaFieldType& alpha,
192 const RhoFieldType& rho,
193 fvMatrix<scalar>& eqn,
194 const label fieldi
195 ) const;
196
197
198public:
199
200 //- Runtime type information
201 TypeName("atmLengthScaleTurbSource");
202
203
204 // Constructors
205
206 //- Construct from explicit source name and mesh
208 (
209 const word& sourceName,
210 const word& modelType,
211 const dictionary& dict,
212 const fvMesh& mesh
213 );
214
215 //- No copy construct
217
218 //- No copy assignment
219 void operator=(const atmLengthScaleTurbSource&) = delete;
220
221
222 // Member Functions
223
224 //- Add explicit contribution to epsilon or omega equation
225 //- for incompressible flow computations
226 virtual void addSup
227 (
228 fvMatrix<scalar>& eqn,
229 const label fieldi
230 );
231
232 //- Add explicit contribution to epsilon or omega equation
233 //- for compressible flow computations
234 virtual void addSup
235 (
236 const volScalarField& rho,
237 fvMatrix<scalar>& eqn,
238 const label fieldi
239 );
240
241 //- Add explicit contribution to epsilon or omega equation
242 //- for multiphase flow computations
243 virtual void addSup
244 (
246 const volScalarField& rho,
247 fvMatrix<scalar>& eqn,
248 const label fieldi
249 );
250
251 //- Read source dictionary (effectively no-op)
252 virtual bool read(const dictionary& dict)
253 {
254 return true;
255 }
256};
257
258
259// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
260
261} // End namespace fv
262} // End namespace Foam
263
264// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
265
266#ifdef NoRepository
268#endif
269
270// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
271
272#endif
273
274// ************************************************************************* //
label k
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
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 sources on either epsilon or omega to correct mixing-length scale estimations for atmospheric...
virtual bool read(const dictionary &dict)
Read source dictionary (effectively no-op)
void operator=(const atmLengthScaleTurbSource &)=delete
No copy assignment.
TypeName("atmLengthScaleTurbSource")
Runtime type information.
virtual void addSup(fvMatrix< scalar > &eqn, const label fieldi)
atmLengthScaleTurbSource(const atmLengthScaleTurbSource &)=delete
No copy construct.
Intermediate abstract class for handling cell-set options for the derived fvOptions.
const fvMesh & mesh() const noexcept
Return const access to the mesh database.
Definition: fvOptionI.H:37
A class for managing temporary objects.
Definition: tmp.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
const scalar gamma
Definition: EEqn.H:9
scalar epsilon
Namespace for OpenFOAM.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
labelList fv(nPoints)
volScalarField & alpha
dictionary dict
dimensionedScalar beta("beta", dimless/dimTemperature, laminarTransport)
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73