atmOmegaWallFunctionFvPatchScalarField.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-2022 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::atmOmegaWallFunctionFvPatchScalarField
29 
30 Group
31  grpAtmWallFunctions
32 
33 Description
34  This boundary condition provides a wall constraint on the specific
35  dissipation rate (i.e. \c omega) and the turbulent kinetic energy
36  production contribution (i.e. \c G) for atmospheric boundary
37  layer modelling.
38 
39  References:
40  \verbatim
41  Theoretical expressions (tags:PGVB, B):
42  Parente, A., Gorlé, C., Van Beeck, J., & Benocci, C. (2011).
43  Improved k–ε model and wall function formulation
44  for the RANS simulation of ABL flows.
45  J. of wind engineering and industrial aerodynamics, 99(4), 267-278.
46  DOI:10.1016/j.jweia.2010.12.017
47 
48  Bredberg, J. (2000).
49  On the wall boundary condition for turbulence models.
50  Chalmers University of Technology, Depart. of Thermo and Fluid Dyn.
51  Internal Report 00/4. Sweden: Göteborg.
52  \endverbatim
53 
54  Required fields:
55  \verbatim
56  omega | Specific dissipation rate [1/s]
57  \endverbatim
58 
59 Usage
60  Example of the boundary condition specification:
61  \verbatim
62  <patchName>
63  {
64  // Mandatory entries
65  type atmOmegaWallFunction;
66  z0 <PatchFunction1<scalar>>;
67 
68  // Inherited entries
69  ...
70  }
71  \endverbatim
72 
73  where the entries mean:
74  \table
75  Property | Description | Type | Reqd | Deflt
76  type | Type name: atmOmegaWallFunction | word | yes | -
77  z0 | Surface roughness length [m] | PatchFunction1<scalar> | yes | -
78  \endtable
79 
80  The inherited entries are elaborated in:
81  - \link omegaWallFunctionFvPatchScalarField.H \endlink
82  - \link PatchFunction1.H \endlink
83 
84 SourceFiles
85  atmOmegaWallFunctionFvPatchScalarField.C
86 
87 \*---------------------------------------------------------------------------*/
88 
89 #ifndef atmOmegaWallFunctionFvPatchScalarField_H
90 #define atmOmegaWallFunctionFvPatchScalarField_H
91 
93 #include "PatchFunction1.H"
94 
95 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
96 
97 namespace Foam
98 {
99 
100 /*---------------------------------------------------------------------------*\
101  Class atmOmegaWallFunctionFvPatchScalarField Declaration
102 \*---------------------------------------------------------------------------*/
103 
104 class atmOmegaWallFunctionFvPatchScalarField
105 :
106  public omegaWallFunctionFvPatchScalarField
107 {
108 protected:
109 
110  // Protected Data
111 
112  //- Surface roughness length field [m]
113  autoPtr<PatchFunction1<scalar>> z0_;
114 
115 
116  // Protected Member Functions
118  //- Calculate the omega and G
119  virtual void calculate
120  (
122  const List<scalar>& cornerWeights,
123  const fvPatch& patch,
124  scalarField& G,
126  );
127 
128  //- Write local wall function variables
129  void writeLocalEntries(Ostream&) const;
130 
131 
132 public:
133 
134  //- Runtime type information
135  TypeName("atmOmegaWallFunction");
136 
137 
138  // Constructors
139 
140  //- Construct from patch and internal field
142  (
143  const fvPatch&,
145  );
146 
147  //- Construct from patch, internal field and dictionary
149  (
150  const fvPatch&,
152  const dictionary&
153  );
154 
155  //- Construct by mapping given
156  //- atmOmegaWallFunctionFvPatchScalarField
157  //- onto a new patch
159  (
161  const fvPatch&,
163  const fvPatchFieldMapper&
164  );
165 
166  //- Construct as copy
168  (
170  );
171 
172  //- Construct as copy setting internal field reference
174  (
177  );
178 
179  //- Return a clone
180  virtual tmp<fvPatchField<scalar>> clone() const
181  {
182  return fvPatchField<scalar>::Clone(*this);
183  }
184 
185  //- Clone with an internal field reference
187  (
189  ) const
190  {
191  return fvPatchField<scalar>::Clone(*this, iF);
192  }
193 
194 
195  //- Destructor
196  virtual ~atmOmegaWallFunctionFvPatchScalarField() = default;
197 
198 
199  // Member Functions
200 
201  // Mapping
202 
203  //- Map (and resize as needed) from self given a mapping object
204  virtual void autoMap(const fvPatchFieldMapper&);
205 
206  //- Reverse map the given fvPatchField onto this fvPatchField
207  virtual void rmap
208  (
209  const fvPatchScalarField&,
210  const labelList&
211  );
212 
214  // I-O
215 
216  //- Write
217  virtual void write(Ostream&) const;
218 };
219 
220 
221 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
223 } // End namespace Foam
224 
225 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
226 
227 #endif
228 
229 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
const fvPatch & patch() const noexcept
Return the patch.
Definition: fvPatchField.H:269
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
atmOmegaWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
This boundary condition provides a wall constraint on the specific dissipation rate (i...
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
scalarField & omega(bool init=false)
Return non-const access to the master&#39;s omega field.
void writeLocalEntries(Ostream &) const
Write local wall function variables.
Abstract base class for turbulence models (RAS, LES and laminar).
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
Definition: fvPatchField.H:597
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
fvPatchField< scalar > fvPatchScalarField
A FieldMapper for finite-volume patch fields.
virtual void calculate(const turbulenceModel &turbulence, const List< scalar > &cornerWeights, const fvPatch &patch, scalarField &G, scalarField &omega)
Calculate the omega and G.
scalarField & G(bool init=false)
Return non-const access to the master&#39;s G field.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
Info<< "Reading field U\"<< endl;volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);volScalarField rho(IOobject("rho", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), thermo.rho());volVectorField rhoU(IOobject("rhoU", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *U);volScalarField rhoE(IOobject("rhoE", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *(e+0.5 *magSqr(U)));surfaceScalarField pos(IOobject("pos", runTime.timeName(), mesh), mesh, dimensionedScalar("pos", dimless, 1.0));surfaceScalarField neg(IOobject("neg", runTime.timeName(), mesh), mesh, dimensionedScalar("neg", dimless, -1.0));surfaceScalarField phi("phi", fvc::flux(rhoU));Info<< "Creating turbulence model\"<< endl;autoPtr< compressible::turbulenceModel > turbulence(compressible::turbulenceModel::New(rho, U, phi, thermo))
Definition: createFields.H:94
TypeName("atmOmegaWallFunction")
Runtime type information.
virtual ~atmOmegaWallFunctionFvPatchScalarField()=default
Destructor.
autoPtr< PatchFunction1< scalar > > z0_
Surface roughness length field [m].
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
List< label > labelList
A List of labels.
Definition: List.H:62
virtual tmp< fvPatchField< scalar > > clone() const
Return a clone.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Namespace for OpenFOAM.