svenssonHaggkvistCanopySource.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 | Copyright (C) 2015-2017 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24  Copyright is held by the author.
25 
26 Class
27  Foam::fv::svenssonHaggkvistCanopySource
28 
29 Group
30  grpFvOptionsSources
31 
32 Author
33  David Segersson, Swedish Meteorological and Hydrological Institute
34  david.segersson@smhi.se
35 
36 Description
37  Momentum and turbulence source/sink-terms for tree canopy according to Svensson & Häggkvist (1990), with parameters adjusted according t o Mochida et al. (2008).
38 
39  Momentum source term is expressed as:
40  \f[
41  S_u = -\rho C_d \alpha u^2
42  \f]
43 
44  Source term for k is expressed as:
45 
46  \f[
47  S_k = \rho C_d \alpha u^3
48  \f]
49 
50  Source term for epsilon is expressed as:
51 
52  \f[
53  S_{\epsilon} = \rho C_d \alpha C_{p \epsilon 1} \frac{\epsilon}{k} u^3
54  \f]
55 
56  where
57 
58  \vartable
59  \rho | density
60  u | magnitude of velocity
61  k | turbulent kinetic energy
62  \alpha | leaf area density [m]
63  C_d | tree canopy drag coefficient
64  C_{p \epsilon 1} | coefficient with value 1.8 (Mochida et al. 2008)
65  \endvartable
66 
67  Use with any variant of the k-\epsilon turbulence model.
68 
69 
70  Reference:
71  Mochida A., Tabata Y., Iwata T., Yoshino H., Examining tree canopy models for CFD prediction
72  of wind environment at pedestrian level, J. Wind Eng. Ind.
73  Aerodyn. 96 (2008) 1667-1677.
74 
75  Svensson, U., Häggkvist, K. A two-equation turbulence model for canopy flows. J. Wind Eng. Ind.
76  Aerodyn. 35 (1990) 201–211.
77 
78 Usage
79  Example usage:
80  \verbatim
81  SBM
82  {
83  type svenssonHaggkvistCanopySource;
84  active on;
85  }
86  \endverbatim
87 
88 SourceFiles
89  svenssonHaggkvistCanopySource.C
90 
91 \*---------------------------------------------------------------------------*/
92 
93 #ifndef svenssonHaggkvistCanopySource_H
94 #define svenssonHaggkvistCanopySource_H
95 
96 #include "fvOption.H"
97 #include "dimensionedTypes.H"
98 #include "wallFvPatch.H"
99 #include "canopySource.H"
100 
101 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
102 
103 namespace Foam
104 {
105 namespace fv
106 {
107 
108 /*---------------------------------------------------------------------------*\
109  Class svenssonHaggkvistCanopySource Declaration
110 \*---------------------------------------------------------------------------*/
111 
112 class svenssonHaggkvistCanopySource
113 :
114  public canopySource
115 {
116 private:
117 
118  // Canopy coefficients
120 
121  //- Disallow default bitwise copy construct
123 
124  //- Disallow default bitwise assignment
126 
127 
128  //- Source term to momentum equation
129  template<class RhoFieldType>
130  void addSup
131  (
132  const RhoFieldType& rho,
133  fvMatrix<vector>& eqn,
134  const label fieldi
135  );
136 
137  template<class RhoFieldType>
138  void addSup
139  (
140  const RhoFieldType& rho,
141  fvMatrix<scalar>& eqn,
142  const label fieldi
143  );
144 
145 
146  // Private Member Functions
147 
148 
149 public:
150 
151 
152  //- Runtime type information
153  TypeName("svenssonHaggkvistCanopySource");
154 
155 
156  // Constructors
157 
158  //- Construct from components
160  (
161  const word& name,
162  const word& modelType,
163  const dictionary& dict,
164  const fvMesh& mesh
165  );
166 
167 
168  //- Destructor
170  {}
171 
172 
173  // Member Functions
174  // access
175 
176  dimensionedScalar CpEps1() const
177  {
178  return CpEps1_;
179  }
180 
181  //- Source term to momentum equation
182  void addSup
183  (
184  fvMatrix<vector>& eqn,
185  const label fieldi
186  );
187 
188  //- Source term to scalar equations (k & epsilon)
189  void addSup
190  (
191  fvMatrix<scalar>& eqn,
192  const label fieldi
193  );
194 
195 
196  //- Source term to compressible momentum equation
197  void addSup
198  (
200  fvMatrix<vector>& eqn,
201  const label fieldi
202  );
203 
204  //- Source term to compressible scalar equation (k & epsilon)
205  void addSup
206  (
207  const volScalarField& rho,
208  fvMatrix<scalar>& eqn,
209  const label fieldi
210  );
211 
212 };
213 
214 
215 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 
217 } // End namespace fv
218 } // End namespace Foam
219 
220 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
221 
222 #endif
223 
224 // ************************************************************************* //
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::fv::svenssonHaggkvistCanopySource::~svenssonHaggkvistCanopySource
virtual ~svenssonHaggkvistCanopySource()
Destructor.
Definition: svenssonHaggkvistCanopySource.H:192
Foam::fv::option::name
const word & name() const
Return const access to the source name.
Definition: fvOptionI.H:28
Foam::fv::svenssonHaggkvistCanopySource::CpEps1
dimensionedScalar CpEps1() const
Definition: svenssonHaggkvistCanopySource.H:199
Foam::fv::svenssonHaggkvistCanopySource::addSup
void addSup(const RhoFieldType &rho, fvMatrix< vector > &eqn, const label fieldi)
Source term to momentum equation.
wallFvPatch.H
Foam::fv::svenssonHaggkvistCanopySource::CpEps1_
dimensionedScalar CpEps1_
Definition: svenssonHaggkvistCanopySource.H:142
Foam::fv::svenssonHaggkvistCanopySource::TypeName
TypeName("svenssonHaggkvistCanopySource")
Runtime type information.
Foam::fv::svenssonHaggkvistCanopySource
Momentum and turbulence source/sink-terms for tree canopy according to Svensson & Häggkvist (1990),...
Definition: svenssonHaggkvistCanopySource.H:135
Foam::fv::svenssonHaggkvistCanopySource::svenssonHaggkvistCanopySource
svenssonHaggkvistCanopySource(const svenssonHaggkvistCanopySource &)
Disallow default bitwise copy construct.
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Foam::fv::canopySource
Base class for momentum and turbulence source/sink-terms for tree canopy.
Definition: canopySource.H:119
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:41
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::dimensioned
Generic dimensioned Type class.
Definition: dimensionedScalarFwd.H:41
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
rho
rho
Definition: pEqn.H:3
fv
labelList fv(nPoints)
fvOption.H
Foam::fv::option::mesh
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvOptionI.H:34
dimensionedTypes.H
Foam::fvMatrix
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvPatchField.H:68
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52
Foam::fv::svenssonHaggkvistCanopySource::operator=
void operator=(const svenssonHaggkvistCanopySource &)
Disallow default bitwise assignment.