alphaContactAngleFvPatchScalarField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2020 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 conjunction with phaseSystem.
30 
31 SourceFiles
32  alphaContactAngleFvPatchScalarField.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef alphaContactAngleFvPatchScalarField_H
37 #define alphaContactAngleFvPatchScalarField_H
38 
40 #include "phaseSystem.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 receding 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 receding 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  <
120  phasePairKey,
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 as copy setting internal field reference
167  (
170  );
171 
172  //- Construct and return a clone setting internal field reference
174  (
176  ) const
177  {
179  (
181  );
182  }
183 
184 
185  // Member Functions
186 
187  //- Return the contact angle properties
188  const thetaPropsTable& thetaProps() const
189  {
190  return thetaProps_;
191  }
192 
193  //- Write
194  virtual void write(Ostream&) const;
195 };
196 
197 
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 
200 } // End namespace Foam
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 #endif
205 
206 // ************************************************************************* //
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:156
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:62
TypeName("alphaContactAngle")
Runtime type information.
virtual tmp< fvPatchScalarField > clone(const DimensionedField< scalar, volMesh > &iF) const
Construct and return a clone setting internal field reference.
Foam::fvPatchFieldMapper.
const thetaPropsTable & thetaProps() const
Return the contact angle properties.
An STL-conforming hash table.
Definition: HashTable.H:61
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
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 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: PtrList.H:53
Namespace for OpenFOAM.