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