nonlinearEddyViscosity.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2015-2024 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::nonlinearEddyViscosity
26 
27 Description
28  Eddy viscosity turbulence model with non-linear correction base class
29 
30 SourceFiles
31  nonlinearEddyViscosity.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef nonlinearEddyViscosity_H
36 #define nonlinearEddyViscosity_H
37 
38 #include "eddyViscosity.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class nonlinearEddyViscosity Declaration
47 \*---------------------------------------------------------------------------*/
48 
49 template<class BasicMomentumTransportModel>
51 :
52  public eddyViscosity<BasicMomentumTransportModel>
53 {
54  // Private member functions
55 
56  //- Return the source term for the momentum equation
57  template<class RhoFieldType>
58  tmp<fvVectorMatrix> DivDevTau
59  (
60  const RhoFieldType& rho,
62  ) const;
63 
64 
65 protected:
66 
67  // Protected data
68 
69  // Fields
70 
72 
73 
74  // Protected Member Functions
75 
76  virtual void correctNonlinearStress(const volTensorField& gradU) = 0;
77 
78 
79 public:
80 
81  typedef typename BasicMomentumTransportModel::alphaField alphaField;
82  typedef typename BasicMomentumTransportModel::rhoField rhoField;
83 
84 
85  // Constructors
86 
87  //- Construct from components
89  (
90  const word& modelName,
91  const alphaField& alpha,
92  const rhoField& rho,
93  const volVectorField& U,
94  const surfaceScalarField& alphaRhoPhi,
95  const surfaceScalarField& phi,
96  const viscosity& viscosity
97  );
98 
99 
100  //- Destructor
101  virtual ~nonlinearEddyViscosity()
102  {}
103 
104 
105  // Member Functions
106 
107  //- Return the Reynolds stress tensor [m^2/s^2]
108  virtual tmp<volSymmTensorField> R() const;
109 
110  //- Return the effective surface stress
111  virtual tmp<surfaceVectorField> devTau() const;
112 
113  //- Return the source term for the momentum equation
115 
116  //- Return the source term for the momentum equation
118  (
119  const volScalarField& rho,
121  ) const;
122 };
123 
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 } // End namespace Foam
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 #ifdef NoRepository
132  #include "nonlinearEddyViscosity.C"
133 #endif
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 #endif
138 
139 // ************************************************************************* //
Generic GeometricField class.
Eddy viscosity turbulence model base class.
Definition: eddyViscosity.H:52
BasicMomentumTransportModel::alphaField alphaField
Definition: eddyViscosity.H:70
BasicMomentumTransportModel::rhoField rhoField
Definition: eddyViscosity.H:71
Eddy viscosity turbulence model with non-linear correction base class.
BasicMomentumTransportModel::alphaField alphaField
virtual tmp< volSymmTensorField > R() const
Return the Reynolds stress tensor [m^2/s^2].
virtual tmp< surfaceVectorField > devTau() const
Return the effective surface stress.
virtual ~nonlinearEddyViscosity()
Destructor.
nonlinearEddyViscosity(const word &modelName, const alphaField &alpha, const rhoField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const viscosity &viscosity)
Construct from components.
virtual tmp< fvVectorMatrix > divDevTau(volVectorField &U) const
Return the source term for the momentum equation.
virtual void correctNonlinearStress(const volTensorField &gradU)=0
BasicMomentumTransportModel::rhoField rhoField
A class for managing temporary objects.
Definition: tmp.H:55
Abstract base class for all fluid physical properties.
Definition: viscosity.H:50
A class for handling words, derived from string.
Definition: word.H:62
U
Definition: pEqn.H:72
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
Namespace for OpenFOAM.