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-2012 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 Description
28  Contact-angle boundary condition for multi-phase interface-capturing
29  simulations. Used in conjuction with multiphaseSystem.
30 
31 SourceFiles
32  alphaContactAngleFvPatchScalarField.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef alphaContactAngleFvPatchScalarField_H
37 #define alphaContactAngleFvPatchScalarField_H
38 
40 #include "multiphaseSystem.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class alphaContactAngleFvPatch Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 class alphaContactAngleFvPatchScalarField
52 :
53  public zeroGradientFvPatchScalarField
54 {
55 public:
56 
57  class interfaceThetaProps
58  {
59  //- Equilibrium contact angle
60  scalar theta0_;
61 
62  //- Dynamic contact angle velocity scale
63  scalar uTheta_;
64 
65  //- Limiting advancing contact angle
66  scalar thetaA_;
67 
68  //- Limiting receeding contact angle
69  scalar thetaR_;
70 
71 
72  public:
73 
74  // Constructors
76  {}
77 
79 
80 
81  // Member functions
82 
83  //- Return the equilibrium contact angle theta0
84  scalar theta0(bool matched=true) const
85  {
86  if (matched) return theta0_;
87  else return 180.0 - theta0_;
88  }
89 
90  //- Return the dynamic contact angle velocity scale
91  scalar uTheta() const
92  {
93  return uTheta_;
94  }
95 
96  //- Return the limiting advancing contact angle
97  scalar thetaA(bool matched=true) const
98  {
99  if (matched) return thetaA_;
100  else return 180.0 - thetaA_;
101  }
102 
103  //- Return the limiting receeding contact angle
104  scalar thetaR(bool matched=true) const
105  {
106  if (matched) return thetaR_;
107  else return 180.0 - thetaR_;
108  }
109 
110 
111  // IO functions
112 
114  friend Ostream& operator<<(Ostream&, const interfaceThetaProps&);
115  };
116 
117  typedef HashTable
118  <
122  > thetaPropsTable;
123 
124 
125 private:
126 
127  // Private data
128 
129  thetaPropsTable thetaProps_;
130 
131 
132 public:
133 
134  //- Runtime type information
135  TypeName("alphaContactAngle");
136 
137 
138  // Constructors
139 
140  //- Construct from patch and internal field
142  (
143  const fvPatch&,
145  );
146 
147  //- Construct from patch, internal field and dictionary
149  (
150  const fvPatch&,
152  const dictionary&
153  );
154 
155  //- Construct by mapping given alphaContactAngleFvPatchScalarField
156  // onto a new patch
158  (
160  const fvPatch&,
162  const fvPatchFieldMapper&
163  );
164 
165  //- Construct and return a clone
166  virtual tmp<fvPatchScalarField> clone() const
167  {
169  (
171  );
172  }
173 
174  //- Construct as copy setting internal field reference
176  (
179  );
180 
181  //- Construct and return a clone setting internal field reference
183  (
185  ) const
186  {
188  (
190  );
191  }
192 
193 
194  // Member functions
195 
196  //- Return the contact angle properties
197  const thetaPropsTable& thetaProps() const
198  {
199  return thetaProps_;
200  }
201 
202  //- Write
203  virtual void write(Ostream&) const;
204 };
205 
206 
207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208 
209 } // End namespace Foam
210 
211 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212 
213 #endif
214 
215 // ************************************************************************* //
scalar thetaA(bool matched=true) const
Return the limiting advancing contact angle.
HashTable< interfaceThetaProps, multiphaseMixtureThermo::interfacePair, multiphaseMixtureThermo::interfacePair::hash > thetaPropsTable
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
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:61
TypeName("alphaContactAngle")
Runtime type information.
Foam::fvPatchFieldMapper.
const thetaPropsTable & thetaProps() const
Return the contact angle properties.
An STL-conforming hash table.
Definition: HashTable.H:62
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Abstract base class for alphaContactAngle boundary conditions.
scalar thetaR(bool matched=true) const
Return the limiting receeding 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: PtrList.H:53
Namespace for OpenFOAM.