atmPlantCanopyTurbSource.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::atmPlantCanopyTurbSource
29
30Group
31 grpFvOptionsSources
32
33Description
34 Applies sources on either \c epsilon or \c omega to incorporate effects
35 of plant canopy 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:
44 \verbatim
45 epsilon/omega | Dissipation rate OR Spec. dissipation rate [m2/s3]/[1/s]
46 plantCd | Plant canopy drag coefficient [-]
47 leafAreaDensity | Leaf area density [1/m]
48 \endverbatim
49
50 References:
51 \verbatim
52 Influence of forest (tag:SP):
53 Sogachev, A., & Panferov, O. (2006).
54 Modification of two-equation models to account for plant drag.
55 Boundary-Layer Meteorology, 121(2), 229-266.
56 DOI:10.1007/s10546-006-9073-5
57 \endverbatim
58
59Usage
60 Example by using \c constant/fvOptions:
61 \verbatim
62 atmPlantCanopyTurbSource1
63 {
64 // Mandatory entries (unmodifiable)
65 type atmPlantCanopyTurbSource;
66
67 atmPlantCanopyTurbSourceCoeffs
68 {
69 // Mandatory (inherited) entries (unmodifiable)
70 selectionMode all;
71
72 // Optional entries (unmodifiable)
73 rho rho;
74 }
75
76 // Optional (inherited) entries
77 ...
78 }
79 \endverbatim
80
81 where the entries mean:
82 \table
83 Property | Description | Type | Req'd | Dflt
84 type | Type name: atmPlantCanopyTurbSource | word | yes | -
85 rho | Name of density field | word | no | rho
86 \endtable
87
88 The inherited entries are elaborated in:
89 - \link fvOption.H \endlink
90 - \link cellSetOption.H \endlink
91
92SourceFiles
93 atmPlantCanopyTurbSource.C
94 atmPlantCanopyTurbSourceTemplates.C
95
96\*---------------------------------------------------------------------------*/
97
98#ifndef fv_atmPlantCanopyTurbSource_H
99#define fv_atmPlantCanopyTurbSource_H
100
101#include "cellSetOption.H"
103
104// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
105
106namespace Foam
107{
108namespace fv
109{
110
111/*---------------------------------------------------------------------------*\
112 Class atmPlantCanopyTurbSource Declaration
113\*---------------------------------------------------------------------------*/
114
115class atmPlantCanopyTurbSource
116:
117 public fv::cellSetOption
118{
119 // Private Data
120
121 //- Internal flag to determine the working field is epsilon or omega
122 Switch isEpsilon_;
123
124 //- Name of density field
125 const word rhoName_;
126
127 //- Required turbulence model coefficients (copied from turb model)
131
133 // Fields
134
135 //- Plant canopy drag coefficient field [-]
136 volScalarField plantCd_;
137
138 //- Leaf area density field [1/m]
139 volScalarField leafAreaDensity_;
140
141
142 // Private Member Functions
143
144 //- Return the modifier for plant canopy effects
145 tmp<volScalarField::Internal> calcPlantCanopyTerm
146 (
148 ) const;
149
150 //- Apply atmPlantCanopyTurbSource to epsilon
151 template<class AlphaFieldType, class RhoFieldType>
152 void atmPlantCanopyTurbSourceEpsilon
153 (
154 const AlphaFieldType& alpha,
155 const RhoFieldType& rho,
156 fvMatrix<scalar>& eqn,
157 const label fieldi
158 ) const;
159
160 //- Apply atmPlantCanopyTurbSource to omega
161 template<class AlphaFieldType, class RhoFieldType>
162 void atmPlantCanopyTurbSourceOmega
163 (
164 const AlphaFieldType& alpha,
165 const RhoFieldType& rho,
166 fvMatrix<scalar>& eqn,
167 const label fieldi
168 ) const;
169
170
171public:
172
173 //- Runtime type information
174 TypeName("atmPlantCanopyTurbSource");
175
176
177 // Constructors
178
179 //- Construct from explicit source name and mesh
181 (
182 const word& sourceName,
183 const word& modelType,
184 const dictionary& dict,
185 const fvMesh& mesh
186 );
187
188 //- No copy construct
190
191 //- No copy assignment
192 void operator=(const atmPlantCanopyTurbSource&) = delete;
193
194
195 // Member Functions
196
197 //- Add explicit contribution to epsilon or omega equation
198 //- for incompressible flow computations
199 virtual void addSup
200 (
201 fvMatrix<scalar>& eqn,
202 const label fieldi
203 );
204
205 //- Add explicit contribution to epsilon or omega equation
206 //- for compressible flow computations
207 virtual void addSup
208 (
210 fvMatrix<scalar>& eqn,
211 const label fieldi
212 );
213
214 //- Add explicit contribution to epsilon or omega equation
215 //- for multiphase flow computations
216 virtual void addSup
217 (
218 const volScalarField& alpha,
219 const volScalarField& rho,
220 fvMatrix<scalar>& eqn,
221 const label fieldi
222 );
223
224 //- Read source dictionary (effectively no-op)
225 virtual bool read(const dictionary& dict)
226 {
227 return true;
228 }
229};
230
231
232// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
233
234} // End namespace fv
235} // End namespace Foam
236
237// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
238
239#ifdef NoRepository
241#endif
243// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
244
245#endif
246
247// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:78
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 incorporate effects of plant canopy for atmospheric bou...
virtual bool read(const dictionary &dict)
Read source dictionary (effectively no-op)
void operator=(const atmPlantCanopyTurbSource &)=delete
No copy assignment.
atmPlantCanopyTurbSource(const atmPlantCanopyTurbSource &)=delete
No copy construct.
virtual void addSup(fvMatrix< scalar > &eqn, const label fieldi)
TypeName("atmPlantCanopyTurbSource")
Runtime type information.
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
U
Definition: pEqn.H:72
Namespace for OpenFOAM.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
labelList fv(nPoints)
volScalarField & alpha
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73