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 | Copyright (C) 2015-2016 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 Class
25  Foam::ReynoldsStress
26 
27 Group
28  grpTurbulence
29 
30 Description
31  Reynolds-stress turbulence model base class
32 
33 SourceFiles
34  ReynoldsStress.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef ReynoldsStress_H
39 #define ReynoldsStress_H
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class ReynoldsStress Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 template<class BasicTurbulenceModel>
51 class ReynoldsStress
52 :
53  public BasicTurbulenceModel
54 {
55 
56 protected:
57 
58  // Protected data
59 
60  // Model coefficients
61 
63 
64  // Fields
65 
68 
69 
70  // Protected Member Functions
71 
74 
75  //- Update the eddy-viscosity
76  virtual void correctNut() = 0;
77 
78  //- Return the source term for the momentum equation
79  template<class RhoFieldType>
81  (
82  const RhoFieldType& rho,
84  ) const;
85 
86 
87 public:
88 
89  typedef typename BasicTurbulenceModel::alphaField alphaField;
90  typedef typename BasicTurbulenceModel::rhoField rhoField;
91  typedef typename BasicTurbulenceModel::transportModel transportModel;
92 
93 
94  // Constructors
95 
96  //- Construct from components
98  (
99  const word& modelName,
100  const alphaField& alpha,
101  const rhoField& rho,
102  const volVectorField& U,
103  const surfaceScalarField& alphaRhoPhi,
104  const surfaceScalarField& phi,
105  const transportModel& transport,
106  const word& propertiesName
107  );
108 
109 
110  //- Destructor
111  virtual ~ReynoldsStress()
112  {}
113 
114 
115  // Member Functions
116 
117  //- Re-read model coefficients if they have changed
118  virtual bool read() = 0;
119 
120  //- Return the turbulence viscosity
121  virtual tmp<volScalarField> nut() const
122  {
123  return nut_;
124  }
125 
126  //- Return the turbulence viscosity on patch
127  virtual tmp<scalarField> nut(const label patchi) const
128  {
129  return nut_.boundaryField()[patchi];
130  }
131 
132  //- Return the turbulence kinetic energy
133  virtual tmp<volScalarField> k() const;
134 
135  //- Return the Reynolds stress tensor
136  virtual tmp<volSymmTensorField> R() const;
137 
138  //- Return the effective stress tensor
139  virtual tmp<volSymmTensorField> devRhoReff() const;
140 
141  //- Return the source term for the momentum equation
143 
144  //- Return the source term for the momentum equation
146  (
147  const volScalarField& rho,
148  volVectorField& U
149  ) const;
150 
151  //- Validate the turbulence fields after construction
152  // Update turbulence viscosity and other derived fields as requires
153  virtual void validate();
154 
155  //- Solve the turbulence equations and correct the turbulence viscosity
156  virtual void correct() = 0;
157 };
158 
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 } // End namespace Foam
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 #ifdef NoRepository
167  #include "ReynoldsStress.C"
168 #endif
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 #endif
173 
174 // ************************************************************************* //
void correctWallShearStress(volSymmTensorField &R) const
BasicTurbulenceModel::alphaField alphaField
surfaceScalarField & phi
U
Definition: pEqn.H:83
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
virtual void correctNut()=0
Update the eddy-viscosity.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
tmp< fvVectorMatrix > DivDevRhoReff(const RhoFieldType &rho, volVectorField &U) const
Return the source term for the momentum equation.
virtual void correct()=0
Solve the turbulence equations and correct the turbulence viscosity.
virtual tmp< volSymmTensorField > R() const
Return the Reynolds stress tensor.
virtual tmp< fvVectorMatrix > divDevRhoReff(volVectorField &U) const
Return the source term for the momentum equation.
BasicTurbulenceModel::transportModel transportModel
virtual bool read()=0
Re-read model coefficients if they have changed.
A class for handling words, derived from string.
Definition: word.H:59
virtual tmp< volSymmTensorField > devRhoReff() const
Return the effective stress tensor.
BasicTurbulenceModel::rhoField rhoField
virtual void validate()
Validate the turbulence fields after construction.
dimensionedScalar couplingFactor_
volScalarField nut_
virtual tmp< volScalarField > nut() const
Return the turbulence viscosity.
void boundNormalStress(volSymmTensorField &R) const
virtual ~ReynoldsStress()
Destructor.
ReynoldsStress(const word &modelName, const alphaField &alpha, const rhoField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const transportModel &transport, const word &propertiesName)
Construct from components.
label patchi
virtual tmp< volScalarField > k() const
Return the turbulence kinetic energy.
volSymmTensorField R_
A class for managing temporary objects.
Definition: PtrList.H:53
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Namespace for OpenFOAM.
Reynolds-stress turbulence model base class.