mixtureViscosityModel.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) 2014-2015 OpenFOAM Foundation
9  Copyright (C) 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 Namespace
28  Foam::mixtureViscosityModels
29 
30 Description
31  A namespace for incompressible mixtureViscosityModel implementations.
32 
33 Class
34  Foam::mixtureViscosityModel
35 
36 Description
37  An abstract base class for incompressible mixtureViscosityModels.
38 
39 SourceFiles
40  mixtureViscosityModel.C
41  mixtureViscosityModelNew.C
42 
43 \*---------------------------------------------------------------------------*/
44 
45 #ifndef mixtureViscosityModel_H
46 #define mixtureViscosityModel_H
47 
48 #include "dictionary.H"
49 #include "volFieldsFwd.H"
50 #include "surfaceFieldsFwd.H"
51 #include "dimensionedScalar.H"
52 #include "runTimeSelectionTables.H"
53 
54 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55 
56 namespace Foam
57 {
58 
59 /*---------------------------------------------------------------------------*\
60  Class mixtureViscosityModel Declaration
61 \*---------------------------------------------------------------------------*/
62 
64 {
65 
66 protected:
67 
68  // Protected data
69 
72 
74  const surfaceScalarField& phi_;
75 
76 
77  // Private Member Functions
78 
79  //- No copy construct
81 
82  //- No copy assignment
83  void operator=(const mixtureViscosityModel&) = delete;
84 
85 
86 public:
87 
88  //- Runtime type information
89  TypeName("mixtureViscosityModel");
90 
91 
92  // Declare run-time constructor selection table
93 
95  (
96  autoPtr,
98  dictionary,
99  (
100  const word& name,
102  const volVectorField& U,
103  const surfaceScalarField& phi
104  ),
106  );
107 
108 
109  // Selectors
110 
111  //- Return a reference to the selected viscosity model
113  (
114  const word& name,
116  const volVectorField& U,
117  const surfaceScalarField& phi
118  );
119 
120 
121  // Constructors
122 
123  //- Construct from components
125  (
126  const word& name,
128  const volVectorField& U,
129  const surfaceScalarField& phi
130  );
131 
132 
133  //- Destructor
134  virtual ~mixtureViscosityModel() = default;
135 
136 
137  // Member Functions
138 
139  //- Return the phase transport properties dictionary
140  const dictionary& viscosityProperties() const
141  {
142  return viscosityProperties_;
143  }
144 
145  //- Return the mixture viscosity
146  // given the viscosity of the continuous phase
147  virtual tmp<volScalarField> mu(const volScalarField& muc) const = 0;
148 
149  //- Read transportProperties dictionary
150  virtual bool read(const dictionary& viscosityProperties) = 0;
151 };
152 
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 } // End namespace Foam
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 #endif
161 
162 // ************************************************************************* //
volFieldsFwd.H
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
Foam::mixtureViscosityModel
An abstract base class for incompressible mixtureViscosityModels.
Definition: mixtureViscosityModel.H:62
Foam::mixtureViscosityModel::~mixtureViscosityModel
virtual ~mixtureViscosityModel()=default
Destructor.
Foam::mixtureViscosityModel::read
virtual bool read(const dictionary &viscosityProperties)=0
Read transportProperties dictionary.
Foam::mixtureViscosityModel::mu
virtual tmp< volScalarField > mu(const volScalarField &muc) const =0
Return the mixture viscosity.
Foam::mixtureViscosityModel::viscosityProperties
const dictionary & viscosityProperties() const
Return the phase transport properties dictionary.
Definition: mixtureViscosityModel.H:139
Foam::mixtureViscosityModel::name_
word name_
Definition: mixtureViscosityModel.H:69
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::mixtureViscosityModel::New
static autoPtr< mixtureViscosityModel > New(const word &name, const dictionary &viscosityProperties, const volVectorField &U, const surfaceScalarField &phi)
Return a reference to the selected viscosity model.
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::mixtureViscosityModel::phi_
const surfaceScalarField & phi_
Definition: mixtureViscosityModel.H:73
Foam::mixtureViscosityModel::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, mixtureViscosityModel, dictionary,(const word &name, const dictionary &viscosityProperties, const volVectorField &U, const surfaceScalarField &phi),(name, viscosityProperties, U, phi))
dimensionedScalar.H
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::mixtureViscosityModel::operator=
void operator=(const mixtureViscosityModel &)=delete
No copy assignment.
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::mixtureViscosityModel::TypeName
TypeName("mixtureViscosityModel")
Runtime type information.
dictionary.H
surfaceFieldsFwd.H
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
Foam::mixtureViscosityModel::U_
const volVectorField & U_
Definition: mixtureViscosityModel.H:72
Foam::GeometricField
Generic GeometricField class.
Definition: areaFieldsFwd.H:53
Foam::mixtureViscosityModel::viscosityProperties_
dictionary viscosityProperties_
Definition: mixtureViscosityModel.H:70
Foam::mixtureViscosityModel::mixtureViscosityModel
mixtureViscosityModel(const mixtureViscosityModel &)=delete
No copy construct.