generalizedNewtonianViscosityModel.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) 2018-2020 OpenFOAM Foundation
9  Copyright (C) 2020 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 Namespace
28  Foam::laminarModels::generalizedNewtonianViscosityModels
29 
30 Description
31  A namespace for various generalized Newtonian viscosity model
32  implementations.
33 
34 Class
35  Foam::laminarModels::generalizedNewtonianViscosityModel
36 
37 Description
38  An abstract base class for generalized Newtonian viscosity models.
39 
40 SourceFiles
41  generalizedNewtonianViscosityModel.C
42  generalizedNewtonianViscosityModelNew.C
43 
44 \*---------------------------------------------------------------------------*/
45 
46 #ifndef generalizedNewtonianViscosityModel_H
47 #define generalizedNewtonianViscosityModel_H
48 
49 #include "dictionary.H"
50 #include "volFieldsFwd.H"
51 #include "runTimeSelectionTables.H"
52 
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 
55 namespace Foam
56 {
57 namespace laminarModels
58 {
59 
60 /*---------------------------------------------------------------------------*\
61  Class generalizedNewtonianViscosityModel Declaration
62 \*---------------------------------------------------------------------------*/
63 
65 {
66 protected:
67 
68  // Protected Data
69 
71 
72 
73 public:
74 
75  //- Runtime type information
76  TypeName("generalizedNewtonianViscosityModel");
77 
78 
79  // Declare run-time constructor selection table
80 
82  (
83  autoPtr,
85  dictionary,
86  (
88  ),
90  );
91 
92 
93  // Generated Methods
94 
95  //- No copy construct
97  (
99  ) = delete;
100 
101  //- No copy assignment
102  void operator=(const generalizedNewtonianViscosityModel&) = delete;
103 
104 
105  // Selectors
106 
107  //- Select a viscosity model
109  (
110  const dictionary& dict
111  );
112 
113 
114  // Constructors
115 
116  //- Construct from dictionary (components)
118  (
120  );
121 
122 
123  //- Destructor
124  virtual ~generalizedNewtonianViscosityModel() = default;
125 
126 
127  // Member Functions
128 
129  //- Return the phase transport properties dictionary
130  const dictionary& viscosityProperties() const
131  {
132  return viscosityProperties_;
133  }
134 
135  //- Return the laminar viscosity
136  virtual tmp<volScalarField> nu
137  (
138  const volScalarField& nu0,
139  const volScalarField& strainRate
140  ) const = 0;
141 
142  //- Read transportProperties dictionary
143  virtual bool read(const dictionary& viscosityProperties) = 0;
144 };
145 
146 
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 
149 } // End namespace laminarModels
150 } // End namespace Foam
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 #endif
155 
156 // ************************************************************************* //
volFieldsFwd.H
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::laminarModels::generalizedNewtonianViscosityModel::generalizedNewtonianViscosityModel
generalizedNewtonianViscosityModel(const generalizedNewtonianViscosityModel &)=delete
No copy construct.
Foam::laminarModels::generalizedNewtonianViscosityModel::viscosityProperties_
dictionary viscosityProperties_
Definition: generalizedNewtonianViscosityModel.H:69
Foam::laminarModels::generalizedNewtonianViscosityModel::nu
virtual tmp< volScalarField > nu(const volScalarField &nu0, const volScalarField &strainRate) const =0
Return the laminar viscosity.
Foam::laminarModels::generalizedNewtonianViscosityModel::read
virtual bool read(const dictionary &viscosityProperties)=0
Read transportProperties dictionary.
Definition: generalizedNewtonianViscosityModel.C:57
Foam::laminarModels::generalizedNewtonianViscosityModel::operator=
void operator=(const generalizedNewtonianViscosityModel &)=delete
No copy assignment.
Foam::laminarModels::generalizedNewtonianViscosityModel::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, generalizedNewtonianViscosityModel, dictionary,(const dictionary &viscosityProperties),(viscosityProperties))
Foam::laminarModels::generalizedNewtonianViscosityModel::TypeName
TypeName("generalizedNewtonianViscosityModel")
Runtime type information.
Foam::laminarModels::generalizedNewtonianViscosityModel::viscosityProperties
const dictionary & viscosityProperties() const
Return the phase transport properties dictionary.
Definition: generalizedNewtonianViscosityModel.H:129
Foam::laminarModels::generalizedNewtonianViscosityModel::~generalizedNewtonianViscosityModel
virtual ~generalizedNewtonianViscosityModel()=default
Destructor.
dict
dictionary dict
Definition: searchingEngine.H:14
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
Foam::laminarModels::generalizedNewtonianViscosityModel
An abstract base class for generalized Newtonian viscosity models.
Definition: generalizedNewtonianViscosityModel.H:63
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
dictionary.H
Foam::laminarModels::generalizedNewtonianViscosityModel::New
static autoPtr< generalizedNewtonianViscosityModel > New(const dictionary &dict)
Select a viscosity model.
Definition: generalizedNewtonianViscosityModelNew.C:35
Foam::GeometricField< scalar, fvPatchField, volMesh >