perturbedTemperatureDependentContactAngleForce.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) 2020 OpenCFD Ltd.
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 areaSurfaceFilmModels
38 {
39 
40 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
41 
42 defineTypeNameAndDebug(perturbedTemperatureDependentContactAngleForce, 0);
44 (
45  force,
46  perturbedTemperatureDependentContactAngleForce,
47  dictionary
48 );
49 
50 
51 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
52 
53 perturbedTemperatureDependentContactAngleForce::
54 perturbedTemperatureDependentContactAngleForce
55 (
56  liquidFilmBase& film,
57  const dictionary& dict
58 )
59 :
60  contactAngleForce(typeName, film, dict),
61  thetaPtr_(Function1<scalar>::New("theta", coeffDict_, &film.primaryMesh())),
62  rndGen_(label(0)),
63  distribution_
64  (
66  (
67  coeffDict_.subDict("distribution"),
68  rndGen_
69  )
70  )
71 {}
72 
73 
74 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
75 
78 {}
79 
80 
81 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
82 
84 theta() const
85 {
87  (
88  new areaScalarField
89  (
90  IOobject
91  (
92  typeName + ":theta",
93  film().primaryMesh().time().timeName(),
94  film().primaryMesh()
95  ),
96  film().regionMesh(),
98  )
99  );
100 
101  areaScalarField& theta = ttheta.ref();
102  scalarField& thetai = theta.ref();
103 
104  const areaScalarField& T = film().Tf();
105 
106  // Initialize with the function of temperature
107  thetai = thetaPtr_->value(T());
108 
109  // Add the stochastic perturbation
110  forAll(thetai, facei)
111  {
112  thetai[facei] += distribution_->sample();
113  }
114 
115  return ttheta;
116 }
117 
118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119 
120 } // End namespace surfaceFilmModels
121 } // End namespace regionModels
122 } // End namespace Foam
123 
124 // ************************************************************************* //
Foam::regionModels::areaSurfaceFilmModels::liquidFilmBase
Definition: liquidFilmBase.H:60
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:169
Foam::regionModels::regionFaModel::primaryMesh
const fvMesh & primaryMesh() const
Return the reference to the primary mesh database.
Definition: regionFaModelI.H:33
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
Foam::regionModels::areaSurfaceFilmModels::addToRunTimeSelectionTable
addToRunTimeSelectionTable(liquidFilmBase, kinematicThinFilm, dictionary)
Foam::Function1
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
Definition: propellerInfo.H:291
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:296
Foam::tmp::ref
T & ref() const
Definition: tmpI.H:227
Foam::Field< scalar >
Foam::regionModels::areaSurfaceFilmModels::perturbedTemperatureDependentContactAngleForce::theta
virtual tmp< areaScalarField > theta() const
Return the contact angle field.
Definition: perturbedTemperatureDependentContactAngleForce.C:84
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:58
perturbedTemperatureDependentContactAngleForce.H
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:42
timeName
word timeName
Definition: getTimeIndex.H:3
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
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::distributionModel::New
static autoPtr< distributionModel > New(const dictionary &dict, Random &rndGen)
Selector.
Definition: distributionModelNew.C:34
Foam::regionModels::areaSurfaceFilmModels::defineTypeNameAndDebug
defineTypeNameAndDebug(kinematicThinFilm, 0)
Foam::regionModels::areaSurfaceFilmModels::perturbedTemperatureDependentContactAngleForce::~perturbedTemperatureDependentContactAngleForce
virtual ~perturbedTemperatureDependentContactAngleForce()
Destructor.
Definition: perturbedTemperatureDependentContactAngleForce.C:77
Foam::regionModels::areaSurfaceFilmModels::contactAngleForce
Base-class for film contact angle force models.
Definition: contactAngleForce.H:57
Foam::GeometricField< scalar, faPatchField, areaMesh >
Foam::regionModels::areaSurfaceFilmModels::filmSubModelBase::film
const liquidFilmBase & film() const
Return const access to the film surface film model.
Definition: filmSubModelBaseI.H:39
Foam::regionModels::areaSurfaceFilmModels::liquidFilmBase::Tf
virtual const areaScalarField & Tf() const =0
Access const reference Tf.
Foam::dimless
const dimensionSet dimless
Dimensionless.
Definition: dimensionSets.C:189