Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
10License
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"
31#include "wallFvPatch.H"
32
33// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34
35namespace Foam
36{
39
40const Foam::word Foam::turbulenceModel::propertiesName("turbulenceProperties");
41
42
43// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
44
45Foam::turbulenceModel::turbulenceModel
46(
47 const volVectorField& U,
48 const surfaceScalarField& alphaRhoPhi,
50 const word& propertiesName
51)
52:
54 (
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),
71 y_(mesh_)
72{}
73
74
75// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
80}
81
84{
85 return regIOobject::read();
87
88
90{}
91
92
94{
95 if (mesh_.changing())
96 {
97 y_.correct();
98 }
99}
100
101
102// ************************************************************************* //
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
IOdictionary(const IOobject &io, const dictionary *fallback=nullptr)
Construct given an IOobject and optional fallback dictionary content.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition IOobject.H:191
const objectRegistry & db() const noexcept
Return the local objectRegistry.
Definition IOobject.C:450
static word group(const word &name)
Return group (extension part of name).
Definition IOobject.C:300
static word groupName(StringType base, const word &group)
Create dot-delimited name.group string.
virtual bool read()
Read object.
A class for managing temporary objects.
Definition tmp.H:75
Abstract base class for turbulence models (RAS, LES and laminar).
const volVectorField & U() const
Access function to velocity field.
static const word propertiesName
Default name of the turbulence properties dictionary.
const surfaceScalarField & alphaRhoPhi() const
Access function to phase flux field.
const Time & time() const
nearWallDist y_
Near wall distance boundary field.
virtual void validate()
Validate the turbulence fields after construction.
const surfaceScalarField & phi_
virtual bool read()=0
Read model coefficients if they have changed.
const volVectorField & U_
virtual void correct()=0
Solve the turbulence equations and correct the turbulence viscosity.
const fvMesh & mesh() const
const surfaceScalarField & alphaRhoPhi_
virtual tmp< surfaceScalarField > phi() const
Return the volumetric flux field.
A class for handling words, derived from Foam::string.
Definition word.H:66
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition className.H:142
U
Definition pEqn.H:72
dynamicFvMesh & mesh
Different types of constants.
Namespace for OpenFOAM.
GeometricField< vector, fvPatchField, volMesh > volVectorField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Foam::surfaceFields.