alphaContactAngleTwoPhaseFvPatchScalarField.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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2017 OpenFOAM Foundation
9  Copyright (C) 2019 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 Class
28  Foam::alphaContactAngleTwoPhaseFvPatchScalarField
29 
30 Group
31  grpWallBoundaryConditions grpGenericBoundaryConditions
32 
33 Description
34  Abstract base class for two-phase alphaContactAngle boundary conditions.
35 
36  Derived classes must implement the theta() function which returns the
37  wall contact angle field.
38 
39  The essential entry "limit" controls the gradient of alpha1 on the wall:
40  - none - Calculate the gradient from the contact-angle without limiter
41  - gradient - Limit the wall-gradient such that alpha1 remains bounded
42  on the wall
43  - alpha - Bound the calculated alpha1 on the wall
44  - zeroGradient - Set the gradient of alpha1 to 0 on the wall, i.e.
45  reproduce previous behaviour, the pressure BCs can be left as before.
46 
47  Note that if any of the first three options are used the boundary condition
48  on \c p_rgh must set to guarantee that the flux is corrected to be zero at
49  the wall e.g.:
50 
51  \verbatim
52  <patchName>
53  {
54  type alphaContactAngle;
55  limit none;
56  }
57  \endverbatim
58 
59 SourceFiles
60  alphaContactAngleTwoPhaseFvPatchScalarField.C
61 
62 \*---------------------------------------------------------------------------*/
63 
64 #ifndef alphaContactAngleTwoPhaseFvPatchScalarField_H
65 #define alphaContactAngleTwoPhaseFvPatchScalarField_H
66 
68 #include "fvsPatchFields.H"
69 
70 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
71 
72 namespace Foam
73 {
74 
75 /*---------------------------------------------------------------------------*\
76  Class alphaContactAngleTwoPhaseFvPatchScalarField Declaration
77 \*---------------------------------------------------------------------------*/
78 
80 :
81  public fixedGradientFvPatchScalarField
82 {
83 public:
84 
85  // Abstract class, no runtime information
86 
87  //- Alpha limit options
88  enum limitControls
89  {
93  lcAlpha
94  };
95 
98 
99  // Constructors
100 
101  //- Construct from patch and internal field
103  (
104  const fvPatch&,
106  );
107 
108  //- Construct from patch, internal field and dictionary
110  (
111  const fvPatch&,
113  const dictionary&
114  );
115 
116  //- Construct by mapping onto a new patch
118  (
120  const fvPatch&,
122  const fvPatchFieldMapper&
123  );
124 
125  //- Construct as copy
127  (
129  );
130 
131  //- Construct as copy setting internal field reference
133  (
136  );
137 
138 
139  // Member functions
140 
141  //- Return the contact angle
142  virtual tmp<scalarField> theta
143  (
144  const fvPatchVectorField& Up,
145  const fvsPatchVectorField& nHat
146  ) const = 0;
147 
148  //- Evaluate the patch field
149  virtual void evaluate
150  (
152  );
153 
154  //- Write
155  virtual void write(Ostream& os) const;
156 };
157 
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 } // End namespace Foam
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 #endif
166 
167 // ************************************************************************* //
Foam::fvPatchField< vector >
Foam::alphaContactAngleTwoPhaseFvPatchScalarField::alphaContactAngleTwoPhaseFvPatchScalarField
alphaContactAngleTwoPhaseFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: alphaContactAngleTwoPhaseFvPatchScalarField.C:52
Foam::UPstream::commsTypes::blocking
Foam::Enum< limitControls >
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::alphaContactAngleTwoPhaseFvPatchScalarField::write
virtual void write(Ostream &os) const
Write.
Definition: alphaContactAngleTwoPhaseFvPatchScalarField.C:158
Foam::fvsPatchField
An abstract base class with a fat-interface to all derived classes covering all possible ways in whic...
Definition: fvsPatchField.H:68
Foam::alphaContactAngleTwoPhaseFvPatchScalarField::lcGradient
Definition: alphaContactAngleTwoPhaseFvPatchScalarField.H:90
Foam::alphaContactAngleTwoPhaseFvPatchScalarField::lcAlpha
Definition: alphaContactAngleTwoPhaseFvPatchScalarField.H:92
Foam::alphaContactAngleTwoPhaseFvPatchScalarField::evaluate
virtual void evaluate(const Pstream::commsTypes commsType=Pstream::commsTypes::blocking)
Evaluate the patch field.
Definition: alphaContactAngleTwoPhaseFvPatchScalarField.C:127
Foam::alphaContactAngleTwoPhaseFvPatchScalarField::limitControls
limitControls
Alpha limit options.
Definition: alphaContactAngleTwoPhaseFvPatchScalarField.H:87
Foam::alphaContactAngleTwoPhaseFvPatchScalarField
Abstract base class for two-phase alphaContactAngle boundary conditions.
Definition: alphaContactAngleTwoPhaseFvPatchScalarField.H:78
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
fixedGradientFvPatchFields.H
fvsPatchFields.H
Foam::alphaContactAngleTwoPhaseFvPatchScalarField::lcZeroGradient
Definition: alphaContactAngleTwoPhaseFvPatchScalarField.H:91
Foam::UPstream::commsTypes
commsTypes
Types of communications.
Definition: UPstream.H:69
Foam::alphaContactAngleTwoPhaseFvPatchScalarField::lcNone
Definition: alphaContactAngleTwoPhaseFvPatchScalarField.H:89
Foam::alphaContactAngleTwoPhaseFvPatchScalarField::theta
virtual tmp< scalarField > theta(const fvPatchVectorField &Up, const fvsPatchVectorField &nHat) const =0
Return the contact angle.
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::alphaContactAngleTwoPhaseFvPatchScalarField::limitControlNames_
static const Enum< limitControls > limitControlNames_
Definition: alphaContactAngleTwoPhaseFvPatchScalarField.H:95
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::alphaContactAngleTwoPhaseFvPatchScalarField::limit_
limitControls limit_
Definition: alphaContactAngleTwoPhaseFvPatchScalarField.H:96
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54