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  <
121  interfaceThetaProps,
124  > thetaPropsTable;
125 
126 
127 private:
128 
129  // Private data
130 
131  thetaPropsTable thetaProps_;
132 
133 
134 public:
135 
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 // ************************************************************************* //
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::alphaContactAngleFvPatchScalarField::interfaceThetaProps::operator>>
friend Istream & operator>>(Istream &, interfaceThetaProps &)
Definition: alphaContactAngleFvPatchScalarField.C:50
Foam::alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
alphaContactAngleFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: alphaContactAngleFvPatchScalarField.C:78
Foam::alphaContactAngleFvPatchScalarField::thetaPropsTable
HashTable< interfaceThetaProps, multiphaseMixture::interfacePair, multiphaseMixture::interfacePair::hash > thetaPropsTable
Definition: alphaContactAngleFvPatchScalarField.H:123
Foam::alphaContactAngleFvPatchScalarField::interfaceThetaProps::thetaA
scalar thetaA(bool matched=true) const
Return the limiting advancing contact angle.
Definition: alphaContactAngleFvPatchScalarField.H:98
Foam::multiphaseMixture::interfacePair
Symmetric pair of interface names.
Definition: multiphaseMixture.H:74
Foam::alphaContactAngleFvPatchScalarField::thetaProps
const thetaPropsTable & thetaProps() const
Return the contact angle properties.
Definition: alphaContactAngleFvPatchScalarField.H:198
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::multiphaseMixture::interfacePair::hash
Pair< word >::symmHasher hash
Definition: multiphaseMixture.H:84
Foam::alphaContactAngleFvPatchScalarField::write
virtual void write(Ostream &) const
Write.
Definition: alphaContactAngleFvPatchScalarField.C:127
Foam::alphaContactAngleFvPatchScalarField::interfaceThetaProps::thetaR
scalar thetaR(bool matched=true) const
Return the limiting receding contact angle.
Definition: alphaContactAngleFvPatchScalarField.H:105
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::alphaContactAngleFvPatchScalarField::interfaceThetaProps::operator<<
friend Ostream & operator<<(Ostream &, const interfaceThetaProps &)
Definition: alphaContactAngleFvPatchScalarField.C:61
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::alphaContactAngleFvPatchScalarField
Contact-angle boundary condition for multi-phase interface-capturing simulations. Used in conjunction...
Definition: alphaContactAngleFvPatchScalarField.H:52
Foam::alphaContactAngleFvPatchScalarField::interfaceThetaProps
Definition: alphaContactAngleFvPatchScalarField.H:58
Foam::HashTable
A HashTable similar to std::unordered_map.
Definition: HashTable.H:105
Foam::alphaContactAngleFvPatchScalarField::interfaceThetaProps::interfaceThetaProps
interfaceThetaProps()
Definition: alphaContactAngleFvPatchScalarField.H:76
multiphaseMixture.H
Foam::alphaContactAngleFvPatchScalarField::interfaceThetaProps::uTheta
scalar uTheta() const
Return the dynamic contact angle velocity scale.
Definition: alphaContactAngleFvPatchScalarField.H:92
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::alphaContactAngleFvPatchScalarField::TypeName
TypeName("alphaContactAngle")
Runtime type information.
zeroGradientFvPatchFields.H
Foam::alphaContactAngleFvPatchScalarField::thetaPropsTable
HashTable< interfaceThetaProps, multiphaseSystem::interfacePair, multiphaseSystem::interfacePair::symmHash > thetaPropsTable
Definition: alphaContactAngleFvPatchScalarField.H:123
Foam::alphaContactAngleFvPatchScalarField::clone
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
Definition: alphaContactAngleFvPatchScalarField.H:167
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54
Foam::alphaContactAngleFvPatchScalarField::interfaceThetaProps::theta0
scalar theta0(bool matched=true) const
Return the equilibrium contact angle theta0.
Definition: alphaContactAngleFvPatchScalarField.H:85