viscosityModel.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) 2011-2018 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 Namespace
25  Foam::viscosityModels
26 
27 Description
28  A namespace for various incompressible viscosityModel implementations.
29 
30 Class
31  Foam::viscosityModel
32 
33 Description
34  An abstract base class for incompressible viscosityModels.
35 
36  The strain rate is defined by:
37 
38  mag(symm(grad(U)))
39 
40 
41 SourceFiles
42  viscosityModel.C
43  viscosityModelNew.C
44 
45 \*---------------------------------------------------------------------------*/
46 
47 #ifndef viscosityModel_H
48 #define viscosityModel_H
49 
50 #include "dictionary.H"
51 #include "volFieldsFwd.H"
52 #include "surfaceFieldsFwd.H"
53 #include "dimensionedScalar.H"
54 #include "runTimeSelectionTables.H"
55 
56 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57 
58 namespace Foam
59 {
60 
61 /*---------------------------------------------------------------------------*\
62  Class viscosityModel Declaration
63 \*---------------------------------------------------------------------------*/
64 
65 class viscosityModel
66 {
67 
68 protected:
69 
70  // Protected data
71 
74 
76  const surfaceScalarField& phi_;
77 
78 
79  // Private Member Functions
80 
81  //- Disallow copy construct
83 
84  //- Disallow default bitwise assignment
85  void operator=(const viscosityModel&);
86 
87 
88 public:
89 
90  //- Runtime type information
91  TypeName("viscosityModel");
92 
93 
94  // Declare run-time constructor selection table
95 
97  (
98  autoPtr,
100  dictionary,
101  (
102  const word& name,
104  const volVectorField& U,
105  const surfaceScalarField& phi
106  ),
107  (name, viscosityProperties, U, phi)
108  );
109 
110 
111  // Selectors
112 
113  //- Return a reference to the selected viscosity model
115  (
116  const word& name,
117  const dictionary& viscosityProperties,
118  const volVectorField& U,
119  const surfaceScalarField& phi
120  );
121 
122 
123  // Constructors
124 
125  //- Construct from components
127  (
128  const word& name,
129  const dictionary& viscosityProperties,
130  const volVectorField& U,
131  const surfaceScalarField& phi
132  );
133 
134 
135  //- Destructor
136  virtual ~viscosityModel()
137  {}
138 
139 
140  // Member Functions
141 
142  //- Return the phase transport properties dictionary
143  const dictionary& viscosityProperties() const
144  {
145  return viscosityProperties_;
146  }
147 
148  //- Return the strain rate
150 
151  //- Return the laminar viscosity
152  virtual tmp<volScalarField> nu() const = 0;
153 
154  //- Return the laminar viscosity for patch
155  virtual tmp<scalarField> nu(const label patchi) const = 0;
156 
157  //- Correct the laminar viscosity
158  virtual void correct() = 0;
159 
160  //- Read transportProperties dictionary
161  virtual bool read(const dictionary& viscosityProperties) = 0;
162 };
163 
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 } // End namespace Foam
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 #endif
172 
173 // ************************************************************************* //
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
surfaceScalarField & phi
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
tmp< volScalarField > strainRate() const
Return the strain rate.
Generic GeometricField class.
const volVectorField & U_
An abstract base class for incompressible viscosityModels.
const dictionary & viscosityProperties() const
Return the phase transport properties dictionary.
virtual ~viscosityModel()
Destructor.
virtual tmp< volScalarField > nu() const =0
Return the laminar viscosity.
virtual bool read(const dictionary &viscosityProperties)=0
Read transportProperties dictionary.
A class for handling words, derived from string.
Definition: word.H:59
void operator=(const viscosityModel &)
Disallow default bitwise assignment.
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
viscosityModel(const viscosityModel &)
Disallow copy construct.
label patchi
U
Definition: pEqn.H:72
declareRunTimeSelectionTable(autoPtr, viscosityModel, dictionary,(const word &name, const dictionary &viscosityProperties, const volVectorField &U, const surfaceScalarField &phi),(name, viscosityProperties, U, phi))
static autoPtr< viscosityModel > New(const word &name, const dictionary &viscosityProperties, const volVectorField &U, const surfaceScalarField &phi)
Return a reference to the selected viscosity model.
virtual void correct()=0
Correct the laminar viscosity.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Macros to ease declaration of run-time selection tables.
const surfaceScalarField & phi_
TypeName("viscosityModel")
Runtime type information.
A class for managing temporary objects.
Definition: PtrList.H:53
dictionary viscosityProperties_
Namespace for OpenFOAM.