strainRateViscosityModel.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) 2018-2021 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::laminarModels::generalisedNewtonianViscosityModels::
26  strainRateViscosityModel
27 
28 Description
29  An abstract base class for strain-rate dependent generalised Newtonian
30  viscosity models
31 
32 SourceFiles
33  strainRateViscosityModel.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef strainRateViscosityModel_H
38 #define strainRateViscosityModel_H
39 
41 #include "volFields.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 namespace laminarModels
48 {
49 namespace generalisedNewtonianViscosityModels
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class strainRateViscosityModel Declaration
54 \*---------------------------------------------------------------------------*/
55 
57 :
59 {
60  // Private data
61 
62  //- The strain-rate-dependent generalised Newtonian viscosity field
63  volScalarField nu_;
64 
65 
66 protected:
67 
68  // Protected Member Functions
69 
70  //- Return the strain-rate obtained from the velocity field
71  virtual tmp<volScalarField> strainRate() const;
72 
73  //- Return the generalised Newtonian viscosity
74  virtual tmp<volScalarField> nu
75  (
76  const volScalarField& nu0,
78  ) const = 0;
79 
80 
81 public:
82 
83  //- Runtime type information
84  TypeName("strainRateViscosityModel");
85 
86 
87  // Constructors
88 
89  //- Construct from components
91  (
92  const dictionary& viscosityProperties,
93  const viscosity& viscosity,
94  const volVectorField& U
95  );
96 
97  //- Disallow default bitwise copy construction
99  (
101  ) = delete;
102 
103 
104  //- Destructor
105  virtual ~strainRateViscosityModel()
106  {}
107 
108 
109  // Member Functions
110 
111  //- Return the laminar viscosity
112  virtual tmp<volScalarField> nu() const
113  {
114  return nu_;
115  }
116 
117  //- Return the laminar viscosity for patch
118  virtual tmp<scalarField> nu(const label patchi) const
119  {
120  return nu_.boundaryField()[patchi];
121  }
122 
123  //- Correct the laminar viscosity
124  virtual void correct();
125 
126 
127  // Member Operators
128 
129  //- Disallow default bitwise assignment
130  void operator=(const strainRateViscosityModel&) = delete;
131 };
132 
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 } // End namespace generalisedNewtonianViscosityModels
137 } // End namespace laminarModels
138 } // End namespace Foam
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 #endif
143 
144 // ************************************************************************* //
Generic GeometricField class.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
An abstract base class for generalised Newtonian viscosity models.
An abstract base class for strain-rate dependent generalised Newtonian viscosity models.
void operator=(const strainRateViscosityModel &)=delete
Disallow default bitwise assignment.
virtual tmp< volScalarField > strainRate() const
Return the strain-rate obtained from the velocity field.
virtual tmp< volScalarField > nu() const
Return the laminar viscosity.
strainRateViscosityModel(const dictionary &viscosityProperties, const viscosity &viscosity, const volVectorField &U)
Construct from components.
A class for managing temporary objects.
Definition: tmp.H:55
Abstract base class for all fluid physical properties.
Definition: viscosity.H:50
label patchi
U
Definition: pEqn.H:72
Namespace for OpenFOAM.
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