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 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 (unmodifiable)
65  type atmOmegaWallFunction;
66 
67  // Mandatory entries (runtime modifiable)
68  z0 uniform 0.001;
69 
70  // Optional (inherited) entries
71  ...
72  }
73  \endverbatim
74 
75  where the entries mean:
76  \table
77  Property | Description | Type | Reqd | Dflt
78  type | Type name: atmOmegaWallFunction | word | yes | -
79  z0 | Surface roughness length [m] | PatchFunction1<scalar> | yes | -
80  \endtable
81 
82  The inherited entries are elaborated in:
83  - \link omegaWallFunctionFvPatchScalarField.H \endlink
84  - \link PatchFunction1.H \endlink
85 
86 See also
87  - Foam::omegaWallFunctionFvPatchScalarField
88 
89 SourceFiles
90  atmOmegaWallFunctionFvPatchScalarField.C
91 
92 \*---------------------------------------------------------------------------*/
93 
94 #ifndef atmOmegaWallFunctionFvPatchScalarField_H
95 #define atmOmegaWallFunctionFvPatchScalarField_H
96 
98 #include "PatchFunction1.H"
99 
100 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
101 
102 namespace Foam
103 {
104 
105 /*---------------------------------------------------------------------------*\
106  Class atmOmegaWallFunctionFvPatchScalarField Declaration
107 \*---------------------------------------------------------------------------*/
108 
109 class atmOmegaWallFunctionFvPatchScalarField
110 :
111  public omegaWallFunctionFvPatchScalarField
112 {
113 protected:
114 
115  // Protected Data
116 
117  //- Surface roughness length field [m]
118  autoPtr<PatchFunction1<scalar>> z0_;
119 
120 
121  // Protected Member Functions
122 
123  //- Calculate the omega and G
124  virtual void calculate
125  (
127  const List<scalar>& cornerWeights,
128  const fvPatch& patch,
129  scalarField& G,
131  );
132 
133 
134 public:
135 
136  //- Runtime type information
137  TypeName("atmOmegaWallFunction");
138 
139 
140  // Constructors
141 
142  //- Construct from patch and internal field
144  (
145  const fvPatch&,
147  );
148 
149  //- Construct from patch, internal field and dictionary
151  (
152  const fvPatch&,
154  const dictionary&
155  );
156 
157  //- Construct by mapping given
158  //- atmOmegaWallFunctionFvPatchScalarField
159  //- onto a new patch
161  (
163  const fvPatch&,
165  const fvPatchFieldMapper&
166  );
167 
168  //- Construct as copy
170  (
172  );
173 
174  //- Construct and return a clone
175  virtual tmp<fvPatchScalarField> clone() const
176  {
178  (
180  );
181  }
182 
183  //- Construct as copy setting internal field reference
185  (
188  );
189 
190  //- Construct and return a clone setting internal field reference
192  (
194  ) const
195  {
197  (
199  );
200  }
201 
202 
203  //- Destructor
204  virtual ~atmOmegaWallFunctionFvPatchScalarField() = default;
205 
206 
207  // Member Functions
208 
209  // Mapping
210 
211  //- Map (and resize as needed) from self given a mapping object
212  virtual void autoMap(const fvPatchFieldMapper&);
213 
214  //- Reverse map the given fvPatchField onto this fvPatchField
215  virtual void rmap
216  (
217  const fvPatchScalarField&,
218  const labelList&
219  );
220 
221 
222  // I-O
223 
224  //- Write
225  virtual void write(Ostream&) const;
226 };
227 
228 
229 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
230 
231 } // End namespace Foam
232 
233 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
234 
235 #endif
236 
237 // ************************************************************************* //
Foam::fvPatchField< scalar >
Foam::atmOmegaWallFunctionFvPatchScalarField::write
virtual void write(Ostream &) const
Write.
Definition: atmOmegaWallFunctionFvPatchScalarField.C:195
Foam::atmOmegaWallFunctionFvPatchScalarField::atmOmegaWallFunctionFvPatchScalarField
atmOmegaWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: atmOmegaWallFunctionFvPatchScalarField.C:107
Foam::omegaWallFunctionFvPatchScalarField
This boundary condition provides a wall constraint on the specific dissipation rate,...
Definition: omegaWallFunctionFvPatchScalarField.H:291
turbulence
Info<< "Reading field U\n"<< 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\n"<< endl;autoPtr< compressible::turbulenceModel > turbulence(compressible::turbulenceModel::New(rho, U, phi, thermo))
Definition: createFields.H:94
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
PatchFunction1.H
Foam::atmOmegaWallFunctionFvPatchScalarField
This boundary condition provides a wall constraint on the specific dissipation rate (i....
Definition: atmOmegaWallFunctionFvPatchScalarField.H:126
Foam::atmOmegaWallFunctionFvPatchScalarField::rmap
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: atmOmegaWallFunctionFvPatchScalarField.C:180
Foam::omegaWallFunctionFvPatchScalarField::omega
scalarField & omega(bool init=false)
Return non-const access to the master's omega field.
Definition: omegaWallFunctionFvPatchScalarField.C:470
Foam::atmOmegaWallFunctionFvPatchScalarField::z0_
autoPtr< PatchFunction1< scalar > > z0_
Surface roughness length field [m].
Definition: atmOmegaWallFunctionFvPatchScalarField.H:135
Foam::atmOmegaWallFunctionFvPatchScalarField::calculate
virtual void calculate(const turbulenceModel &turbulence, const List< scalar > &cornerWeights, const fvPatch &patch, scalarField &G, scalarField &omega)
Calculate the omega and G.
Definition: atmOmegaWallFunctionFvPatchScalarField.C:38
Foam::Field< scalar >
Foam::atmOmegaWallFunctionFvPatchScalarField::clone
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
Definition: atmOmegaWallFunctionFvPatchScalarField.H:192
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::turbulenceModel
Abstract base class for turbulence models (RAS, LES and laminar).
Definition: turbulenceModel.H:63
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::atmOmegaWallFunctionFvPatchScalarField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: atmOmegaWallFunctionFvPatchScalarField.C:170
Foam::atmOmegaWallFunctionFvPatchScalarField::~atmOmegaWallFunctionFvPatchScalarField
virtual ~atmOmegaWallFunctionFvPatchScalarField()=default
Destructor.
Foam::atmOmegaWallFunctionFvPatchScalarField::TypeName
TypeName("atmOmegaWallFunction")
Runtime type information.
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::List< scalar >
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::fvPatchField< scalar >::patch
const fvPatch & patch() const
Return patch.
Definition: fvPatchField.H:357
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54
omegaWallFunctionFvPatchScalarField.H
Foam::omegaWallFunctionFvPatchScalarField::G
scalarField & G(bool init=false)
Return non-const access to the master's G field.
Definition: omegaWallFunctionFvPatchScalarField.C:451