atmAlphatkWallFunctionFvPatchScalarField.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) 2020 ENERCON GmbH
9  Copyright (C) 2020-2021 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::atmAlphatkWallFunctionFvPatchScalarField
29 
30 Group
31  grpAtmWallFunctions
32 
33 Description
34  This boundary condition provides a wall constraint on the kinematic
35  turbulent thermal conductivity (i.e. \c alphat) for atmospheric boundary
36  layer modelling. It assumes a logarithmic distribution of the potential
37  temperature within the first cell.
38 
39  Required fields:
40  \verbatim
41  alphat | Kinematic turbulent thermal conductivity [m2/s]
42  \endverbatim
43 
44 Usage
45  Example of the boundary condition specification:
46  \verbatim
47  <patchName>
48  {
49  // Mandatory entries (unmodifiable)
50  type atmAlphatkWallFunction;
51 
52  // Mandatory entries (runtime modifiable)
53  Pr 0.90;
54  Prt uniform 0.85;
55  z0 uniform 0.001;
56 
57  // Optional entries (unmodifiable)
58  Cmu 0.09;
59  kappa 0.41;
60 
61  // Optional (inherited) entries
62  ...
63  }
64  \endverbatim
65 
66  where the entries mean:
67  \table
68  Property | Description | Type | Reqd | Dflt
69  type | Type name: atmAlphatkWallFunction | word | yes | -
70  Pr | Molecular Prandtl number | Function1<scalar> | yes | -
71  Prt | Turbulent Prandtl number | PatchFunction1<scalar> | yes | -
72  z0 | Surface roughness length [m] | PatchFunction1<scalar> | yes | -
73  Cmu | Empirical model constant | scalar | no | 0.09
74  kappa | von Kármán constant | scalar | no | 0.41
75  \endtable
76 
77  The inherited entries are elaborated in:
78  - \link fixedValueFvPatchField.H \endlink
79  - \link Function1.H \endlink
80  - \link PatchFunction1.H \endlink
81 
82 See also
83  - Foam::fixedValueFvPatchField
84 
85 SourceFiles
86  atmAlphatkWallFunctionFvPatchScalarField.C
87 
88 \*---------------------------------------------------------------------------*/
89 
90 #ifndef atmAlphatkWallFunctionFvPatchScalarField_H
91 #define atmAlphatkWallFunctionFvPatchScalarField_H
92 
94 #include "Function1.H"
95 #include "PatchFunction1.H"
96 
97 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
98 
99 namespace Foam
100 {
101 
102 class turbulenceModel;
103 
104 /*---------------------------------------------------------------------------*\
105  Class atmAlphatkWallFunctionFvPatchScalarField Declaration
106 \*---------------------------------------------------------------------------*/
107 
108 class atmAlphatkWallFunctionFvPatchScalarField
109 :
110  public fixedValueFvPatchScalarField
111 {
112 protected:
113 
114  // Protected Data
115 
116  //- Empirical model constant
117  const scalar Cmu_;
118 
119  //- von Kármán constant
120  const scalar kappa_;
121 
122  //- Molecular Prandtl number
123  autoPtr<Function1<scalar>> Pr_;
124 
125  //- Turbulent Prandtl number field
126  autoPtr<PatchFunction1<scalar>> Prt_;
127 
128  //- Surface roughness length [m]
129  autoPtr<PatchFunction1<scalar>> z0_;
130 
131 
132  //- Solution parameters
133 
134  static scalar tolerance_;
135  static label maxIters_;
136 
137 
138  // Protected Member Functions
139 
140  //- Check the type of the patch
141  virtual void checkType();
142 
143 
144 public:
145 
146  //- Runtime type information
147  TypeName("atmAlphatkWallFunction");
148 
149 
150  // Constructors
151 
152  //- Construct from patch and internal field
154  (
155  const fvPatch&,
157  );
158 
159  //- Construct from patch, internal field and dictionary
161  (
162  const fvPatch&,
164  const dictionary&
165  );
166 
167  //- Construct by mapping given
168  //- atmAlphatkWallFunctionFvPatchScalarField
169  //- onto a new patch
171  (
173  const fvPatch&,
176  );
177 
178  //- Construct as copy
180  (
182  );
183 
184  //- Construct and return a clone
185  virtual tmp<fvPatchScalarField> clone() const
186  {
188  (
190  );
191  }
192 
193  //- Construct as copy setting internal field reference
195  (
198  );
199 
200  //- Construct and return a clone setting internal field reference
202  (
204  ) const
205  {
207  (
209  );
210  }
211 
212 
213  // Member Functions
214 
215  // Evaluation
216 
217  //- Update the coefficients associated with the patch field
218  virtual void updateCoeffs();
219 
220 
221  // Mapping
222 
223  //- Map (and resize as needed) from self given a mapping object
224  virtual void autoMap(const fvPatchFieldMapper&);
225 
226  //- Reverse map the given fvPatchField onto this fvPatchField
227  virtual void rmap
228  (
229  const fvPatchScalarField&,
230  const labelList&
231  );
232 
233 
234  // I-O
235 
236  //- Write
237  virtual void write(Ostream&) const;
238 };
239 
240 
241 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
242 
243 } // End namespace Foam
244 
245 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
246 
247 #endif
248 
249 // ************************************************************************* //
Foam::fvPatchField< scalar >
Foam::atmAlphatkWallFunctionFvPatchScalarField::atmAlphatkWallFunctionFvPatchScalarField
atmAlphatkWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: atmAlphatkWallFunctionFvPatchScalarField.C:68
Foam::atmAlphatkWallFunctionFvPatchScalarField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: atmAlphatkWallFunctionFvPatchScalarField.C:176
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Function1.H
PatchFunction1.H
Foam::atmAlphatkWallFunctionFvPatchScalarField::clone
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
Definition: atmAlphatkWallFunctionFvPatchScalarField.H:226
Foam::atmAlphatkWallFunctionFvPatchScalarField::Cmu_
const scalar Cmu_
Empirical model constant.
Definition: atmAlphatkWallFunctionFvPatchScalarField.H:158
Foam::atmAlphatkWallFunctionFvPatchScalarField::write
virtual void write(Ostream &) const
Write.
Definition: atmAlphatkWallFunctionFvPatchScalarField.C:287
Foam::atmAlphatkWallFunctionFvPatchScalarField::Prt_
autoPtr< PatchFunction1< scalar > > Prt_
Turbulent Prandtl number field.
Definition: atmAlphatkWallFunctionFvPatchScalarField.H:167
Foam::atmAlphatkWallFunctionFvPatchScalarField::checkType
virtual void checkType()
Check the type of the patch.
Definition: atmAlphatkWallFunctionFvPatchScalarField.C:50
Foam::atmAlphatkWallFunctionFvPatchScalarField::tolerance_
static scalar tolerance_
Solution parameters.
Definition: atmAlphatkWallFunctionFvPatchScalarField.H:175
Foam::compressible::turbulenceModel
ThermalDiffusivity< CompressibleTurbulenceModel< fluidThermo > > turbulenceModel
Definition: turbulentFluidThermoModel.H:63
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::atmAlphatkWallFunctionFvPatchScalarField::TypeName
TypeName("atmAlphatkWallFunction")
Runtime type information.
Foam::atmAlphatkWallFunctionFvPatchScalarField::z0_
autoPtr< PatchFunction1< scalar > > z0_
Surface roughness length [m].
Definition: atmAlphatkWallFunctionFvPatchScalarField.H:170
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::atmAlphatkWallFunctionFvPatchScalarField::rmap
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: atmAlphatkWallFunctionFvPatchScalarField.C:272
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::List< label >
Foam::atmAlphatkWallFunctionFvPatchScalarField::Pr_
autoPtr< Function1< scalar > > Pr_
Molecular Prandtl number.
Definition: atmAlphatkWallFunctionFvPatchScalarField.H:164
fixedValueFvPatchFields.H
Foam::atmAlphatkWallFunctionFvPatchScalarField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: atmAlphatkWallFunctionFvPatchScalarField.C:261
Foam::atmAlphatkWallFunctionFvPatchScalarField
This boundary condition provides a wall constraint on the kinematic turbulent thermal conductivity (i...
Definition: atmAlphatkWallFunctionFvPatchScalarField.H:149
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
Foam::atmAlphatkWallFunctionFvPatchScalarField::kappa_
const scalar kappa_
von Kármán constant
Definition: atmAlphatkWallFunctionFvPatchScalarField.H:161
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54
Foam::atmAlphatkWallFunctionFvPatchScalarField::maxIters_
static label maxIters_
Definition: atmAlphatkWallFunctionFvPatchScalarField.H:176