strainRateFunction.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2018-2020 OpenFOAM Foundation
9  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::laminarModels::generalizedNewtonianViscosityModels::strainRateFunction
29 
30 Description
31  Run-time selected strain-rate function generalized Newtonian viscosity model
32 
33  Example linear function of strain-rate:
34  \verbatim
35  generalizedNewtonianModel strainRateFunction;
36 
37  function polynomial ((0 0.1) (1 1.3));
38  \endverbatim
39 
40 See also
41  Foam::generalizedNewtonianViscosityModel
42  Foam::Function1
43 
44 SourceFiles
45  strainRateFunction.C
46 
47 \*---------------------------------------------------------------------------*/
48 
49 #ifndef strainRateFunction_H
50 #define strainRateFunction_H
51 
53 #include "Function1.H"
54 
55 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 
57 namespace Foam
58 {
59 namespace laminarModels
60 {
61 namespace generalizedNewtonianViscosityModels
62 {
63 
64 /*---------------------------------------------------------------------------*\
65  Class strainRateFunction Declaration
66 \*---------------------------------------------------------------------------*/
67 
69 :
71 {
72  // Private Data
73 
74  //- Coefficients dictionary
75  dictionary strainRateFunctionCoeffs_;
76 
77  //- Strain-rate function
78  autoPtr<Function1<scalar>> strainRateFunction_;
79 
80 
81 public:
82 
83  //- Runtime type information
84  TypeName("strainRateFunction");
85 
86 
87  // Constructors
88 
89  //- Construct from dictionary (components)
91 
92 
93  //- Destructor
94  virtual ~strainRateFunction() = default;
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,
106  const volScalarField& strainRate
107  ) const;
108 };
109 
110 
111 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
112 
113 } // End namespace generalizedNewtonianViscosityModels
114 } // End namespace laminarModels
115 } // End namespace Foam
116 
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 
119 #endif
120 
121 // ************************************************************************* //
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::laminarModels::generalizedNewtonianViscosityModels::strainRateFunction
Run-time selected strain-rate function generalized Newtonian viscosity model.
Definition: strainRateFunction.H:67
Function1.H
Foam::laminarModels::generalizedNewtonianViscosityModels::strainRateFunction::read
virtual bool read(const dictionary &viscosityProperties)
Read transportProperties dictionary.
Definition: strainRateFunction.C:78
Foam::laminarModels::generalizedNewtonianViscosityModels::strainRateFunction::nu
virtual tmp< volScalarField > nu(const volScalarField &nu0, const volScalarField &strainRate) const
Return the laminar viscosity.
Definition: strainRateFunction.C:101
Foam::laminarModels::generalizedNewtonianViscosityModels::strainRateFunction::strainRateFunction
strainRateFunction(const dictionary &viscosityProperties)
Construct from dictionary (components)
Definition: strainRateFunction.C:58
Foam::laminarModels::generalizedNewtonianViscosityModel::viscosityProperties
const dictionary & viscosityProperties() const
Return the phase transport properties dictionary.
Definition: generalizedNewtonianViscosityModel.H:129
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::laminarModels::generalizedNewtonianViscosityModel
An abstract base class for generalized Newtonian viscosity models.
Definition: generalizedNewtonianViscosityModel.H:63
Foam::laminarModels::generalizedNewtonianViscosityModels::strainRateFunction::TypeName
TypeName("strainRateFunction")
Runtime type information.
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::laminarModels::generalizedNewtonianViscosityModels::strainRateFunction::~strainRateFunction
virtual ~strainRateFunction()=default
Destructor.
generalizedNewtonianViscosityModel.H