turbulenceModel.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-2014 OpenFOAM Foundation
6  \\/ M anipulation |
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 
26 #include "turbulenceModel.H"
27 #include "volFields.H"
28 #include "surfaceFields.H"
29 #include "wallFvPatch.H"
30 
31 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
36 }
37 
38 const Foam::word Foam::turbulenceModel::propertiesName("turbulenceProperties");
39 
40 
41 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
42 
43 Foam::turbulenceModel::turbulenceModel
44 (
45  const volVectorField& U,
46  const surfaceScalarField& alphaRhoPhi,
47  const surfaceScalarField& phi,
48  const word& propertiesName
49 )
50 :
51  IOdictionary
52  (
53  IOobject
54  (
55  IOobject::groupName(propertiesName, U.group()),
56  U.time().constant(),
57  U.db(),
58  IOobject::MUST_READ_IF_MODIFIED,
59  IOobject::NO_WRITE
60  )
61  ),
62 
63  runTime_(U.time()),
64  mesh_(U.mesh()),
65 
66  U_(U),
67  alphaRhoPhi_(alphaRhoPhi),
68  phi_(phi),
69  y_(mesh_)
70 {}
71 
72 
73 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
74 
76 {
77  return phi_;
78 }
79 
80 
82 {
83  return regIOobject::read();
84 }
85 
86 
88 {
89  if (mesh_.changing())
90  {
91  y_.correct();
92  }
93 }
94 
95 
96 // ************************************************************************* //
Foam::surfaceFields.
virtual void correct()
Correct for mesh geom/topo changes.
Definition: nearWallDist.C:116
const char *const group
Group name for atomic constants.
const fvMesh & mesh_
bool changing() const
Is mesh changing (topology changing and/or moving)
Definition: polyMesh.H:521
virtual bool read()=0
Read model coefficients if they have changed.
virtual tmp< surfaceScalarField > phi() const
Return the volumetric flux field.
A class for handling words, derived from string.
Definition: word.H:59
dynamicFvMesh & mesh
Namespace for OpenFOAM.
ThermalDiffusivity< CompressibleTurbulenceModel< fluidThermo > > turbulenceModel
nearWallDist y_
Near wall distance boundary field.
const surfaceScalarField & phi_
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
virtual void correct()=0
Solve the turbulence equations and correct the turbulence viscosity.
virtual bool read()
Read object.
surfaceScalarField & phi
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
static const word propertiesName
Default name of the turbulence properties dictionary.
A class for managing temporary objects.
Definition: PtrList.H:118
U
Definition: pEqn.H:82
defineTypeNameAndDebug(combustionModel, 0)