atmBoundaryLayerInletEpsilonFvPatchScalarField.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) 2011-2018 OpenFOAM Foundation
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::atmBoundaryLayerInletEpsilonFvPatchScalarField
29 
30 Group
31  grpRASBoundaryConditions grpInletBoundaryConditions
32 
33 Description
34  This boundary condition provides a log-law type ground-normal inlet
35  boundary condition for the turbulent kinetic energy dissipation rate
36  (i.e. \c epsilon) for homogeneous, two-dimensional, dry-air, equilibrium
37  and neutral atmospheric boundary layer modelling.
38 
39  The ground-normal \c epsilon profile expression:
40 
41  \f[
42  \epsilon = \frac{(u^*)^3}{\kappa (z - d + z_0)}
43  \sqrt{C_1 \ln \left( \frac{z - d + z_0}{z_0} \right) + C_2}
44  \f]
45 
46  where
47  \vartable
48  \epsilon | Ground-normal TKE dissipation rate profile [m^2/s^3]
49  u^* | Friction velocity [m/s]
50  \kappa | von Kármán constant [-]
51  z | Ground-normal coordinate component [m]
52  z_0 | Aerodynamic roughness length [m]
53  d | Ground-normal displacement height [m]
54  C_1 | Curve-fitting coefficient for \c YGCJ profiles [-]
55  C_2 | Curve-fitting coefficient for \c YGCJ profiles [-]
56  \endvartable
57 
58  Required fields:
59  \verbatim
60  epsilon | Turbulent kinetic energy dissipation rate [m2/s3]
61  \endverbatim
62 
63 Usage
64  Example of the boundary condition specification:
65  \verbatim
66  inlet
67  {
68  // Mandatory entries (unmodifiable)
69  type atmBoundaryLayerInletEpsilon;
70 
71  // Mandatory/Optional (inherited) entries (unmodifiable)
72  ...
73  }
74  \endverbatim
75 
76  where the entries mean:
77  \table
78  Property | Description | Type | Reqd | Deflt
79  type | Type name: atmBoundaryLayerInletEpsilon | word | yes | -
80  \endtable
81 
82  The inherited entries are elaborated in:
83  - \link atmBoundaryLayer.H \endlink
84  - \link inletOutletFvPatchField.H \endlink
85 
86 See also
87  - Foam::atmBoundaryLayer
88  - Foam::atmBoundaryLayerInletKFvPatchScalarField
89  - Foam::atmBoundaryLayerInletOmegaFvPatchScalarField
90  - Foam::atmBoundaryLayerInletVelocityFvPatchVectorField
91 
92 SourceFiles
93  atmBoundaryLayerInletEpsilonFvPatchScalarField.C
94 
95 \*---------------------------------------------------------------------------*/
96 
97 #ifndef atmBoundaryLayerInletEpsilonFvPatchScalarField_H
98 #define atmBoundaryLayerInletEpsilonFvPatchScalarField_H
99 
100 #include "fvPatchFields.H"
102 #include "atmBoundaryLayer.H"
103 
104 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
105 
106 namespace Foam
107 {
108 
109 /*---------------------------------------------------------------------------*\
110  Class atmBoundaryLayerInletEpsilonFvPatchScalarField Declaration
111 \*---------------------------------------------------------------------------*/
112 
113 class atmBoundaryLayerInletEpsilonFvPatchScalarField
114 :
115  public inletOutletFvPatchScalarField,
116  public atmBoundaryLayer
117 {
118 
119 public:
120 
121  //- Runtime type information
122  TypeName("atmBoundaryLayerInletEpsilon");
123 
124 
125  // Constructors
126 
127  //- Construct from patch and internal field
129  (
130  const fvPatch&,
131  const DimensionedField<scalar, volMesh>&
132  );
133 
134  //- Construct from patch, internal field and dictionary
136  (
137  const fvPatch&,
138  const DimensionedField<scalar, volMesh>&,
139  const dictionary&
140  );
141 
142  //- Construct by mapping given
143  //- atmBoundaryLayerInletEpsilonFvPatchScalarField onto a new patch
145  (
147  const fvPatch&,
148  const DimensionedField<scalar, volMesh>&,
149  const fvPatchFieldMapper&
150  );
151 
152  //- Construct and return a clone
153  virtual tmp<fvPatchScalarField> clone() const
154  {
155  return tmp<fvPatchScalarField>
156  (
158  );
159  }
160 
161  //- Construct as copy setting internal field reference
163  (
166  );
167 
168  //- Construct and return a clone setting internal field reference
170  (
172  ) const
173  {
175  (
177  );
178  }
179 
180 
181  // Member Functions
182 
183  //- Update the coefficients associated with the patch field
184  virtual void updateCoeffs();
185 
186  // Mapping
187 
188  //- Map (and resize as needed) from self given a mapping object
189  virtual void autoMap
190  (
191  const fvPatchFieldMapper&
192  );
193 
194  //- Reverse map the given fvPatchField onto this fvPatchField
195  virtual void rmap
196  (
197  const fvPatchScalarField&,
198  const labelList&
199  );
200 
201 
202  //- Write
203  virtual void write(Ostream&) const;
204 };
205 
206 
207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208 
209 } // End namespace Foam
210 
211 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212 
213 #endif
214 
215 // ************************************************************************* //
Foam::atmBoundaryLayerInletEpsilonFvPatchScalarField::TypeName
TypeName("atmBoundaryLayerInletEpsilon")
Runtime type information.
Foam::fvPatchField< scalar >
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::atmBoundaryLayerInletEpsilonFvPatchScalarField::rmap
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: atmBoundaryLayerInletEpsilonFvPatchScalarField.C:136
Foam::atmBoundaryLayerInletEpsilonFvPatchScalarField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: atmBoundaryLayerInletEpsilonFvPatchScalarField.C:112
Foam::atmBoundaryLayerInletEpsilonFvPatchScalarField
This boundary condition provides a log-law type ground-normal inlet boundary condition for the turbul...
Definition: atmBoundaryLayerInletEpsilonFvPatchScalarField.H:156
Foam::atmBoundaryLayerInletEpsilonFvPatchScalarField::write
virtual void write(Ostream &) const
Write.
Definition: atmBoundaryLayerInletEpsilonFvPatchScalarField.C:150
Foam::atmBoundaryLayer
Base class to set log-law type ground-normal inlet boundary conditions for wind velocity and turbulen...
Definition: atmBoundaryLayer.H:393
Foam::atmBoundaryLayerInletEpsilonFvPatchScalarField::clone
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
Definition: atmBoundaryLayerInletEpsilonFvPatchScalarField.H:196
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::atmBoundaryLayerInletEpsilonFvPatchScalarField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: atmBoundaryLayerInletEpsilonFvPatchScalarField.C:126
atmBoundaryLayer.H
Foam::atmBoundaryLayerInletEpsilonFvPatchScalarField::atmBoundaryLayerInletEpsilonFvPatchScalarField
atmBoundaryLayerInletEpsilonFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: atmBoundaryLayerInletEpsilonFvPatchScalarField.C:45
fvPatchFields.H
Foam::List< label >
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
inletOutletFvPatchFields.H
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54