atmPlantCanopyUSource.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::atmPlantCanopyUSource
29
30Group
31 grpFvOptionsSources
32
33Description
34 Applies sources on velocity, i.e. \c U, to incorporate effects
35 of plant canopy for atmospheric boundary layer modelling.
36
37 Corrections applied to:
38 \verbatim
39 U | Velocity [m/s]
40 \endverbatim
41
42 Required fields:
43 \verbatim
44 U | Velocity [m/s]
45 plantCd | Plant canopy drag coefficient [-]
46 leafAreaDensity | Leaf area density [1/m]
47 \endverbatim
48
49 References:
50 \verbatim
51 Influence of forest (tag:SP):
52 Sogachev, A., & Panferov, O. (2006).
53 Modification of two-equation models to account for plant drag.
54 Boundary-Layer Meteorology, 121(2), 229-266.
55 DOI:10.1007/s10546-006-9073-5
56 \endverbatim
57
58Usage
59 Example by using \c constant/fvOptions:
60 \verbatim
61 atmPlantCanopyUSource1
62 {
63 // Mandatory entries (unmodifiable)
64 type atmPlantCanopyUSource;
65
66 atmPlantCanopyUSourceCoeffs
67 {
68 // Mandatory (inherited) entries (unmodifiable)
69 selectionMode all;
70
71 // Optional entries (unmodifiable)
72 rho rho;
73 }
74
75 // Optional (inherited) entries
76 ...
77 }
78 \endverbatim
79
80 where the entries mean:
81 \table
82 Property | Description | Type | Req'd | Dflt
83 type | Type name: atmPlantCanopyUSource | word | yes | -
84 rho | Name of density field | word | no | rho
85 \endtable
86
87 The inherited entries are elaborated in:
88 - \link fvOption.H \endlink
89 - \link cellSetOption.H \endlink
90
91SourceFiles
92 atmPlantCanopyUSource.C
93 atmPlantCanopyUSourceTemplates.C
94
95\*---------------------------------------------------------------------------*/
96
97#ifndef fv_atmPlantCanopyUSource_H
98#define fv_atmPlantCanopyUSource_H
99
100#include "cellSetOption.H"
101#include "fvMatrices.H"
102
103// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
104
105namespace Foam
106{
107namespace fv
108{
109
110/*---------------------------------------------------------------------------*\
111 Class atmPlantCanopyUSource Declaration
112\*---------------------------------------------------------------------------*/
113
114class atmPlantCanopyUSource
115:
116 public fv::cellSetOption
117{
118 // Private Data
119
120 //- Name of density field
121 const word rhoName_;
122
123
124 // Fields
125
126 //- Plant canopy drag coefficient field [-]
127 volScalarField plantCd_;
128
129 //- Leaf area density field [1/m]
130 volScalarField leafAreaDensity_;
132
133public:
134
135 //- Runtime type information
136 TypeName("atmPlantCanopyUSource");
137
138
139 // Constructors
140
141 //- Construct from explicit source name and mesh
143 (
144 const word& sourceName,
145 const word& modelType,
146 const dictionary& dict,
147 const fvMesh& mesh
148 );
149
150 //- No copy construct
152
153 //- No copy assignment
154 void operator=(const atmPlantCanopyUSource&) = delete;
155
156
157 // Member Functions
158
159 //- Add explicit contribution to momentum equation
160 virtual void addSup
161 (
162 fvMatrix<vector>& eqn,
163 const label fieldi
164 );
165
166 //- Add explicit contribution to compressible momentum equation
167 virtual void addSup
169 const volScalarField& rho,
170 fvMatrix<vector>& eqn,
171 const label fieldi
172 );
173
174 //- Add explicit contribution to phase momentum equation
175 virtual void addSup
176 (
177 const volScalarField& alpha,
178 const volScalarField& rho,
179 fvMatrix<vector>& eqn,
180 const label fieldi
181 );
182
183 //- Read source dictionary (effectively no-op)
184 virtual bool read(const dictionary& dict)
185 {
186 return true;
187 }
188};
189
190
191// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192
193} // End namespace fv
194} // End namespace Foam
195
196// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197
198#endif
199
200// ************************************************************************* //
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 velocity, i.e. U, to incorporate effects of plant canopy for atmospheric boundary ...
virtual bool read(const dictionary &dict)
Read source dictionary (effectively no-op)
TypeName("atmPlantCanopyUSource")
Runtime type information.
atmPlantCanopyUSource(const atmPlantCanopyUSource &)=delete
No copy construct.
virtual void addSup(fvMatrix< vector > &eqn, const label fieldi)
Add explicit contribution to momentum equation.
void operator=(const atmPlantCanopyUSource &)=delete
No copy assignment.
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 handling words, derived from Foam::string.
Definition: word.H:68
A special matrix type and solver, designed for finite volume solutions of scalar equations.
Namespace for OpenFOAM.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:82
labelList fv(nPoints)
volScalarField & alpha
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73