Loading...
Searching...
No Matches
atmBoundaryLayerInletKFvPatchScalarField.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) 2014-2018 OpenFOAM Foundation
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::atmBoundaryLayerInletKFvPatchScalarField
29
30Group
31 grpRASBoundaryConditions grpInletBoundaryConditions
32
33Description
34 This boundary condition provides a log-law type ground-normal inlet
35 boundary condition for the turbulent kinetic energy (i.e. \c k)
36 for homogeneous, two-dimensional, dry-air, equilibrium and neutral
37 atmospheric boundary layer modelling.
38
39 The ground-normal \c k profile expression:
40
41 \f[
42 k = \frac{(u^*)^2}{\sqrt{C_\mu}}
43 \sqrt{C_1 \ln \left( \frac{z - d + z_0}{z_0} \right) + C_2}
44 \f]
45
46 where
47 \vartable
48 k | Ground-normal turbulent kinetic energy profile [m^2/s^3]
49 u^* | Friction velocity [m/s]
50 C_\mu | Empirical model constant [-]
51 C_1 | Curve-fitting coefficient for \c YGCJ profiles [-]
52 C_2 | Curve-fitting coefficient for \c YGCJ profiles [-]
53 \endvartable
54
55 Required fields:
56 \verbatim
57 k | Turbulent kinetic energy [m2/s2]
58 \endverbatim
59
60Usage
61 Example of the boundary condition specification:
62 \verbatim
63 inlet
64 {
65 // Mandatory entries (unmodifiable)
66 type atmBoundaryLayerInletK;
67
68 // Mandatory/Optional (inherited) entries (unmodifiable)
69 ...
70 flowDir (1 0 0); // not used
71 zDir (0 0 1); // not used
72 }
73 \endverbatim
74
75 where the entries mean:
76 \table
77 Property | Description | Type | Reqd | Deflt
78 type | Type name: atmBoundaryLayerInletK | word | yes | -
79 \endtable
80
81 The inherited entries are elaborated in:
82 - \link atmBoundaryLayer.H \endlink
83 - \link inletOutletFvPatchField.H \endlink
84
85See also
86 - Foam::atmBoundaryLayer
87 - Foam::atmBoundaryLayerInletVelocityFvPatchVectorField
88 - Foam::atmBoundaryLayerInletEpsilonFvPatchScalarField
89 - Foam::atmBoundaryLayerInletOmegaFvPatchScalarField
90
91SourceFiles
92 atmBoundaryLayerInletKFvPatchScalarField.C
93
94\*---------------------------------------------------------------------------*/
95
96#ifndef atmBoundaryLayerInletKFvPatchScalarField_H
97#define atmBoundaryLayerInletKFvPatchScalarField_H
98
99#include "fvPatchFields.H"
101#include "atmBoundaryLayer.H"
102
103// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
104
105namespace Foam
106{
107
108/*---------------------------------------------------------------------------*\
109 Class atmBoundaryLayerInletKFvPatchScalarField Declaration
110\*---------------------------------------------------------------------------*/
111
113:
114 public inletOutletFvPatchScalarField,
115 public atmBoundaryLayer
116{
117
118public:
119
120 //- Runtime type information
121 TypeName("atmBoundaryLayerInletK");
122
123
124 // Constructors
125
126 //- Construct from patch and internal field
128 (
129 const fvPatch&,
130 const DimensionedField<scalar, volMesh>&
131 );
132
133 //- Construct from patch, internal field and dictionary
135 (
136 const fvPatch&,
137 const DimensionedField<scalar, volMesh>&,
138 const dictionary&
139 );
140
141 //- Construct by mapping given
142 //- atmBoundaryLayerInletKFvPatchScalarField onto a new patch
144 (
146 const fvPatch&,
148 const fvPatchFieldMapper&
149 );
151 //- Construct as copy setting internal field reference
153 (
156 );
157
158 //- Return a clone
159 virtual tmp<fvPatchField<scalar>> clone() const
160 {
161 return fvPatchField<scalar>::Clone(*this);
162 }
163
164 //- Clone with an internal field reference
166 (
168 ) const
169 {
170 return fvPatchField<scalar>::Clone(*this, iF);
171 }
172
173
174 // Member Functions
175
176 //- Update the coefficients associated with the patch field
177 virtual void updateCoeffs();
178
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;
199
200
201// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202
203} // End namespace Foam
204
205// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207#endif
208
209// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
This boundary condition provides a log-law type ground-normal inlet boundary condition for the turbul...
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
atmBoundaryLayerInletKFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
virtual tmp< fvPatchField< scalar > > clone(const DimensionedField< scalar, volMesh > &iF) const
Clone with an internal field reference.
virtual tmp< fvPatchField< scalar > > clone() const
Return a clone.
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.
TypeName("atmBoundaryLayerInletK")
Runtime type information.
Base class to set log-law type ground-normal inlet boundary conditions for wind velocity and turbulen...
atmBoundaryLayer(const Time &time, const polyPatch &pp)
Construct null from time.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
A FieldMapper for finite-volume patch fields.
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition fvPatch.H:71
A class for managing temporary objects.
Definition tmp.H:75
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition List.H:62
fvPatchField< scalar > fvPatchScalarField
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68