eddyViscosity.H
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) 2013-2017 OpenFOAM Foundation
9 Copyright (C) 2019 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
27Class
28 Foam::eddyViscosity
29
30Group
31 grpTurbulence
32
33Description
34 Eddy viscosity turbulence model base class
35
36SourceFiles
37 eddyViscosity.C
38
39\*---------------------------------------------------------------------------*/
40
41#ifndef eddyViscosity_H
42#define eddyViscosity_H
43
44#include "linearViscousStress.H"
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
50
51/*---------------------------------------------------------------------------*\
52 Class eddyViscosity Declaration
53\*---------------------------------------------------------------------------*/
54
55template<class BasicTurbulenceModel>
56class eddyViscosity
57:
58 public linearViscousStress<BasicTurbulenceModel>
59{
60
61protected:
62
63 // Protected data
64
65 // Fields
68
69
70 // Protected Member Functions
72 virtual void correctNut() = 0;
73
74
75public:
77 typedef typename BasicTurbulenceModel::alphaField alphaField;
78 typedef typename BasicTurbulenceModel::rhoField rhoField;
79 typedef typename BasicTurbulenceModel::transportModel transportModel;
80
81
82 // Constructors
83
84 //- Construct from components
86 (
87 const word& modelName,
88 const alphaField& alpha,
89 const rhoField& rho,
90 const volVectorField& U,
91 const surfaceScalarField& alphaRhoPhi,
93 const transportModel& transport,
94 const word& propertiesName
95 );
96
97
98 //- Destructor
99 virtual ~eddyViscosity() = default;
100
101
102 // Member Functions
103
104 //- Re-read model coefficients if they have changed
105 virtual bool read() = 0;
106
107 //- Return the turbulence viscosity
108 virtual tmp<volScalarField> nut() const
109 {
110 return nut_;
111 }
112
113 //- Return the turbulence viscosity on patch
114 virtual tmp<scalarField> nut(const label patchi) const
115 {
116 return nut_.boundaryField()[patchi];
117 }
118
119 //- Return the turbulence kinetic energy
120 virtual tmp<volScalarField> k() const = 0;
121
122 //- Return the Reynolds stress tensor
123 virtual tmp<volSymmTensorField> R() const;
124
125 //- Validate the turbulence fields after construction
126 // Update turbulence viscosity and other derived fields as requires
127 virtual void validate();
128
129 //- Solve the turbulence equations and correct the turbulence viscosity
130 virtual void correct() = 0;
131};
132
133
134// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135
136} // End namespace Foam
137
138// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139
140#ifdef NoRepository
141 #include "eddyViscosity.C"
142#endif
143
144// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145
146#endif
147
148// ************************************************************************* //
surfaceScalarField & phi
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Eddy viscosity turbulence model base class.
Definition: eddyViscosity.H:58
BasicTurbulenceModel::alphaField alphaField
Definition: eddyViscosity.H:76
virtual tmp< volSymmTensorField > R() const
Return the Reynolds stress tensor.
Definition: eddyViscosity.C:85
BasicTurbulenceModel::rhoField rhoField
Definition: eddyViscosity.H:77
virtual tmp< volScalarField > k() const =0
Return the turbulence kinetic energy.
virtual tmp< scalarField > nut(const label patchi) const
Return the turbulence viscosity on patch.
virtual void validate()
Validate the turbulence fields after construction.
volScalarField nut_
Definition: eddyViscosity.H:66
virtual bool read()=0
Re-read model coefficients if they have changed.
Definition: eddyViscosity.C:77
virtual tmp< volScalarField > nut() const
Return the turbulence viscosity.
virtual void correctNut()=0
virtual void correct()=0
Solve the turbulence equations and correct the turbulence viscosity.
BasicTurbulenceModel::transportModel transportModel
Definition: eddyViscosity.H:78
virtual ~eddyViscosity()=default
Destructor.
Linear viscous stress turbulence model base class.
A class for managing temporary objects.
Definition: tmp.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
U
Definition: pEqn.H:72
Namespace for OpenFOAM.
volScalarField & alpha