alphaContactAngleFvPatchScalarField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011-2013 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::alphaContactAngleFvPatchScalarField
26 
27 Group
28  grpWallBoundaryConditions grpGenericBoundaryConditions
29 
30 Description
31  Abstract base class for alphaContactAngle boundary conditions.
32 
33  Derived classes must implement the theta() fuction which returns the
34  wall contact angle field.
35 
36  The essential entry "limit" controls the gradient of alpha1 on the wall:
37 
38  limit none; // Calculate the gradient from the contact-angle without
39  // limiter
40 
41  limit gradient; // Limit the wall-gradient such that alpha1 remains
42  // bounded on the wall
43 
44  limit alpha; // Bound the calculated alpha1 on the wall
45 
46  limit zeroGradient; // Set the gradient of alpha1 to 0 on the wall
47  // i.e. reproduce previous behaviour
48 
49  Note that if any of the first three options are used the boundary condition
50  on p_rgh must set to guarantee that the flux is corrected to be zero at the
51  wall e.g.
52 
53  \verbatim
54  myPatch
55  {
56  type alphaContactAngle;
57  }
58  \endverbatim
59 
60  If "limit zeroGradient;" is used the pressure BCs can be left as before.
61 
62 SourceFiles
63  alphaContactAngleFvPatchScalarField.C
64 
65 \*---------------------------------------------------------------------------*/
66 
67 #ifndef alphaContactAngleFvPatchScalarField_H
68 #define alphaContactAngleFvPatchScalarField_H
69 
71 #include "fvsPatchFields.H"
72 
73 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
74 
75 namespace Foam
76 {
77 
78 /*---------------------------------------------------------------------------*\
79  Class alphaContactAngleFvPatchScalarField Declaration
80 \*---------------------------------------------------------------------------*/
81 
83 :
84  public fixedGradientFvPatchScalarField
85 {
86 
87 public:
88 
89  //- Runtime type information
90  TypeName("alphaContactAngle");
91 
92  //- Alpha limit options
93  enum limitControls
94  {
98  lcAlpha
99  };
100 
103 
104  // Constructors
105 
106  //- Construct from patch and internal field
108  (
109  const fvPatch&,
111  );
112 
113  //- Construct from patch, internal field and dictionary
115  (
116  const fvPatch&,
118  const dictionary&
119  );
120 
121  //- Construct by mapping given alphaContactAngleFvPatchScalarField
122  // onto a new patch
124  (
126  const fvPatch&,
128  const fvPatchFieldMapper&
129  );
130 
131  //- Construct as copy
133  (
135  );
136 
137  //- Construct as copy setting internal field reference
139  (
142  );
143 
144 
145  // Member functions
146 
147  //- Return the contact angle
148  virtual tmp<scalarField> theta
149  (
150  const fvPatchVectorField& Up,
151  const fvsPatchVectorField& nHat
152  ) const = 0;
153 
154  //- Evaluate the patch field
155  virtual void evaluate
156  (
157  const Pstream::commsTypes commsType=Pstream::blocking
158  );
159 
160  //- Write
161  virtual void write(Ostream&) const;
162 };
163 
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 } // End namespace Foam
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 #endif
172 
173 // ************************************************************************* //
Foam::fvPatchField
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:65
Foam::alphaContactAngleFvPatchScalarField::limitControls
limitControls
Alpha limit options.
Definition: alphaContactAngleFvPatchScalarField.H:92
Foam::alphaContactAngleFvPatchScalarField::lcZeroGradient
@ lcZeroGradient
Definition: alphaContactAngleFvPatchScalarField.H:96
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::fvsPatchField
An abstract base class with a fat-interface to all derived classes covering all possible ways in whic...
Definition: fvsPatchField.H:65
Foam::alphaContactAngleFvPatchScalarField::theta
virtual tmp< scalarField > theta(const fvPatchVectorField &Up, const fvsPatchVectorField &nHat) const =0
Return the contact angle.
Foam::alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
alphaContactAngleFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: alphaContactAngleFvPatchScalarField.C:62
Foam::alphaContactAngleFvPatchScalarField::limitControlNames_
static const NamedEnum< limitControls, 4 > limitControlNames_
Definition: alphaContactAngleFvPatchScalarField.H:100
Foam::UPstream::blocking
@ blocking
Definition: UPstream.H:66
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::alphaContactAngleFvPatchScalarField::write
virtual void write(Ostream &) const
Write.
Definition: alphaContactAngleFvPatchScalarField.C:164
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::alphaContactAngleFvPatchScalarField::limit_
limitControls limit_
Definition: alphaContactAngleFvPatchScalarField.H:101
Foam::alphaContactAngleFvPatchScalarField
Abstract base class for alphaContactAngle boundary conditions.
Definition: alphaContactAngleFvPatchScalarField.H:81
fixedGradientFvPatchFields.H
fvsPatchFields.H
Foam::alphaContactAngleFvPatchScalarField::lcNone
@ lcNone
Definition: alphaContactAngleFvPatchScalarField.H:94
Foam::alphaContactAngleFvPatchScalarField::lcAlpha
@ lcAlpha
Definition: alphaContactAngleFvPatchScalarField.H:97
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:64
Foam::alphaContactAngleFvPatchScalarField::lcGradient
@ lcGradient
Definition: alphaContactAngleFvPatchScalarField.H:95
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::alphaContactAngleFvPatchScalarField::evaluate
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::blocking)
Evaluate the patch field.
Definition: alphaContactAngleFvPatchScalarField.C:133
Foam::alphaContactAngleFvPatchScalarField::TypeName
TypeName("alphaContactAngle")
Runtime type information.
Foam::NamedEnum< limitControls, 4 >
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51