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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::alphaContactAngleFvPatchScalarField
28 
29 Description
30  Contact-angle boundary condition for multi-phase interface-capturing
31  simulations. Used in conjunction with multiphaseMixture.
32 
33 SourceFiles
34  alphaContactAngleFvPatchScalarField.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef alphaContactAngleFvPatchScalarField_H
39 #define alphaContactAngleFvPatchScalarField_H
40 
42 #include "multiphaseMixture.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class alphaContactAngleFvPatch Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class alphaContactAngleFvPatchScalarField
54 :
55  public zeroGradientFvPatchScalarField
56 {
57 public:
58 
59  class interfaceThetaProps
60  {
61  //- Equilibrium contact angle
62  scalar theta0_;
63 
64  //- Dynamic contact angle velocity scale
65  scalar uTheta_;
66 
67  //- Limiting advancing contact angle
68  scalar thetaA_;
69 
70  //- Limiting receding contact angle
71  scalar thetaR_;
72 
73 
74  public:
75 
76  // Constructors
78  {}
79 
81 
82 
83  // Member functions
84 
85  //- Return the equilibrium contact angle theta0
86  scalar theta0(bool matched=true) const
87  {
88  if (matched) return theta0_;
89  else return 180.0 - theta0_;
90  }
91 
92  //- Return the dynamic contact angle velocity scale
93  scalar uTheta() const
94  {
95  return uTheta_;
96  }
97 
98  //- Return the limiting advancing contact angle
99  scalar thetaA(bool matched=true) const
100  {
101  if (matched) return thetaA_;
102  else return 180.0 - thetaA_;
103  }
104 
105  //- Return the limiting receding contact angle
106  scalar thetaR(bool matched=true) const
107  {
108  if (matched) return thetaR_;
109  else return 180.0 - thetaR_;
110  }
111 
112 
113  // IO functions
114 
116  friend Ostream& operator<<(Ostream&, const interfaceThetaProps&);
117  };
118 
119  typedef HashTable
120  <
124  > thetaPropsTable;
125 
126 
127 private:
128 
129  // Private data
130 
131  thetaPropsTable thetaProps_;
132 
133 
134 public:
136  //- Runtime type information
137  TypeName("alphaContactAngle");
138 
139 
140  // Constructors
141 
142  //- Construct from patch and internal field
144  (
145  const fvPatch&,
147  );
148 
149  //- Construct from patch, internal field and dictionary
151  (
152  const fvPatch&,
154  const dictionary&
155  );
156 
157  //- Construct by mapping given alphaContactAngleFvPatchScalarField
158  // onto a new patch
160  (
162  const fvPatch&,
164  const fvPatchFieldMapper&
165  );
166 
167  //- Construct and return a clone
168  virtual tmp<fvPatchScalarField> clone() const
169  {
171  (
173  );
174  }
175 
176  //- Construct as copy setting internal field reference
178  (
181  );
182 
183  //- Construct and return a clone setting internal field reference
185  (
187  ) const
188  {
190  (
192  );
193  }
194 
195 
196  // Member functions
197 
198  //- Return the contact angle properties
199  const thetaPropsTable& thetaProps() const
200  {
201  return thetaProps_;
202  }
203 
204  //- Write
205  virtual void write(Ostream&) const;
206 };
207 
208 
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 
211 } // End namespace Foam
212 
213 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214 
215 #endif
216 
217 // ************************************************************************* //
scalar thetaA(bool matched=true) const
Return the limiting advancing contact angle.
HashTable< interfaceThetaProps, multiphaseMixtureThermo::interfacePair, multiphaseMixtureThermo::interfacePair::hash > thetaPropsTable
Symmetric pair of interface names.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
friend Istream & operator>>(Istream &, interfaceThetaProps &)
scalar uTheta() const
Return the dynamic contact angle velocity scale.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
scalar theta0(bool matched=true) const
Return the equilibrium contact angle theta0.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
TypeName("alphaContactAngle")
Runtime type information.
virtual void write(Ostream &) const
Write.
A FieldMapper for finite-volume patch fields.
const thetaPropsTable & thetaProps() const
Return the contact angle properties.
A HashTable similar to std::unordered_map.
Definition: HashTable.H:108
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: areaFieldsFwd.H:42
Contact-angle boundary condition for multi-phase interface-capturing simulations. Used in conjunction...
scalar thetaR(bool matched=true) const
Return the limiting receding contact angle.
alphaContactAngleFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
friend Ostream & operator<<(Ostream &, const interfaceThetaProps &)
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Namespace for OpenFOAM.