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 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 
79 public:
80 
81  typedef typename BasicTurbulenceModel::alphaField alphaField;
82  typedef typename BasicTurbulenceModel::rhoField rhoField;
83  typedef typename BasicTurbulenceModel::transportModel transportModel;
84 
85 
86  // Constructors
87 
88  //- Construct from components
90  (
91  const word& modelName,
92  const alphaField& alpha,
93  const rhoField& rho,
94  const volVectorField& U,
95  const surfaceScalarField& alphaRhoPhi,
96  const surfaceScalarField& phi,
97  const transportModel& transport,
98  const word& propertiesName
99  );
100 
101 
102  //- Destructor
103  virtual ~ReynoldsStress()
104  {}
105 
106 
107  // Member Functions
108 
109  //- Re-read model coefficients if they have changed
110  virtual bool read() = 0;
111 
112  //- Return the turbulence viscosity
113  virtual tmp<volScalarField> nut() const
114  {
115  return nut_;
116  }
117 
118  //- Return the turbulence viscosity on patch
119  virtual tmp<scalarField> nut(const label patchi) const
120  {
121  return nut_.boundaryField()[patchi];
122  }
123 
124  //- Return the turbulence kinetic energy
125  virtual tmp<volScalarField> k() const;
126 
127  //- Return the Reynolds stress tensor
128  virtual tmp<volSymmTensorField> R() const;
129 
130  //- Return the effective stress tensor
131  virtual tmp<volSymmTensorField> devRhoReff() const;
132 
133  //- Return the source term for the momentum equation
135 
136  //- Return the source term for the momentum equation
138  (
139  const volScalarField& rho,
141  ) const;
142 
143  //- Validate the turbulence fields after construction
144  // Update turbulence viscosity and other derived fields as requires
145  virtual void validate();
146 
147  //- Solve the turbulence equations and correct the turbulence viscosity
148  virtual void correct() = 0;
149 };
150 
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 } // End namespace Foam
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 #ifdef NoRepository
159 # include "ReynoldsStress.C"
160 #endif
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 #endif
165 
166 // ************************************************************************* //
Foam::ReynoldsStress::k
virtual tmp< volScalarField > k() const
Return the turbulence kinetic energy.
Definition: ReynoldsStress.C:198
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::ReynoldsStress::read
virtual bool read()=0
Re-read model coefficients if they have changed.
Definition: ReynoldsStress.C:182
Foam::ReynoldsStress::nut_
volScalarField nut_
Definition: ReynoldsStress.H:66
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::constant::atomic::alpha
const dimensionedScalar alpha
Fine-structure constant: default SI units: [].
Definition: readThermalProperties.H:216
Foam::ReynoldsStress::correctWallShearStress
void correctWallShearStress(volSymmTensorField &R) const
Definition: ReynoldsStress.C:60
Foam::GeometricField::boundaryField
GeometricBoundaryField & boundaryField()
Return reference to GeometricBoundaryField.
Definition: GeometricField.C:735
Foam::ReynoldsStress::nut
virtual tmp< scalarField > nut(const label patchi) const
Return the turbulence viscosity on patch.
Definition: ReynoldsStress.H:118
U
U
Definition: pEqn.H:46
Foam::ReynoldsStress::correctNut
virtual void correctNut()=0
Update the eddy-viscosity.
Foam::ReynoldsStress
Reynolds-stress turbulence model base class.
Definition: ReynoldsStress.H:50
Foam::ReynoldsStress::divDevRhoReff
virtual tmp< fvVectorMatrix > divDevRhoReff(volVectorField &U) const
Return the source term for the momentum equation.
Definition: ReynoldsStress.C:233
Foam::label
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
Foam::ReynoldsStress::ReynoldsStress
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.
Definition: ReynoldsStress.C:110
Foam::ReynoldsStress::transportModel
BasicTurbulenceModel::transportModel transportModel
Definition: ReynoldsStress.H:82
Foam::RASModel::rhoField
BasicTurbulenceModel::rhoField rhoField
Definition: RASModel.H:100
Foam::dimensioned
Generic dimensioned Type class.
Definition: dimensionedScalarFwd.H:41
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::ReynoldsStress::validate
virtual void validate()
Validate the turbulence fields after construction.
Definition: ReynoldsStress.C:299
Foam::RASModel::alphaField
BasicTurbulenceModel::alphaField alphaField
Definition: RASModel.H:99
Foam::ReynoldsStress::nut
virtual tmp< volScalarField > nut() const
Return the turbulence viscosity.
Definition: ReynoldsStress.H:112
Foam::ReynoldsStress::devRhoReff
virtual tmp< volSymmTensorField > devRhoReff() const
Return the effective stress tensor.
Definition: ReynoldsStress.C:208
rho
rho
Definition: pEqn.H:3
Foam::RASModel::transportModel
BasicTurbulenceModel::transportModel transportModel
Definition: RASModel.H:101
ReynoldsStress.C
patchi
label patchi
Definition: getPatchFieldScalar.H:1
Foam::ReynoldsStress::correct
virtual void correct()=0
Solve the turbulence equations and correct the turbulence viscosity.
Definition: ReynoldsStress.C:306
Foam::ReynoldsStress::R_
volSymmTensorField R_
Definition: ReynoldsStress.H:65
Foam::ReynoldsStress::R
virtual tmp< volSymmTensorField > R() const
Return the Reynolds stress tensor.
Definition: ReynoldsStress.C:190
Foam::ReynoldsStress::boundNormalStress
void boundNormalStress(volSymmTensorField &R) const
Definition: ReynoldsStress.C:35
Foam::ReynoldsStress::alphaField
BasicTurbulenceModel::alphaField alphaField
Definition: ReynoldsStress.H:80
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52
Foam::ReynoldsStress::rhoField
BasicTurbulenceModel::rhoField rhoField
Definition: ReynoldsStress.H:81
Foam::ReynoldsStress::~ReynoldsStress
virtual ~ReynoldsStress()
Destructor.
Definition: ReynoldsStress.H:102
Foam::ReynoldsStress::couplingFactor_
dimensionedScalar couplingFactor_
Definition: ReynoldsStress.H:61