contactAngleFvPatchScalarField.H
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) 2011-2023 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 Class
25  Foam::contactAngleFvPatchScalarField
26 
27 Description
28  General alpha contact angle boundary condition.
29 
30  The essential entry "limit" controls the gradient of alpha1 on the wall:
31  - none - Calculate the gradient from the contact-angle without limiter
32  - gradient - Limit the wall-gradient such that alpha1 remains bounded
33  on the wall
34  - alpha - Bound the calculated alpha1 on the wall
35  - zeroGradient - Set the gradient of alpha1 to 0 on the wall, i.e.
36  reproduce previous behaviour, the pressure BCs can be left as before.
37 
38  Note that if any of the first three options are used the boundary condition
39  on \c p_rgh must set to guarantee that the flux is corrected to be zero at
40  the wall.
41 
42 Usage
43  \table
44  Property | Description | Required | Default value
45  limit | Limiting option | yes |
46  contantAngle | Contact angle model settings | no | none
47  \endtable
48 
49  Example of the boundary condition specification for a constant angle:
50  \verbatim
51  <patchName>
52  {
53  type contactAngle;
54  limit none;
55  contactAngle
56  {
57  type constant;
58  theta0 70;
59  }
60  }
61  \endverbatim
62 
63  If the contactAngle sub-dictionary is not given, a constant angle will be
64  assumed. Example:
65  \verbatim
66  <patchName>
67  {
68  type contactAngle;
69  limit none;
70  theta0 70;
71  }
72  \endverbatim
73 
74 See also
75  Foam::contactAngleModel
76  Foam::contactAngleModels::constant
77  Foam::contactAngleModels::dynamic
78 
79 SourceFiles
80  contactAngleFvPatchScalarField.C
81 
82 \*---------------------------------------------------------------------------*/
83 
84 #ifndef contactAngleFvPatchScalarField_H
85 #define contactAngleFvPatchScalarField_H
86 
88 #include "contactAngleModel.H"
89 
90 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
91 
92 namespace Foam
93 {
94 
95 /*---------------------------------------------------------------------------*\
96  Class contactAngleFvPatchScalarField Declaration
97 \*---------------------------------------------------------------------------*/
98 
99 class contactAngleFvPatchScalarField
100 :
101  public fixedGradientFvPatchScalarField
102 {
103 public:
104 
105  // Public Enumerations
106 
107  //- Alpha limit options
108  enum limitControls
109  {
110  lcNone,
111  lcGradient,
114  };
115 
116  //- Alpha limit option names
118 
119 
120 private:
121 
122  // Private Data
123 
124  //- Equilibrium contact angle function
126 
127  //- Alpha limiting option
129 
130 
131 public:
132 
133  //- Runtime type information
134  TypeName("contactAngle");
135 
136 
137  // Constructors
138 
139  //- Construct from patch, internal field and dictionary
141  (
142  const fvPatch&,
144  const dictionary&
145  );
146 
147  //- Construct by mapping given contactAngleFvPatchScalarField
148  // onto a new patch
150  (
152  const fvPatch&,
154  const fieldMapper&
155  );
156 
157  //- Disallow copy without setting internal field reference
159  (
161  ) = delete;
162 
163  //- Copy constructor setting internal field reference
165  (
168  );
169 
170 
171  // Member Functions
172 
173  //- Return the cosine of the contact angle
175  (
176  const fvPatchVectorField& Up,
177  const vectorField& nHat
178  ) const;
179 
180  //- Evaluate the patch field
181  virtual void evaluate
182  (
184  );
185 
186  //- Write
187  virtual void write(Ostream&) const;
188 };
189 
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 } // End namespace Foam
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 #endif
198 
199 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
commsTypes
Types of communications.
Definition: UPstream.H:65
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
General alpha contact angle boundary condition.
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Evaluate the patch field.
TypeName("contactAngle")
Runtime type information.
virtual void write(Ostream &) const
Write.
static const NamedEnum< limitControls, 4 > limitControlNames_
Alpha limit option names.
tmp< scalarField > cosTheta(const fvPatchVectorField &Up, const vectorField &nHat) const
Return the cosine of the contact angle.
contactAngleFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
Abstract base class for field mapping.
Definition: fieldMapper.H:48
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:88
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
A class for managing temporary objects.
Definition: tmp.H:55
Namespace for OpenFOAM.