ReynoldsStress.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) 2015-2016 OpenFOAM Foundation
9 Copyright (C) 2019-2022 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::ReynoldsStress
29
30Group
31 grpTurbulence
32
33Description
34 Reynolds-stress turbulence model base class
35
36 Reference:
37 \verbatim
38 Realizability conditions (tag:S):
39 Schumann, U. (1977).
40 Realizability of Reynolds‐stress turbulence models.
41 The Physics of Fluids, 20(5), 721-725.
42 DOI:10.1063/1.861942
43 \endverbatim
44
45SourceFiles
46 ReynoldsStress.C
47
48\*---------------------------------------------------------------------------*/
49
50#ifndef ReynoldsStress_H
51#define ReynoldsStress_H
52
53// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54
55namespace Foam
56{
57
58/*---------------------------------------------------------------------------*\
59 Class ReynoldsStress Declaration
60\*---------------------------------------------------------------------------*/
61
62template<class BasicTurbulenceModel>
64:
65 public BasicTurbulenceModel
66{
67
68protected:
69
70 // Protected data
71
72 // Model coefficients
75
76 // Fields
80
81
82 // Protected Member Functions
83
87
88 //- Update the eddy-viscosity
89 virtual void correctNut() = 0;
90
91 //- Return the source term for the momentum equation
92 template<class RhoFieldType>
94 (
95 const RhoFieldType& rho,
97 ) const;
98
99
100public:
102 typedef typename BasicTurbulenceModel::alphaField alphaField;
103 typedef typename BasicTurbulenceModel::rhoField rhoField;
104 typedef typename BasicTurbulenceModel::transportModel transportModel;
105
106
107 // Constructors
108
109 //- Construct from components
111 (
112 const word& modelName,
113 const alphaField& alpha,
114 const rhoField& rho,
115 const volVectorField& U,
116 const surfaceScalarField& alphaRhoPhi,
117 const surfaceScalarField& phi,
118 const transportModel& transport,
119 const word& propertiesName
120 );
121
122
123 //- Destructor
124 virtual ~ReynoldsStress() = default;
125
126
127 // Member Functions
128
129 //- Re-read model coefficients if they have changed
130 virtual bool read() = 0;
131
132 //- Return the turbulence viscosity
133 virtual tmp<volScalarField> nut() const
134 {
135 return nut_;
136 }
137
138 //- Return the turbulence viscosity on patch
139 virtual tmp<scalarField> nut(const label patchi) const
140 {
141 return nut_.boundaryField()[patchi];
142 }
143
144 //- Return the turbulence kinetic energy
145 virtual tmp<volScalarField> k() const;
146
147 //- Return the Reynolds stress tensor
148 virtual tmp<volSymmTensorField> R() const;
149
150 //- Return the effective stress tensor
151 virtual tmp<volSymmTensorField> devRhoReff() const;
152
153 //- Return the effective stress tensor based on a given velocity field
155 (
156 const volVectorField& U
157 ) const;
158
159 //- Return the source term for the momentum equation
161
162 //- Return the source term for the momentum equation
164 (
165 const volScalarField& rho,
167 ) const;
168
169 //- Validate the turbulence fields after construction
170 // Update turbulence viscosity and other derived fields as requires
171 virtual void validate();
172
173 //- Solve the turbulence equations and correct the turbulence viscosity
174 virtual void correct() = 0;
175};
176
177
178// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179
180} // End namespace Foam
181
182// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183
184#ifdef NoRepository
185 #include "ReynoldsStress.C"
186#endif
187
188// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189
190#endif
191
192// ************************************************************************* //
surfaceScalarField & phi
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Reynolds-stress turbulence model base class.
BasicTurbulenceModel::alphaField alphaField
virtual tmp< volSymmTensorField > R() const
Return the Reynolds stress tensor.
void boundNormalStress(volSymmTensorField &R) const
BasicTurbulenceModel::rhoField rhoField
virtual tmp< scalarField > nut(const label patchi) const
Return the turbulence viscosity on patch.
virtual tmp< volScalarField > k() const
Return the turbulence kinetic energy.
virtual void validate()
Validate the turbulence fields after construction.
volScalarField nut_
virtual bool read()=0
Re-read model coefficients if they have changed.
virtual tmp< fvVectorMatrix > divDevRhoReff(volVectorField &U) const
Return the source term for the momentum equation.
virtual ~ReynoldsStress()=default
Destructor.
virtual tmp< volScalarField > nut() const
Return the turbulence viscosity.
tmp< fvVectorMatrix > DivDevRhoReff(const RhoFieldType &rho, volVectorField &U) const
Return the source term for the momentum equation.
virtual void correctNut()=0
Update the eddy-viscosity.
virtual void correct()=0
Solve the turbulence equations and correct the turbulence viscosity.
volSymmTensorField R_
BasicTurbulenceModel::transportModel transportModel
virtual tmp< volSymmTensorField > devRhoReff() const
Return the effective stress tensor.
dimensionedScalar couplingFactor_
void correctWallShearStress(volSymmTensorField &R) const
void checkRealizabilityConditions(const volSymmTensorField &R) const
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