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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2017 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 #include "turbulenceModel.H"
29 #include "volFields.H"
30 #include "surfaceFields.H"
31 #include "wallFvPatch.H"
32 
33 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34 
35 namespace Foam
36 {
38 }
39 
40 const Foam::word Foam::turbulenceModel::propertiesName("turbulenceProperties");
41 
42 
43 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
44 
45 Foam::turbulenceModel::turbulenceModel
46 (
47  const volVectorField& U,
48  const surfaceScalarField& alphaRhoPhi,
49  const surfaceScalarField& phi,
50  const word& propertiesName
51 )
52 :
53  IOdictionary
54  (
55  IOobject
56  (
57  IOobject::groupName(propertiesName, alphaRhoPhi.group()),
58  U.time().constant(),
59  U.db(),
60  IOobject::MUST_READ_IF_MODIFIED,
61  IOobject::NO_WRITE
62  )
63  ),
64 
65  runTime_(U.time()),
66  mesh_(U.mesh()),
67 
68  U_(U),
69  alphaRhoPhi_(alphaRhoPhi),
70  phi_(phi),
71  y_(mesh_)
72 {}
73 
74 
75 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
76 
78 {
79  return phi_;
80 }
81 
82 
84 {
85  return regIOobject::read();
86 }
87 
88 
90 {}
91 
92 
94 {
95  if (mesh_.changing())
96  {
97  y_.correct();
98  }
99 }
100 
101 
102 // ************************************************************************* //
Foam::surfaceFields.
virtual void validate()
Validate the turbulence fields after construction.
const surfaceScalarField & phi_
virtual bool read()
Read object.
ThermalDiffusivity< CompressibleTurbulenceModel< fluidThermo > > turbulenceModel
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:82
constexpr const char *const group
Group name for atomic constants.
virtual tmp< surfaceScalarField > phi() const
Return the volumetric flux field.
dynamicFvMesh & mesh
static const word propertiesName
Default name of the turbulence properties dictionary.
A class for handling words, derived from Foam::string.
Definition: word.H:63
virtual void correct()=0
Solve the turbulence equations and correct the turbulence viscosity.
defineTypeNameAndDebug(combustionModel, 0)
U
Definition: pEqn.H:72
A class for managing temporary objects.
Definition: HashPtrTable.H:50
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
virtual bool read()=0
Read model coefficients if they have changed.
Namespace for OpenFOAM.