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 as copy setting internal field reference
154  (
157  );
158 
159  //- Return a clone
160  virtual tmp<fvPatchField<scalar>> clone() const
161  {
162  return fvPatchField<scalar>::Clone(*this);
163  }
164 
165  //- Clone with an internal field reference
167  (
169  ) const
170  {
171  return fvPatchField<scalar>::Clone(*this, iF);
172  }
173 
174 
175  // Member Functions
176 
177  //- Update the coefficients associated with the patch field
178  virtual void updateCoeffs();
179 
180  // Mapping
181 
182  //- Map (and resize as needed) from self given a mapping object
183  virtual void autoMap
184  (
185  const fvPatchFieldMapper&
186  );
187 
188  //- Reverse map the given fvPatchField onto this fvPatchField
189  virtual void rmap
190  (
191  const fvPatchScalarField&,
192  const labelList&
193  );
194 
195 
196  //- Write
197  virtual void write(Ostream&) const;
198 };
199 
200 
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 
203 } // End namespace Foam
204 
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 
207 #endif
208 
209 // ************************************************************************* //
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
Definition: fvPatchField.H:597
fvPatchField< scalar > fvPatchScalarField
TypeName("atmBoundaryLayerInletEpsilon")
Runtime type information.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
This boundary condition provides a log-law type ground-normal inlet boundary condition for the turbul...
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
atmBoundaryLayerInletEpsilonFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
List< label > labelList
A List of labels.
Definition: List.H:62
A class for managing temporary objects.
Definition: HashPtrTable.H:50
virtual tmp< fvPatchField< scalar > > clone() const
Return a clone.
Namespace for OpenFOAM.