nutLowReWallFunctionFvPatchScalarField.C
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-2016 OpenFOAM Foundation
9  Copyright (C) 2019-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 \*---------------------------------------------------------------------------*/
28 
30 #include "turbulenceModel.H"
31 #include "fvPatchFieldMapper.H"
32 #include "volFields.H"
34 
35 
36 // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
37 
39 calcNut() const
40 {
41  return tmp<scalarField>::New(patch().size(), Zero);
42 }
43 
44 
45 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
46 
49 (
50  const fvPatch& p,
52 )
53 :
54  parent_bctype(p, iF)
55 {}
56 
57 
60 (
61  const this_bctype& ptf,
62  const fvPatch& p,
64  const fvPatchFieldMapper& mapper
65 )
66 :
67  parent_bctype(ptf, p, iF, mapper)
68 {}
69 
70 
73 (
74  const fvPatch& p,
76  const dictionary& dict
77 )
78 :
79  parent_bctype(p, iF, dict)
80 {}
81 
82 
85 (
86  const this_bctype& nlrwfpsf,
88 )
89 :
90  parent_bctype(nlrwfpsf, iF)
91 {}
92 
93 
94 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
95 
97 yPlus() const
98 {
99  const label patchi = patch().index();
100 
101  const auto& turbModel = db().lookupObject<turbulenceModel>
102  (
104  (
106  internalField().group()
107  )
108  );
109 
110  const scalarField& y = turbModel.y()[patchi];
111 
112  const tmp<scalarField> tnuw = turbModel.nu(patchi);
113  const scalarField& nuw = tnuw();
114 
115  const fvPatchVectorField& Uw = U(turbModel).boundaryField()[patchi];
116 
117  tmp<scalarField> tnuEff = turbModel.nuEff(patchi);
118  const scalarField& nuEff = tnuEff();
119 
120  return y*sqrt(nuEff*mag(Uw.snGrad()))/nuw;
121 }
122 
123 
125 (
126  Ostream& os
127 ) const
128 {
129  this->parent_bctype::write(os);
131 }
132 
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 namespace Foam
137 {
139  (
141  nutLowReWallFunctionFvPatchScalarField
142  );
143 }
144 
145 // ************************************************************************* //
virtual tmp< scalarField > calcNut() const
Calculate the turbulent viscosity.
dictionary dict
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:130
dimensionedScalar sqrt(const dimensionedScalar &ds)
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
void writeValueEntry(Ostream &os) const
Write *this field as a "value" entry.
Definition: fvPatchField.H:425
Abstract base class for turbulence models (RAS, LES and laminar).
Macros for easy insertion into run-time selection tables.
constexpr const char *const group
Group name for atomic constants.
virtual tmp< scalarField > yPlus() const
Calculate and return the yPlus at the boundary.
scalar y
static word groupName(StringType base, const word &group)
Create dot-delimited name.group string.
The class nutWallFunction is an abstract base class that hosts calculation methods and common functi...
fvPatchField< scalar > fvPatchScalarField
static const word propertiesName
Default name of the turbulence properties dictionary.
A FieldMapper for finite-volume patch fields.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
Definition: tmp.H:217
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
U
Definition: pEqn.H:72
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const std::string patch
OpenFOAM patch number as a std::string.
volScalarField & p
A class for managing temporary objects.
Definition: HashPtrTable.H:50
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
virtual tmp< Field< Type > > snGrad() const
Return patch-normal gradient.
nutLowReWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Namespace for OpenFOAM.
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:127