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-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 \*---------------------------------------------------------------------------*/
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  filmViscosityModel,
45  function1Viscosity,
46  dictionary
47 );
48 
49 
50 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
51 
52 function1Viscosity::function1Viscosity
53 (
55  const dictionary& dict,
56  volScalarField& mu
57 )
58 :
59  filmViscosityModel(typeName, film, dict, mu),
60  viscosity_(filmViscosityModel::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);
83  mu_.primitiveFieldRef() *= function_->value(T)();
85 }
86 
87 
88 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
89 
90 } // End namespace surfaceFilmModels
91 } // End namespace regionModels
92 } // End namespace Foam
93 
94 // ************************************************************************* //
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
Definition: Function1.H:53
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
static autoPtr< filmViscosityModel > New(surfaceFilmRegionModel &film, const dictionary &dict, volScalarField &mu)
Return a reference to the selected phase change model.
addToRunTimeSelectionTable(surfaceFilmRegionModel, kinematicSingleLayer, mesh)
Macros for easy insertion into run-time selection tables.
Base class for surface film viscosity models.
virtual void correct(const volScalarField &p, const volScalarField &T)
Correct.
Internal::FieldType & primitiveFieldRef()
Return a reference to the internal field.
volScalarField & mu_
Reference to the viscosity field.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
autoPtr< Function1< scalar > > function_
Viscosity factor as a function of temperature.
autoPtr< filmViscosityModel > viscosity_
Base viscosity model.
void correctBoundaryConditions()
Correct boundary field.
volScalarField & p
defineTypeNameAndDebug(kinematicSingleLayer, 0)
Namespace for OpenFOAM.