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) 2016 OpenFOAM Foundation
9 Copyright (C) 2017-2019 OpenCFD Ltd
10-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::viscosityModels::strainRateFunction
29
30Description
31 Run-time selected strain-rate function non-Newtonian viscosity model.
32
33 Example linear function of strain-rate:
34 \verbatim
35 transportModel strainRateFunction;
36
37 strainRateFunctionCoeffs
38 {
39 function polynomial ((0 0.1) (1 1.3));
40 }
41 \endverbatim
42
43See also
44 Foam::viscosityModel
45 Foam::Function1
46
47SourceFiles
48 strainRateFunction.C
49
50\*---------------------------------------------------------------------------*/
51
52#ifndef strainRateFunction_H
53#define strainRateFunction_H
54
55#include "viscosityModel.H"
56#include "volFields.H"
57#include "Function1.H"
58
59// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60
61namespace Foam
62{
63namespace viscosityModels
64{
65
66/*---------------------------------------------------------------------------*\
67 Class strainRateFunction Declaration
68\*---------------------------------------------------------------------------*/
71:
72 public viscosityModel
73{
74 // Private data
75
76 //- Coefficients dictionary
77 dictionary strainRateFunctionCoeffs_;
78
79 //- Strain-rate function
80 autoPtr<Function1<scalar>> strainRateFunction_;
81
82
83protected:
84
85 // Protected data
88
89
90public:
91
92 //- Runtime type information
93 TypeName("strainRateFunction");
94
95
96 // Constructors
97
98 //- Construct from components
100 (
101 const word& name,
103 const volVectorField& U,
105 );
106
107
108 //- Destructor
109 virtual ~strainRateFunction() = default;
110
111
112 // Member Functions
113
114 //- Return the laminar viscosity
115 virtual tmp<volScalarField> nu() const;
116
117 //- Return the laminar viscosity for patch
118 virtual tmp<scalarField> nu(const label patchi) const;
119
120 //- Correct the laminar viscosity
121 virtual void correct();
122
123 //- Read transportProperties dictionary
124 virtual bool read(const dictionary& viscosityProperties);
125};
126
127
128// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129
130} // End namespace viscosityModels
131} // End namespace Foam
132
133// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134
135#endif
136
137// ************************************************************************* //
surfaceScalarField & phi
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A class for managing temporary objects.
Definition: tmp.H:65
An abstract base class for incompressible viscosityModels.
const dictionary & viscosityProperties() const
Return the phase transport properties dictionary.
Run-time selected strain-rate function non-Newtonian viscosity model.
virtual bool read(const dictionary &viscosityProperties)
Read transportProperties dictionary.
virtual void correct()
Correct the laminar viscosity.
virtual tmp< volScalarField > nu() const
Return the laminar viscosity.
virtual ~strainRateFunction()=default
Destructor.
TypeName("strainRateFunction")
Runtime type information.
A class for handling words, derived from Foam::string.
Definition: word.H:68
U
Definition: pEqn.H:72
Namespace for OpenFOAM.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73