generalisedNewtonianViscosityModel.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) 2018-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 Namespace
25  Foam::laminarModels::generalisedNewtonianViscosityModels
26 
27 Description
28  A namespace for the generalised Newtonian viscosity model implementations.
29 
30 Class
31  Foam::laminarModels::generalisedNewtonianViscosityModel
32 
33 Description
34  An abstract base class for generalised Newtonian viscosity models.
35 
36 SourceFiles
37  generalisedNewtonianViscosityModel.C
38  generalisedNewtonianViscosityModelNew.C
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef generalisedNewtonianViscosityModel_H
43 #define generalisedNewtonianViscosityModel_H
44 
45 #include "viscosity.H"
46 #include "runTimeSelectionTables.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 namespace laminarModels
53 {
54 
55 /*---------------------------------------------------------------------------*\
56  Class generalisedNewtonianViscosityModel Declaration
57 \*---------------------------------------------------------------------------*/
58 
60 :
61  public viscosity
62 {
63 protected:
64 
65  //- Reference to the fluid Newtonian viscosity
66  const viscosity& viscosity_;
67 
68  //- Reference to the velocity field
69  const volVectorField& U_;
70 
71 
72 public:
73 
74  //- Runtime type information
75  TypeName("generalisedNewtonianViscosityModel");
76 
77 
78  // Declare run-time constructor selection table
79 
81  (
82  autoPtr,
84  dictionary,
85  (
86  const dictionary& viscosityProperties,
87  const viscosity& viscosity,
88  const volVectorField& U
89  ),
90  (viscosityProperties, viscosity, U)
91  );
92 
93 
94  // Selectors
95 
96  //- Return a reference to the selected viscosity model
98  (
99  const dictionary& viscosityProperties,
100  const viscosity& viscosity,
101  const volVectorField& U
102  );
103 
104 
105  // Constructors
106 
107  //- Construct from components
109  (
110  const dictionary& viscosityProperties,
111  const viscosity& viscosity,
112  const volVectorField& U
113  );
114 
115  //- Disallow default bitwise copy construction
117  (
119  ) = delete;
120 
121 
122  //- Destructor
124  {}
125 
126 
127  // Member Functions
128 
129  //- Read transportProperties dictionary
130  virtual bool read(const dictionary& viscosityProperties) = 0;
131 
132  //- Correct the laminar viscosity
133  virtual void correct() = 0;
134 
135 
136  // Member Operators
137 
138  //- Disallow default bitwise assignment
139  void operator=(const generalisedNewtonianViscosityModel&) = delete;
140 };
141 
142 
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 
145 } // End namespace laminarModels
146 } // End namespace Foam
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 #endif
151 
152 // ************************************************************************* //
Generic GeometricField class.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
An abstract base class for generalised Newtonian viscosity models.
const viscosity & viscosity_
Reference to the fluid Newtonian viscosity.
void operator=(const generalisedNewtonianViscosityModel &)=delete
Disallow default bitwise assignment.
static autoPtr< generalisedNewtonianViscosityModel > New(const dictionary &viscosityProperties, const viscosity &viscosity, const volVectorField &U)
Return a reference to the selected viscosity model.
const volVectorField & U_
Reference to the velocity field.
virtual void correct()=0
Correct the laminar viscosity.
generalisedNewtonianViscosityModel(const dictionary &viscosityProperties, const viscosity &viscosity, const volVectorField &U)
Construct from components.
TypeName("generalisedNewtonianViscosityModel")
Runtime type information.
virtual bool read(const dictionary &viscosityProperties)=0
Read transportProperties dictionary.
declareRunTimeSelectionTable(autoPtr, generalisedNewtonianViscosityModel, dictionary,(const dictionary &viscosityProperties, const viscosity &viscosity, const volVectorField &U),(viscosityProperties, viscosity, U))
Abstract base class for all fluid physical properties.
Definition: viscosity.H:50
U
Definition: pEqn.H:72
Namespace for OpenFOAM.
Macros to ease declaration of run-time selection tables.