function1Viscosity.C
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) 2017-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 \*---------------------------------------------------------------------------*/
25 
26 #include "function1Viscosity.H"
28 
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
30 
31 namespace Foam
32 {
33 namespace regionModels
34 {
35 namespace surfaceFilmModels
36 {
37 
38 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
39 
40 defineTypeNameAndDebug(function1Viscosity, 0);
41 
43 (
44  viscosityModel,
45  function1Viscosity,
46  dictionary
47 );
48 
49 
50 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
51 
52 function1Viscosity::function1Viscosity
53 (
55  const dictionary& dict,
56  volScalarField& mu
57 )
58 :
59  viscosityModel(typeName, film, dict, mu),
60  viscosity_(viscosityModel::New(film, coeffDict_, mu)),
61  function_
62  (
63  Function1<scalar>::New("function", coeffDict_)
64  )
65 {}
66 
67 
68 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
69 
71 {}
72 
73 
74 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
75 
77 (
78  const volScalarField& p,
79  const volScalarField& T
80 )
81 {
82  viscosity_->correct(p, T);
85 }
86 
87 
88 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
89 
90 } // End namespace surfaceFilmModels
91 } // End namespace regionModels
92 } // End namespace Foam
93 
94 // ************************************************************************* //
Run-time selectable general function of one variable.
Definition: Function1.H:52
Base class for surface film viscosity models.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
volScalarField & mu_
Reference to the viscosity field.
static autoPtr< viscosityModel > New(surfaceFilmRegionModel &film, const dictionary &dict, volScalarField &mu)
Return a reference to the selected phase change model.
Macros for easy insertion into run-time selection tables.
virtual Type value(const scalar x) const =0
Return value as a function of scalar x.
virtual void correct(const volScalarField &p, const volScalarField &T)
Correct.
Internal::FieldType & primitiveFieldRef()
Return a reference to the internal field.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
autoPtr< viscosityModel > viscosity_
Base viscosity model.
autoPtr< Function1< scalar > > function_
Viscosity factor as a function of temperature.
void correctBoundaryConditions()
Correct boundary field.
volScalarField & p
defineTypeNameAndDebug(kinematicSingleLayer, 0)
addToRunTimeSelectionTable(surfaceFilmModel, noFilm, mesh)
Namespace for OpenFOAM.