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 -------------------------------------------------------------------------------
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::viscosityModels::strainRateFunction
29 
30 Description
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 
43 See also
44  Foam::viscosityModel
45  Foam::Function1
46 
47 SourceFiles
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 
61 namespace Foam
62 {
63 namespace viscosityModels
64 {
65 
66 /*---------------------------------------------------------------------------*\
67  Class strainRateFunction Declaration
68 \*---------------------------------------------------------------------------*/
69 
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 
83 protected:
84 
85  // Protected data
86 
88 
89 
90 public:
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,
104  const surfaceScalarField& phi
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 // ************************************************************************* //
volFields.H
Foam::viscosityModel
An abstract base class for incompressible viscosityModels.
Definition: viscosityModel.H:67
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Function1.H
Foam::viscosityModel::viscosityProperties
const dictionary & viscosityProperties() const
Return the phase transport properties dictionary.
Definition: viscosityModel.H:144
Foam::viscosityModels::strainRateFunction::strainRateFunction
strainRateFunction(const word &name, const dictionary &viscosityProperties, const volVectorField &U, const surfaceScalarField &phi)
Construct from components.
Definition: strainRateFunction.C:54
Foam::viscosityModels::strainRateFunction::~strainRateFunction
virtual ~strainRateFunction()=default
Destructor.
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
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
U
U
Definition: pEqn.H:72
Foam::viscosityModels::strainRateFunction::nu_
volScalarField nu_
Definition: strainRateFunction.H:86
Foam::viscosityModels::strainRateFunction
Run-time selected strain-rate function non-Newtonian viscosity model.
Definition: strainRateFunction.H:69
Foam::viscosityModels::strainRateFunction::correct
virtual void correct()
Correct the laminar viscosity.
Definition: strainRateFunction.C:109
Foam::viscosityModels::strainRateFunction::nu
virtual tmp< volScalarField > nu() const
Return the laminar viscosity.
Definition: strainRateFunction.C:96
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
Foam::viscosityModels::strainRateFunction::TypeName
TypeName("strainRateFunction")
Runtime type information.
Foam::viscosityModels::strainRateFunction::read
virtual bool read(const dictionary &viscosityProperties)
Read transportProperties dictionary.
Definition: strainRateFunction.C:127
Foam::GeometricField< scalar, fvPatchField, volMesh >