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-2018 OpenFOAM Foundation
9  Copyright (C) 2021 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::alphaContactAngleFvPatchScalarField
29 
30 Description
31  Contact-angle boundary condition for multi-phase interface-capturing
32  simulations. Used in conjunction with \c multiphaseSystem.
33 
34 Usage
35  Example of the boundary condition specification:
36  \verbatim
37  <patch>
38  {
39  // Mandatory entries
40  type alphaContactAngle;
41  thetaProperties
42  (
43  (<phase1> <phase2>) <scalar1> <scalar2> <scalar3> <scalar4>
44  (<phase3> <phase2>) <scalar1> <scalar2> <scalar3> <scalar4>
45  ...
46  );
47 
48  // Inherited entries
49  ...
50  }
51  \endverbatim
52 
53  where the entries mean:
54  \table
55  Property | Description | Type | Reqd | Deflt
56  type | Type name: alphaContactAngle | word | yes | -
57  thetaProperties | Contact-angle properties | dict | yes | -
58  <scalar1> | Equilibrium contact angle | scalar | yes |-
59  <scalar2> | Dynamic contact angle velocity scale | scalar | yes |-
60  <scalar3> | Limiting advancing contact angle | scalar | yes |-
61  <scalar4> | Limiting receding contact angle | scalar | yes |-
62  \endtable
63 
64  The inherited entries are elaborated in:
65  - \link zeroGradientFvPatchFields.H \endlink
66 
67 SourceFiles
68  alphaContactAngleFvPatchScalarField.C
69 
70 \*---------------------------------------------------------------------------*/
71 
72 #ifndef alphaContactAngleFvPatchScalarField_H
73 #define alphaContactAngleFvPatchScalarField_H
74 
76 #include "multiphaseSystem.H"
77 
78 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
79 
80 namespace Foam
81 {
82 
83 /*---------------------------------------------------------------------------*\
84  Class alphaContactAngleFvPatch Declaration
85 \*---------------------------------------------------------------------------*/
86 
87 class alphaContactAngleFvPatchScalarField
88 :
89  public zeroGradientFvPatchScalarField
90 {
91 public:
92 
93  class interfaceThetaProps
94  {
95  //- Equilibrium contact angle
96  scalar theta0_;
97 
98  //- Dynamic contact angle velocity scale
99  scalar uTheta_;
100 
101  //- Limiting advancing contact angle
102  scalar thetaA_;
103 
104  //- Limiting receding contact angle
105  scalar thetaR_;
106 
107 
108  public:
109 
110  // Constructors
111 
112  //- Default construct
114  {}
115 
116  //- Construct from Istream
117  interfaceThetaProps(Istream&);
118 
119 
120  // Member Functions
121 
122  //- Return the equilibrium contact angle theta0
123  scalar theta0(bool matched=true) const
124  {
125  if (matched) return theta0_;
126  else return 180.0 - theta0_;
127  }
128 
129  //- Return the dynamic contact angle velocity scale
130  scalar uTheta() const noexcept
131  {
132  return uTheta_;
133  }
134 
135  //- Return the limiting advancing contact angle
136  scalar thetaA(bool matched=true) const
137  {
138  if (matched) return thetaA_;
139  else return 180.0 - thetaA_;
140  }
141 
142  //- Return the limiting receding contact angle
143  scalar thetaR(bool matched=true) const
144  {
145  if (matched) return thetaR_;
146  else return 180.0 - thetaR_;
147  }
148 
149 
150  // IOstream operators
151 
152  friend Istream& operator>>(Istream&, interfaceThetaProps&);
153  friend Ostream& operator<<(Ostream&, const interfaceThetaProps&);
154  };
155 
156  typedef HashTable
157  <
159  phasePairKey,
161  > thetaPropsTable;
162 
163 
164 private:
165 
166  // Private Data
167 
168  //- Interface properties
169  thetaPropsTable thetaProps_;
170 
171 
172 public:
173 
174  //- Runtime type information
175  TypeName("alphaContactAngle");
176 
177 
178  // Constructors
179 
180  //- Construct from patch and internal field
182  (
183  const fvPatch&,
185  );
186 
187  //- Construct from patch, internal field and dictionary
189  (
190  const fvPatch&,
192  const dictionary&
193  );
194 
195  //- Construct by mapping given alphaContactAngleFvPatchScalarField
196  //- onto a new patch
198  (
200  const fvPatch&,
203  );
204 
205  //- Construct and return a clone
206  virtual tmp<fvPatchScalarField> clone() const
207  {
209  (
211  );
212  }
213 
214  //- Construct as copy setting internal field reference
216  (
219  );
220 
221  //- Construct and return a clone setting internal field reference
223  (
225  ) const
226  {
228  (
230  );
231  }
232 
233 
234  // Member Functions
235 
236  //- Return the contact angle properties
237  const thetaPropsTable& thetaProps() const noexcept
238  {
239  return thetaProps_;
240  }
241 
242  //- Write
243  virtual void write(Ostream&) const;
244 };
245 
246 
247 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
248 
249 } // End namespace Foam
250 
251 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
252 
253 #endif
254 
255 // ************************************************************************* //
Foam::phasePairKey::hasher
Hashing functor for phasePairKey.
Definition: phasePairKey.H:122
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::alphaContactAngleFvPatchScalarField::interfaceThetaProps::uTheta
scalar uTheta() const noexcept
Return the dynamic contact angle velocity scale.
Definition: alphaContactAngleFvPatchScalarField.H:171
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::interfaceThetaProps::thetaA
scalar thetaA(bool matched=true) const
Return the limiting advancing contact angle.
Definition: alphaContactAngleFvPatchScalarField.H:177
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::alphaContactAngleFvPatchScalarField::thetaPropsTable
HashTable< interfaceThetaProps, phasePairKey, phasePairKey::hash > thetaPropsTable
Definition: alphaContactAngleFvPatchScalarField.H:202
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::alphaContactAngleFvPatchScalarField::thetaProps
const thetaPropsTable & thetaProps() const noexcept
Return the contact angle properties.
Definition: alphaContactAngleFvPatchScalarField.H:278
Foam::phasePairKey
An ordered or unorder pair of phase names. Typically specified as follows.
Definition: phasePairKey.H:65
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:184
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()
Default construct.
Definition: alphaContactAngleFvPatchScalarField.H:154
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:247
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:164