FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

threePhaseInterfaceProperties.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software: you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
00023     Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00024 
00025 Class
00026     threePhaseInterfaceProperties
00027 
00028 Description
00029     Properties to aid interFoam :
00030     1. Correct the alpha boundary condition for dynamic contact angle.
00031     2. Calculate interface curvature.
00032 
00033 SourceFiles
00034     threePhaseInterfaceProperties.C
00035 
00036 \*---------------------------------------------------------------------------*/
00037 
00038 #ifndef threePhaseInterfaceProperties_H
00039 #define threePhaseInterfaceProperties_H
00040 
00041 #include "../incompressibleThreePhaseMixture/threePhaseMixture.H"
00042 #include <finiteVolume/surfaceFields.H>
00043 
00044 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00045 
00046 namespace Foam
00047 {
00048 
00049 /*---------------------------------------------------------------------------*\
00050               Class threePhaseInterfaceProperties Declaration
00051 \*---------------------------------------------------------------------------*/
00052 
00053 class threePhaseInterfaceProperties
00054 {
00055     // Private data
00056 
00057         const threePhaseMixture& mixture_;
00058 
00059         //- Compression coefficient
00060         scalar cAlpha_;
00061 
00062         //- Surface tension 1-2
00063         dimensionedScalar sigma12_;
00064 
00065         //- Surface tension 1-3
00066         dimensionedScalar sigma13_;
00067 
00068         //- Stabilisation for normalisation of the interface normal
00069         const dimensionedScalar deltaN_;
00070 
00071         surfaceScalarField nHatf_;
00072         volScalarField K_;
00073 
00074 
00075     // Private Member Functions
00076 
00077         //- Disallow default bitwise copy construct and assignment
00078         threePhaseInterfaceProperties(const threePhaseInterfaceProperties&);
00079         void operator=(const threePhaseInterfaceProperties&);
00080 
00081         //- Correction for the boundary condition on the unit normal nHat on
00082         //  walls to produce the correct contact dynamic angle
00083         //  calculated from the component of U parallel to the wall
00084         void correctContactAngle
00085         (
00086             surfaceVectorField::GeometricBoundaryField& nHat
00087         ) const;
00088 
00089         //- Re-calculate the interface curvature
00090         void calculateK();
00091 
00092 
00093 public:
00094 
00095     //- Conversion factor for degrees into radians
00096     static const scalar convertToRad;
00097 
00098 
00099     // Constructors
00100 
00101         //- Construct from volume fraction field alpha and IOdictionary
00102         threePhaseInterfaceProperties(const threePhaseMixture& mixture);
00103 
00104 
00105     // Member Functions
00106 
00107         scalar cAlpha() const
00108         {
00109             return cAlpha_;
00110         }
00111 
00112         const dimensionedScalar& deltaN() const
00113         {
00114             return deltaN_;
00115         }
00116 
00117         const surfaceScalarField& nHatf() const
00118         {
00119             return nHatf_;
00120         }
00121 
00122         const volScalarField& K() const
00123         {
00124             return K_;
00125         }
00126 
00127         tmp<volScalarField> sigma() const
00128         {
00129             volScalarField limitedAlpha2 = max(mixture_.alpha2(), scalar(0));
00130             volScalarField limitedAlpha3 = max(mixture_.alpha3(), scalar(0));
00131 
00132             return
00133                 (limitedAlpha2*sigma12_ + limitedAlpha3*sigma13_)
00134                /(limitedAlpha2 + limitedAlpha3 + SMALL);
00135         }
00136 
00137         tmp<volScalarField> sigmaK() const
00138         {
00139             return sigma()*K_;
00140         }
00141 
00142         void correct()
00143         {
00144             calculateK();
00145         }
00146 };
00147 
00148 
00149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00150 
00151 } // End namespace Foam
00152 
00153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00154 
00155 #endif
00156 
00157 // ************************************************************************* //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines