threePhaseInterfaceProperties.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-2018 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::threePhaseInterfaceProperties
26 
27 Description
28  Properties to aid interFoam :
29  1. Correct the alpha boundary condition for dynamic contact angle.
30  2. Calculate interface curvature.
31 
32 SourceFiles
33  threePhaseInterfaceProperties.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef threePhaseInterfaceProperties_H
38 #define threePhaseInterfaceProperties_H
39 
41 #include "surfaceFields.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class threePhaseInterfaceProperties Declaration
50 \*---------------------------------------------------------------------------*/
51 
53 {
54  // Private data
55 
56  const incompressibleThreePhaseMixture& mixture_;
57 
58  //- Compression coefficient
59  scalar cAlpha_;
60 
61  //- Surface tension 1-2
62  dimensionedScalar sigma12_;
63 
64  //- Surface tension 1-3
65  dimensionedScalar sigma13_;
66 
67  //- Stabilisation for normalisation of the interface normal
68  const dimensionedScalar deltaN_;
69 
70  surfaceScalarField nHatf_;
71  volScalarField K_;
72 
73 
74  // Private Member Functions
75 
76  //- Disallow default bitwise copy construct and assignment
78  void operator=(const threePhaseInterfaceProperties&);
79 
80  //- Correction for the boundary condition on the unit normal nHat on
81  // walls to produce the correct contact dynamic angle.
82  // Calculated from the component of U parallel to the wall
83  void correctContactAngle
84  (
85  surfaceVectorField::Boundary& nHat
86  ) const;
87 
88  //- Re-calculate the interface curvature
89  void calculateK();
90 
91 
92 public:
93 
94  //- Conversion factor for degrees into radians
95  static const scalar convertToRad;
96 
97 
98  // Constructors
99 
100  //- Construct from volume fraction field alpha and IOdictionary
102  (
104  );
105 
106 
107  // Member Functions
109  scalar cAlpha() const
110  {
111  return cAlpha_;
112  }
114  const dimensionedScalar& deltaN() const
115  {
116  return deltaN_;
117  }
119  const surfaceScalarField& nHatf() const
120  {
121  return nHatf_;
122  }
124  const volScalarField& K() const
125  {
126  return K_;
127  }
129  tmp<volScalarField> sigma() const
130  {
131  volScalarField limitedAlpha2(max(mixture_.alpha2(), scalar(0)));
132  volScalarField limitedAlpha3(max(mixture_.alpha3(), scalar(0)));
133 
134  return
135  (limitedAlpha2*sigma12_ + limitedAlpha3*sigma13_)
136  /(limitedAlpha2 + limitedAlpha3 + small);
137  }
140  {
141  return sigma()*K_;
142  }
143 
145 
146  //- Indicator of the proximity of the interface
147  // Field values are 1 near and 0 away for the interface.
150  void correct()
151  {
152  calculateK();
153  }
154 };
155 
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 } // End namespace Foam
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 #endif
164 
165 // ************************************************************************* //
Foam::surfaceFields.
tmp< volScalarField > nearInterface() const
Indicator of the proximity of the interface.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
const surfaceScalarField & nHatf() const
Properties to aid interFoam : 1. Correct the alpha boundary condition for dynamic contact angle...
tmp< surfaceScalarField > surfaceTensionForce() const
static const scalar convertToRad
Conversion factor for degrees into radians.
const dimensionedScalar & deltaN() const
A class for managing temporary objects.
Definition: PtrList.H:53
Namespace for OpenFOAM.