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 -------------------------------------------------------------------------------
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::atmPlantCanopyUSource
29 
30 Group
31  grpFvOptionsSources
32 
33 Description
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 
58 Usage
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 
91 SourceFiles
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 
105 namespace Foam
106 {
107 namespace fv
108 {
109 
110 /*---------------------------------------------------------------------------*\
111  Class atmPlantCanopyUSource Declaration
112 \*---------------------------------------------------------------------------*/
113 
114 class 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_;
131 
132 
133 public:
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
168  (
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 // ************************************************************************* //
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::atomic::alpha
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Definition: readThermalProperties.H:212
Foam::fv::atmPlantCanopyUSource::atmPlantCanopyUSource
atmPlantCanopyUSource(const word &sourceName, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from explicit source name and mesh.
Definition: atmPlantCanopyUSource.C:47
Foam::fv::atmPlantCanopyUSource::read
virtual bool read(const dictionary &dict)
Read source dictionary (effectively no-op)
Definition: atmPlantCanopyUSource.H:201
rho
rho
Definition: readInitialConditions.H:88
cellSetOption.H
fvMatrices.H
A special matrix type and solver, designed for finite volume solutions of scalar equations.
Foam::fv::atmPlantCanopyUSource
Applies sources on velocity, i.e. U, to incorporate effects of plant canopy for atmospheric boundary ...
Definition: atmPlantCanopyUSource.H:131
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::fv::atmPlantCanopyUSource::TypeName
TypeName("atmPlantCanopyUSource")
Runtime type information.
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
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::atmPlantCanopyUSource::addSup
virtual void addSup(fvMatrix< vector > &eqn, const label fieldi)
Add explicit contribution to momentum equation.
Definition: atmPlantCanopyUSource.C:92
fv
labelList fv(nPoints)
Foam::fv::atmPlantCanopyUSource::operator=
void operator=(const atmPlantCanopyUSource &)=delete
No copy assignment.
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 >