temperatureDependentAlphaContactAngleFvPatchScalarField.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) 2015-2016 OpenFOAM Foundation
9  Copyright (C) 2019-2020 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 \*---------------------------------------------------------------------------*/
28 
30 #include "fvPatchFieldMapper.H"
31 #include "volFields.H"
33 
34 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
35 
38 (
39  const fvPatch& p,
41 )
42 :
43  parent_bctype(p, iF),
44  TName_("T"),
45  theta0_()
46 {}
47 
48 
51 (
52  const fvPatch& p,
54  const dictionary& dict
55 )
56 :
57  parent_bctype(p, iF, dict),
58  TName_(dict.getOrDefault<word>("T", "T")),
59  theta0_(Function1<scalar>::New("theta0", dict, &db()))
60 {
61  evaluate();
62 }
63 
64 
67 (
68  const this_bctype& psf,
69  const fvPatch& p,
71  const fvPatchFieldMapper& mapper
72 )
73 :
74  parent_bctype(psf, p, iF, mapper),
75  TName_(psf.TName_),
76  theta0_(psf.theta0_.clone())
77 {}
78 
79 
82 (
83  const this_bctype& psf,
85 )
86 :
87  parent_bctype(psf, iF),
88  TName_(psf.TName_),
89  theta0_(psf.theta0_.clone())
90 {}
91 
92 
93 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
94 
97 (
98  const fvPatchVectorField&,
99  const fvsPatchVectorField&
100 ) const
101 {
102  return theta0_->value
103  (
104  patch().lookupPatchField<volScalarField>(TName_)
105  );
106 }
107 
108 
110 (
111  Ostream& os
112 ) const
113 {
114  this->parent_bctype::write(os);
115  os.writeEntryIfDifferent<word>("T", "T", TName_);
116  theta0_->writeData(os);
118 }
119 
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 namespace Foam
124 {
126  (
128  temperatureDependentAlphaContactAngleFvPatchScalarField
129  );
130 }
131 
132 // ************************************************************************* //
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:130
temperatureDependentAlphaContactAngleFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
virtual tmp< scalarField > theta(const fvPatchVectorField &Up, const fvsPatchVectorField &nHat) const
Return the equilibrium contact-angle.
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.
void writeValueEntry(Ostream &os) const
Write *this field as a "value" entry.
Definition: fvPatchField.H:425
Ostream & writeEntryIfDifferent(const word &key, const T &refValue, const T &value)
Write a keyword/value entry only if the value differs from the reference value.
Definition: Ostream.H:346
Macros for easy insertion into run-time selection tables.
fvPatchField< scalar > fvPatchScalarField
A class for handling words, derived from Foam::string.
Definition: word.H:63
A FieldMapper for finite-volume patch fields.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
string evaluate(label fieldWidth, const std::string &s, size_t pos=0, size_t len=std::string::npos)
String evaluation with specified (positive, non-zero) field width.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const std::string patch
OpenFOAM patch number as a std::string.
volScalarField & p
A class for managing temporary objects.
Definition: HashPtrTable.H:50
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
An abstract base class with a fat-interface to all derived classes covering all possible ways in whic...
Namespace for OpenFOAM.