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 {
122  typedef inletOutletFvPatchVectorField parent_bctype;
123 
124 public:
125 
126  //- Runtime type information
127  TypeName("atmBoundaryLayerInletVelocity");
128 
129 
130  // Constructors
131 
132  //- Construct from patch and internal field
134  (
135  const fvPatch&,
136  const DimensionedField<vector, volMesh>&
137  );
138 
139  //- Construct from patch, internal field and dictionary
141  (
142  const fvPatch&,
143  const DimensionedField<vector, volMesh>&,
144  const dictionary&
145  );
146 
147  //- Construct by mapping onto a new patch
149  (
150  const this_bctype&,
151  const fvPatch&,
152  const DimensionedField<vector, volMesh>&,
153  const fvPatchFieldMapper&
154  );
156  //- Construct as copy setting internal field reference
158  (
159  const this_bctype&,
161  );
162 
163  //- No copy without an internal field
165  (
166  const this_bctype&
167  ) = delete;
168 
169  //- Clone with an internal field reference
171  (
173  ) const
174  {
175  return fvPatchField<vector>::Clone(*this, iF);
176  }
177 
178 
179  // Member Functions
180 
181  //- Update the coefficients associated with the patch field
182  virtual void updateCoeffs();
183 
184 
185  // Mapping
186 
187  //- Map (and resize as needed) from self given a mapping object
188  virtual void autoMap
189  (
190  const fvPatchFieldMapper&
191  );
192 
193  //- Reverse map the given fvPatchField onto this fvPatchField
194  virtual void rmap
195  (
196  const fvPatchVectorField&,
197  const labelList&
198  );
199 
200 
201  //- Write
202  virtual void write(Ostream&) const;
203 
204 
205  // Member Operators
206 
207  //- Inherit assignment
208  using parent_bctype::operator=;
209 };
210 
211 
212 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
213 
214 } // End namespace Foam
215 
216 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
217 
218 #endif
219 
220 // ************************************************************************* //
virtual tmp< fvPatchField< vector > > clone(const DimensionedField< vector, volMesh > &iF) const
Clone with an internal field reference.
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
Definition: fvPatchField.H:635
virtual void rmap(const fvPatchVectorField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
A FieldMapper for finite-volume patch fields.
TypeName("atmBoundaryLayerInletVelocity")
Runtime type information.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
atmBoundaryLayerInletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
This boundary condition provides a log-law type ground-normal inlet boundary condition for the stream...
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Namespace for OpenFOAM.