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-2012 OpenFOAM Foundation
9  Copyright (C) 2022 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 multiphaseSystem.
33 
34 SourceFiles
35  alphaContactAngleFvPatchScalarField.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef Foam_multiphaseEuler_alphaContactAngleFvPatchScalarField_H
40 #define Foam_multiphaseEuler_alphaContactAngleFvPatchScalarField_H
41 
43 #include "multiphaseSystem.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 namespace multiphaseEuler
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class alphaContactAngleFvPatch Declaration
54 \*---------------------------------------------------------------------------*/
55 
57 :
58  public zeroGradientFvPatchScalarField
59 {
60 public:
61 
63  {
64  //- Equilibrium contact angle
65  scalar theta0_;
66 
67  //- Dynamic contact angle velocity scale
68  scalar uTheta_;
69 
70  //- Limiting advancing contact angle
71  scalar thetaA_;
72 
73  //- Limiting receding contact angle
74  scalar thetaR_;
75 
76 
77  public:
78 
79  // Constructors
81  {}
82 
84 
85 
86  // Member functions
87 
88  //- Return the equilibrium contact angle theta0
89  scalar theta0(bool matched=true) const
90  {
91  if (matched) return theta0_;
92  else return 180.0 - theta0_;
93  }
94 
95  //- Return the dynamic contact angle velocity scale
96  scalar uTheta() const
97  {
98  return uTheta_;
99  }
100 
101  //- Return the limiting advancing contact angle
102  scalar thetaA(bool matched=true) const
103  {
104  if (matched) return thetaA_;
105  else return 180.0 - thetaA_;
106  }
107 
108  //- Return the limiting receding contact angle
109  scalar thetaR(bool matched=true) const
110  {
111  if (matched) return thetaR_;
112  else return 180.0 - thetaR_;
113  }
114 
115 
116  // IO functions
117 
119  friend Ostream& operator<<(Ostream&, const interfaceThetaProps&);
120  };
121 
122  typedef HashTable
123  <
127  > thetaPropsTable;
128 
129 
130 private:
131 
132  // Private data
133 
134  thetaPropsTable thetaProps_;
135 
136 
137 public:
139  //- Runtime type information
140  TypeName("multiphaseEuler::alphaContactAngle");
141 
142 
143  // Constructors
144 
145  //- Construct from patch and internal field
147  (
148  const fvPatch&,
150  );
151 
152  //- Construct from patch, internal field and dictionary
154  (
155  const fvPatch&,
157  const dictionary&
158  );
159 
160  //- Construct by mapping given alphaContactAngleFvPatchScalarField
161  // onto a new patch
163  (
165  const fvPatch&,
167  const fvPatchFieldMapper&
168  );
169 
170  //- Construct and return a clone
171  virtual tmp<fvPatchScalarField> clone() const
172  {
174  (
176  );
177  }
178 
179  //- Construct as copy setting internal field reference
181  (
184  );
185 
186  //- Construct and return a clone setting internal field reference
188  (
190  ) const
191  {
193  (
195  );
196  }
197 
198 
199  // Member functions
200 
201  //- Return the contact angle properties
202  const thetaPropsTable& thetaProps() const
203  {
204  return thetaProps_;
205  }
206 
207  //- Write
208  virtual void write(Ostream&) const;
209 };
210 
211 
212 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
213 
214 } // End namespace multiphaseEuler
215 } // End namespace Foam
216 
217 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
218 
219 #endif
220 
221 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
HashTable< interfaceThetaProps, multiphaseSystem::interfacePair, multiphaseSystem::interfacePair::symmHash > thetaPropsTable
TypeName("multiphaseEuler::alphaContactAngle")
Runtime type information.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
const thetaPropsTable & thetaProps() const
Return the contact angle properties.
alphaContactAngleFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
A FieldMapper for finite-volume patch fields.
A HashTable similar to std::unordered_map.
Definition: HashTable.H:108
scalar thetaA(bool matched=true) const
Return the limiting advancing contact angle.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
scalar thetaR(bool matched=true) const
Return the limiting receding contact angle.
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: areaFieldsFwd.H:42
A class for managing temporary objects.
Definition: HashPtrTable.H:50
scalar theta0(bool matched=true) const
Return the equilibrium contact angle theta0.
Name pair for the interface.
Namespace for OpenFOAM.