atmBoundaryLayerInletVelocityFvPatchVectorField.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::atmBoundaryLayerInletVelocityFvPatchVectorField
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 streamwise component of wind velocity
36  (i.e. \c u) for homogeneous, two-dimensional, dry-air, equilibrium
37  and neutral atmospheric boundary layer modelling.
38 
39  The ground-normal streamwise flow speed profile expression:
40 
41  \f[
42  u = \frac{u^*}{\kappa} \ln \left( \frac{z - d + z_0}{z_0} \right)
43  \f]
44 
45  \f[
46  v = w = 0
47  \f]
48 
49  where
50  \vartable
51  u | Ground-normal streamwise flow speed profile [m/s]
52  v | Spanwise flow speed [m/s]
53  w | Ground-normal flow speed [m/s]
54  u^* | Friction velocity [m/s]
55  \kappa | von Kármán constant [-]
56  z | Ground-normal coordinate component [m]
57  d | Ground-normal displacement height [m]
58  z_0 | Aerodynamic roughness length [m]
59  \endvartable
60 
61  Required fields:
62  \verbatim
63  U | Velocity [m/s]
64  \endverbatim
65 
66 Usage
67  Example of the boundary condition specification:
68  \verbatim
69  inlet
70  {
71  // Mandatory entries (unmodifiable)
72  type atmBoundaryLayerInletVelocity;
73 
74  // Mandatory/Optional (inherited) entries (unmodifiable)
75  ...
76  }
77  \endverbatim
78 
79  where the entries mean:
80  \table
81  Property | Description | Type | Reqd | Deflt
82  type | Type name: atmBoundaryLayerInletVelocity | word | yes | -
83  \endtable
84 
85  The inherited entries are elaborated in:
86  - \link atmBoundaryLayer.H \endlink
87  - \link inletOutletFvPatchField.H \endlink
88 
89 See also
90  - Foam::atmBoundaryLayer
91  - Foam::atmBoundaryLayerInletKFvPatchScalarField
92  - Foam::atmBoundaryLayerInletEpsilonFvPatchScalarField
93  - Foam::atmBoundaryLayerInletOmegaFvPatchScalarField
94 
95 SourceFiles
96  atmBoundaryLayerInletVelocityFvPatchVectorField.C
97 
98 \*---------------------------------------------------------------------------*/
99 
100 #ifndef atmBoundaryLayerInletVelocityFvPatchVectorField_H
101 #define atmBoundaryLayerInletVelocityFvPatchVectorField_H
102 
103 #include "fvPatchFields.H"
105 #include "atmBoundaryLayer.H"
106 
107 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
108 
109 namespace Foam
110 {
111 
112 /*---------------------------------------------------------------------------*\
113  Class atmBoundaryLayerInletVelocityFvPatchVectorField Declaration
114 \*---------------------------------------------------------------------------*/
115 
116 class atmBoundaryLayerInletVelocityFvPatchVectorField
117 :
118  public inletOutletFvPatchVectorField,
119  public atmBoundaryLayer
120 {
121 
122 public:
123 
124  //- Runtime type information
125  TypeName("atmBoundaryLayerInletVelocity");
126 
127 
128  // Constructors
129 
130  //- Construct from patch and internal field
132  (
133  const fvPatch&,
134  const DimensionedField<vector, volMesh>&
135  );
136 
137  //- Construct from patch, internal field and dictionary
139  (
140  const fvPatch&,
141  const DimensionedField<vector, volMesh>&,
142  const dictionary&
143  );
144 
145  //- Construct by mapping given
146  //- atmBoundaryLayerInletVelocityFvPatchVectorField onto a new patch
148  (
150  const fvPatch&,
151  const DimensionedField<vector, volMesh>&,
152  const fvPatchFieldMapper&
153  );
154 
155  //- Construct as copy setting internal field reference
157  (
160  );
161 
162  //- Return a clone
163  virtual tmp<fvPatchField<vector>> clone() const
164  {
165  return fvPatchField<vector>::Clone(*this);
166  }
167 
168  //- Clone with an internal field reference
170  (
172  ) const
173  {
174  return fvPatchField<vector>::Clone(*this, iF);
175  }
176 
177 
178  // Member Functions
179 
180  //- Update the coefficients associated with the patch field
181  virtual void updateCoeffs();
182 
183 
184  // Mapping
185 
186  //- Map (and resize as needed) from self given a mapping object
187  virtual void autoMap
188  (
189  const fvPatchFieldMapper&
190  );
191 
192  //- Reverse map the given fvPatchField onto this fvPatchField
193  virtual void rmap
194  (
195  const fvPatchVectorField&,
196  const labelList&
197  );
198 
199 
200  //- Write
201  virtual void write(Ostream&) const;
202 };
203 
204 
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 
207 } // End namespace Foam
208 
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 
211 #endif
212 
213 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
This boundary condition provides a log-law type ground-normal inlet boundary condition for the stream...
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
virtual tmp< fvPatchField< vector > > clone() const
Return a clone.
virtual void rmap(const fvPatchVectorField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
TypeName("atmBoundaryLayerInletVelocity")
Runtime type information.
atmBoundaryLayerInletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
Definition: fvPatchField.H:607
A class for managing temporary objects.
Definition: tmp.H:66
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition: List.H:61
fvPatchField< vector > fvPatchVectorField