strainRateFunction.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::strainRateFunction
26 
27 Description
28  Run-time selected strain-rate function generalised Newtonian viscosity model
29 
30  Example linear function of strain-rate:
31  \verbatim
32  strainRateModel strainRateFunction;
33 
34  function polynomial ((0 0.1) (1 1.3));
35  \endverbatim
36 
37 See also
38  Foam::strainRateViscosityModel
39  Foam::Function1
40 
41 SourceFiles
42  strainRateFunction.C
43 
44 \*---------------------------------------------------------------------------*/
45 
46 #ifndef strainRateFunction_H
47 #define strainRateFunction_H
48 
50 #include "Function1.H"
51 
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 
54 namespace Foam
55 {
56 namespace laminarModels
57 {
58 namespace generalisedNewtonianViscosityModels
59 {
60 
61 /*---------------------------------------------------------------------------*\
62  Class strainRateFunction Declaration
63 \*---------------------------------------------------------------------------*/
64 
66 :
68 {
69  // Private Data
70 
71  //- Strain-rate function
72  autoPtr<Function1<scalar>> strainRateFunction_;
73 
74 
75 public:
76 
77  //- Runtime type information
78  TypeName("strainRateFunction");
79 
80 
81  // Constructors
82 
83  //- Construct from components
85  (
86  const dictionary& viscosityProperties,
88  const volVectorField& U
89  );
90 
91 
92  //- Destructor
93  virtual ~strainRateFunction()
94  {}
95 
96 
97  // Member Functions
98 
99  //- Read transportProperties dictionary
100  virtual bool read(const dictionary& viscosityProperties);
101 
102  //- Return the laminar viscosity
103  virtual tmp<volScalarField> nu
104  (
105  const volScalarField& nu0,
107  ) const;
108 };
109 
110 
111 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
112 
113 } // End namespace generalisedNewtonianViscosityModels
114 } // End namespace laminarModels
115 } // End namespace Foam
116 
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 
119 #endif
120 
121 // ************************************************************************* //
Generic GeometricField class.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Run-time selected strain-rate function generalised Newtonian viscosity model.
virtual bool read(const dictionary &viscosityProperties)
Read transportProperties dictionary.
strainRateFunction(const dictionary &viscosityProperties, const Foam::viscosity &viscosity, const volVectorField &U)
Construct from components.
An abstract base class for strain-rate dependent generalised Newtonian viscosity models.
virtual tmp< volScalarField > strainRate() const
Return the strain-rate obtained from the velocity field.
virtual tmp< volScalarField > nu() const
Return the laminar viscosity.
A class for managing temporary objects.
Definition: tmp.H:55
Abstract base class for all fluid physical properties.
Definition: viscosity.H:50
U
Definition: pEqn.H:72
Namespace for OpenFOAM.