alphatWallFunctionIncompFvPatchScalarField.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 | Copyright (C) 2011-2016 OpenFOAM Foundation
6  \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
27 #include "fvPatchFieldMapper.H"
28 #include "volFields.H"
29 #include "addToRunTimeSelectionTable.H"
30 
31 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
35 namespace incompressible
36 {
37 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
38 
41  const fvPatch& p,
42  const DimensionedField<scalar, volMesh>& iF)
43  : fixedValueFvPatchScalarField(p, iF),
44  Prt_(0.85)
45 {
46 }
47 
51  const fvPatch& p,
52  const DimensionedField<scalar, volMesh>& iF,
53  const fvPatchFieldMapper& mapper)
54  : fixedValueFvPatchScalarField(ptf, p, iF, mapper)
55 {
56 }
57 
60  const fvPatch& p,
61  const DimensionedField<scalar, volMesh>& iF,
62  const dictionary& dict)
63  : fixedValueFvPatchScalarField(p, iF, dict),
64  Prt_(dict.get<scalar>("Prt")) // force read to avoid ambiguity
65 {
66 }
67 
71  : fixedValueFvPatchScalarField(wfpsf)
72 {
73 }
74 
78  const DimensionedField<scalar, volMesh>& iF)
79  : fixedValueFvPatchScalarField(wfpsf, iF)
80 {
81 }
82 
83 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
84 
86 {
87  if (updated())
88  {
89  return;
90  }
91 
92  const label patchi = patch().index();
93 
94  // Retrieve turbulence properties from model
95 
96  const turbulenceModel& turbModel = db().lookupObject<turbulenceModel>(
97  IOobject::groupName(
98  turbulenceModel::propertiesName,
99  internalField().group()));
100 
101  const tmp<scalarField> tnutw = turbModel.nut(patchi);
102 
103  operator==(tnutw / Prt_);
104 
105  fixedValueFvPatchField<scalar>::updateCoeffs();
106 }
107 
109 {
110  fvPatchField<scalar>::write(os);
111  os.writeEntry("Prt", Prt_);
112  writeEntry("value", os);
113 }
114 
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 
118  fvPatchScalarField,
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 } // End namespace incompressible
124 } // End namespace Foam
125 
126 // ************************************************************************* //
Foam::incompressible::alphatWallFunctionIncompressibleFvPatchScalarField::Prt_
scalar Prt_
Definition: alphatWallFunctionIncompFvPatchScalarField.H:65
p
volScalarField & p
Definition: createRefsPimpleDyM.H:6
Foam::incompressible::makePatchTypeField
makePatchTypeField(fvPatchScalarField, alphatWallFunctionIncompressibleFvPatchScalarField)
Foam::incompressible::alphatWallFunctionIncompressibleFvPatchScalarField::updateCoeffs
virtual void updateCoeffs()
Definition: alphatWallFunctionIncompFvPatchScalarField.C:85
Foam
Definition: checkGeometry.C:32
alphatWallFunctionIncompFvPatchScalarField.H
Foam::incompressible::alphatWallFunctionIncompressibleFvPatchScalarField::write
virtual void write(Ostream &) const
Definition: alphatWallFunctionIncompFvPatchScalarField.C:108
Foam::incompressible::alphatWallFunctionIncompressibleFvPatchScalarField::alphatWallFunctionIncompressibleFvPatchScalarField
alphatWallFunctionIncompressibleFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Definition: alphatWallFunctionIncompFvPatchScalarField.C:40
Foam::incompressible::alphatWallFunctionIncompressibleFvPatchScalarField
Definition: alphatWallFunctionIncompFvPatchScalarField.H:58