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-2020 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::generalizedNewtonianViscosityModels::strainRateFunction
26 
27 Description
28  Run-time selected strain-rate function generalized Newtonian viscosity model
29 
30  Example linear function of strain-rate:
31  \verbatim
32  generalizedNewtonianModel strainRateFunction;
33 
34  function polynomial ((0 0.1) (1 1.3));
35  \endverbatim
36 
37 See also
38  Foam::generalizedNewtonianViscosityModel
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 generalizedNewtonianViscosityModels
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 
87  //- Destructor
88  virtual ~strainRateFunction()
89  {}
90 
91 
92  // Member Functions
93 
94  //- Read transportProperties dictionary
95  virtual bool read(const dictionary& viscosityProperties);
96 
97  //- Return the laminar viscosity
98  virtual tmp<volScalarField> nu
99  (
100  const volScalarField& nu0,
101  const volScalarField& strainRate
102  ) const;
103 };
104 
105 
106 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
107 
108 } // End namespace generalizedNewtonianViscosityModels
109 } // End namespace laminarModels
110 } // End namespace Foam
111 
112 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
113 
114 #endif
115 
116 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
An abstract base class for generalized Newtonian viscosity models.
virtual tmp< volScalarField > nu(const volScalarField &nu0, const volScalarField &strainRate) const
Return the laminar viscosity.
strainRateFunction(const dictionary &viscosityProperties)
Construct from components.
virtual bool read(const dictionary &viscosityProperties)
Read transportProperties dictionary.
const dictionary & viscosityProperties() const
Return the phase transport properties dictionary.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
A class for managing temporary objects.
Definition: PtrList.H:53
Run-time selected strain-rate function generalized Newtonian viscosity model.
Namespace for OpenFOAM.