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,
77  const volScalarField& strainRate
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 
104  //- Destructor
105  virtual ~strainRateViscosityModel()
106  {}
107 
108 
109  // Member Functions
111  //- Return the laminar viscosity
112  virtual tmp<volScalarField> nu() const
113  {
114  return nu_;
115  }
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 // ************************************************************************* //
TypeName("strainRateViscosityModel")
Runtime type information.
strainRateViscosityModel(const dictionary &viscosityProperties, const viscosity &viscosity, const volVectorField &U)
Construct from components.
U
Definition: pEqn.H:72
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
const Boundary & boundaryField() const
Return const-reference to the boundary field.
void operator=(const strainRateViscosityModel &)=delete
Disallow default bitwise assignment.
virtual tmp< volScalarField > strainRate() const
Return the strain-rate obtained from the velocity field.
An abstract base class for strain-rate dependent generalised Newtonian viscosity models.
Abstract base class for all fluid physical properties.
Definition: viscosity.H:49
An abstract base class for generalised Newtonian viscosity models.
label patchi
A class for managing temporary objects.
Definition: PtrList.H:53
virtual tmp< volScalarField > nu() const
Return the laminar viscosity.
Namespace for OpenFOAM.