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 e.g.:
41 
42  \verbatim
43  <patchName>
44  {
45  type contactAngle;
46  limit none;
47  theta0 70;
48  }
49  \endverbatim
50 
51 See also
52  Foam::contactAngleModel
53  Foam::contactAngleModels::constant
54  Foam::contactAngleModels::dynamic
55 
56 SourceFiles
57  contactAngleFvPatchScalarField.C
58 
59 \*---------------------------------------------------------------------------*/
60 
61 #ifndef contactAngleFvPatchScalarField_H
62 #define contactAngleFvPatchScalarField_H
63 
65 #include "contactAngleModel.H"
66 
67 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
68 
69 namespace Foam
70 {
71 
72 /*---------------------------------------------------------------------------*\
73  Class contactAngleFvPatchScalarField Declaration
74 \*---------------------------------------------------------------------------*/
75 
77 :
78  public fixedGradientFvPatchScalarField
79 {
80  // Private Data
81 
82  //- Equilibrium contact angle function
83  autoPtr<contactAngleModel> contactAngle_;
84 
85 
86 public:
87 
88  //- Runtime type information
89  TypeName("contactAngle");
90 
91  //- Alpha limit options
92  enum limitControls
93  {
98  };
99 
102 
103  // Constructors
104 
105  //- Construct from patch, internal field and dictionary
107  (
108  const fvPatch&,
110  const dictionary&
111  );
112 
113  //- Construct by mapping given contactAngleFvPatchScalarField
114  // onto a new patch
116  (
118  const fvPatch&,
120  const fvPatchFieldMapper&
121  );
122 
123  //- Disallow copy without setting internal field reference
125  (
127  ) = delete;
128 
129  //- Copy constructor setting internal field reference
131  (
134  );
135 
136 
137  // Member Functions
138 
139  //- Return the cosine of the contact angle
141  (
142  const fvPatchVectorField& Up,
143  const vectorField& nHat
144  ) const;
145 
146  //- Evaluate the patch field
147  virtual void evaluate
148  (
150  );
151 
152  //- Write
153  virtual void write(Ostream&) const;
154 };
155 
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 } // End namespace Foam
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 #endif
164 
165 // ************************************************************************* //
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_
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:160
Foam::fvPatchFieldMapper.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:87
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.