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-------------------------------------------------------------------------------
11License
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
39calcNut() const
40{
41 return tmp<scalarField>::New(patch().size(), Zero);
42}
43
44
45// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
46
47Foam::nutLowReWallFunctionFvPatchScalarField::
48nutLowReWallFunctionFvPatchScalarField
49(
50 const fvPatch& p,
52)
53:
55{}
56
57
58Foam::nutLowReWallFunctionFvPatchScalarField::
59nutLowReWallFunctionFvPatchScalarField
60(
62 const fvPatch& p,
64 const fvPatchFieldMapper& mapper
65)
66:
67 nutWallFunctionFvPatchScalarField(ptf, p, iF, mapper)
68{}
69
70
71Foam::nutLowReWallFunctionFvPatchScalarField::
72nutLowReWallFunctionFvPatchScalarField
73(
74 const fvPatch& p,
76 const dictionary& dict
77)
78:
80{}
81
82
83Foam::nutLowReWallFunctionFvPatchScalarField::
84nutLowReWallFunctionFvPatchScalarField
85(
87)
88:
90{}
91
92
93Foam::nutLowReWallFunctionFvPatchScalarField::
94nutLowReWallFunctionFvPatchScalarField
95(
98)
99:
101{}
102
103
104// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
105
107yPlus() const
108{
109 const label patchi = patch().index();
110
111 const auto& turbModel = db().lookupObject<turbulenceModel>
112 (
114 (
116 internalField().group()
117 )
118 );
119
120 const scalarField& y = turbModel.y()[patchi];
121
122 const tmp<scalarField> tnuw = turbModel.nu(patchi);
123 const scalarField& nuw = tnuw();
124
125 const fvPatchVectorField& Uw = U(turbModel).boundaryField()[patchi];
126
127 tmp<scalarField> tnuEff = turbModel.nuEff(patchi);
128 const scalarField& nuEff = tnuEff();
129
130 return y*sqrt(nuEff*mag(Uw.snGrad()))/nuw;
131}
132
133
135(
136 Ostream& os
137) const
138{
140 writeEntry("value", os);
141}
142
143
144// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145
146namespace Foam
147{
149 (
152 );
153}
154
155// ************************************************************************* //
scalar y
Macros for easy insertion into run-time selection tables.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
static word groupName(StringType base, const word &group)
Create dot-delimited name.group string.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Definition: Time.C:717
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
virtual bool write()
Write the output fields.
A FieldMapper for finite-volume patch fields.
virtual tmp< Field< Type > > snGrad() const
Return patch-normal gradient.
Definition: fvPatchField.C:229
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:71
This boundary condition provides a simple wrapper around a zero fixed-value condition for the turbule...
virtual tmp< scalarField > yPlus() const
Calculate and return the yPlus at the boundary.
virtual tmp< scalarField > calcNut() const
Calculate the turbulent viscosity.
The class nutWallFunction is an abstract base class that hosts calculation methods and common functi...
A class for managing temporary objects.
Definition: tmp.H:65
Abstract base class for turbulence models (RAS, LES and laminar).
static const word propertiesName
Default name of the turbulence properties dictionary.
U
Definition: pEqn.H:72
volScalarField & p
OBJstream os(runTime.globalPath()/outputName)
#define makePatchTypeField(PatchTypeField, typePatchTypeField)
Definition: fvPatchField.H:676
Namespace for OpenFOAM.
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
dictionary dict