temperatureDependentContactAngleForce.C
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) 2017 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
30 
31 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
35 namespace regionModels
36 {
37 namespace surfaceFilmModels
38 {
39 
40 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
41 
42 defineTypeNameAndDebug(temperatureDependentContactAngleForce, 0);
44 (
45  force,
46  temperatureDependentContactAngleForce,
48 );
49 
50 
51 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
52 
53 temperatureDependentContactAngleForce::temperatureDependentContactAngleForce
54 (
56  const dictionary& dict
57 )
58 :
59  contactAngleForce(typeName, film, dict),
60  thetaPtr_(Function1<scalar>::New("theta", coeffDict_, &film.regionMesh()))
61 {}
62 
63 
64 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
65 
67 {}
68 
69 
70 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
71 
73 {
74  tmp<volScalarField> ttheta
75  (
76  new volScalarField
77  (
78  IOobject
79  (
80  typeName + ":theta",
83  ),
86  )
87  );
88 
89  volScalarField& theta = ttheta.ref();
90 
91  const volScalarField& T = filmModel_.T();
92 
93  theta.ref().field() = thetaPtr_->value(T());
94 
95  forAll(theta.boundaryField(), patchi)
96  {
97  if (!filmModel_.isCoupledPatch(patchi))
98  {
99  theta.boundaryFieldRef()[patchi] =
100  thetaPtr_->value(T.boundaryField()[patchi]);
101  }
102  }
103 
104  return ttheta;
105 }
106 
107 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
108 
109 } // End namespace surfaceFilmModels
110 } // End namespace regionModels
111 } // End namespace Foam
112 
113 // ************************************************************************* //
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
dictionary dict
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
const dimensionSet dimless
Dimensionless.
virtual tmp< volScalarField > theta() const
Return the contact angle field.
addToRunTimeSelectionTable(surfaceFilmRegionModel, kinematicSingleLayer, mesh)
Macros for easy insertion into run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:421
bool isCoupledPatch(const label regionPatchi) const
True if patchi on the local region is a coupled patch to the primary region.
Definition: regionModelI.H:104
const fvMesh & regionMesh() const
Return the region mesh database.
Definition: regionModelI.H:26
Base-class for film contact angle force models.
static word timeName(const scalar t, const int precision=precision_)
Return a time name for the given scalar time value formatted with the given precision.
Definition: Time.C:714
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
surfaceFilmRegionModel & filmModel_
Reference to the film surface film model.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Defines the attributes of an object for which implicit objectRegistry management is supported...
Definition: IOobject.H:172
defineTypeNameAndDebug(kinematicSingleLayer, 0)
const Time & time() const noexcept
Return the reference to the time database.
Definition: regionModel.H:244
Namespace for OpenFOAM.
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:127
virtual const volScalarField & T() const =0
Return the film mean temperature [K].