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) 2016-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::viscosityModels::strainRateFunction
26 
27 Description
28  Run-time selected strain-rate function non-Newtonian viscosity model.
29 
30  Example linear function of strain-rate:
31  \verbatim
32  transportModel strainRateFunction;
33 
34  strainRateFunctionCoeffs
35  {
36  function polynomial ((0 0.1) (1 1.3));
37  }
38  \endverbatim
39 
40 See also
41  Foam::viscosityModel
42  Foam::Function1
43 
44 SourceFiles
45  strainRateFunction.C
46 
47 \*---------------------------------------------------------------------------*/
48 
49 #ifndef strainRateFunction_H
50 #define strainRateFunction_H
51 
52 #include "viscosityModel.H"
53 #include "volFields.H"
54 #include "Function1.H"
55 
56 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57 
58 namespace Foam
59 {
60 namespace viscosityModels
61 {
62 
63 /*---------------------------------------------------------------------------*\
64  Class strainRateFunction Declaration
65 \*---------------------------------------------------------------------------*/
66 
68 :
69  public viscosityModel
70 {
71  // Private Data
72 
73  //- Coefficients dictionary
74  dictionary strainRateFunctionCoeffs_;
75 
76  //- Strain-rate function
77  autoPtr<Function1<scalar>> strainRateFunction_;
78 
79  //- Current viscosity field
80  volScalarField nu_;
81 
82 
83 public:
84 
85  //- Runtime type information
86  TypeName("strainRateFunction");
87 
88 
89  // Constructors
90 
91  //- Construct from components
93  (
94  const word& name,
96  const volVectorField& U,
97  const surfaceScalarField& phi
98  );
99 
100 
101  //- Destructor
102  virtual ~strainRateFunction()
103  {}
104 
105 
106  // Member Functions
107 
108  //- Return the laminar viscosity
109  virtual tmp<volScalarField> nu() const;
110 
111  //- Return the laminar viscosity for patch
112  virtual tmp<scalarField> nu(const label patchi) const;
113 
114  //- Correct the laminar viscosity
115  virtual void correct();
116 
117  //- Read transportProperties dictionary
118  virtual bool read(const dictionary& viscosityProperties);
119 };
120 
121 
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123 
124 } // End namespace viscosityModels
125 } // End namespace Foam
126 
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 
129 #endif
130 
131 // ************************************************************************* //
virtual bool read(const dictionary &viscosityProperties)
Read transportProperties dictionary.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Run-time selected strain-rate function non-Newtonian viscosity model.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
virtual tmp< volScalarField > nu() const
Return the laminar viscosity.
An abstract base class for incompressible viscosityModels.
const dictionary & viscosityProperties() const
Return the phase transport properties dictionary.
A class for handling words, derived from string.
Definition: word.H:59
phi
Definition: correctPhi.H:3
TypeName("strainRateFunction")
Runtime type information.
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
strainRateFunction(const word &name, const dictionary &viscosityProperties, const volVectorField &U, const surfaceScalarField &phi)
Construct from components.
label patchi
U
Definition: pEqn.H:72
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
virtual void correct()
Correct the laminar viscosity.
Namespace for OpenFOAM.