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

alphaContactAngleFvPatchScalarField.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 
00024 Class
00025     Foam::alphaContactAngleFvPatchScalarField
00026 
00027 Description
00028     Contact-angle boundary condition for multi-phase interface-capturing
00029     simulations.  Used in conjuction with multiphaseMixture.
00030 
00031 SourceFiles
00032     alphaContactAngleFvPatchScalarField.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef alphaContactAngleFvPatchScalarField_H
00037 #define alphaContactAngleFvPatchScalarField_H
00038 
00039 #include <finiteVolume/zeroGradientFvPatchFields.H>
00040 #include <multiphaseMixture/multiphaseMixture.H>
00041 
00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00043 
00044 namespace Foam
00045 {
00046 
00047 /*---------------------------------------------------------------------------*\
00048                            Class alphaContactAngleFvPatch Declaration
00049 \*---------------------------------------------------------------------------*/
00050 
00051 class alphaContactAngleFvPatchScalarField
00052 :
00053     public zeroGradientFvPatchScalarField
00054 {
00055 public:
00056 
00057     class interfaceThetaProps
00058     {
00059         //- Equilibrium contact angle
00060         scalar theta0_;
00061 
00062         //- Dynamic contact angle velocity scale
00063         scalar uTheta_;
00064 
00065         //- Limiting advancing contact angle
00066         scalar thetaA_;
00067 
00068         //- Limiting receeding contact angle
00069         scalar thetaR_;
00070 
00071 
00072     public:
00073 
00074         // Constructors
00075             interfaceThetaProps()
00076             {}
00077 
00078             interfaceThetaProps(Istream&);
00079 
00080 
00081         // Member functions
00082 
00083             //- Return the equilibrium contact angle theta0
00084             scalar theta0(bool matched=true) const
00085             {
00086                 if (matched) return theta0_;
00087                 else return 180.0 - theta0_;
00088             }
00089 
00090             //- Return the dynamic contact angle velocity scale
00091             scalar uTheta() const
00092             {
00093                 return uTheta_;
00094             }
00095 
00096             //- Return the limiting advancing contact angle
00097             scalar thetaA(bool matched=true) const
00098             {
00099                 if (matched) return thetaA_;
00100                 else return 180.0 - thetaA_;
00101             }
00102 
00103             //- Return the limiting receeding contact angle
00104             scalar thetaR(bool matched=true) const
00105             {
00106                 if (matched) return thetaR_;
00107                 else return 180.0 - thetaR_;
00108             }
00109 
00110 
00111         // IO functions
00112 
00113             friend Istream& operator>>(Istream&, interfaceThetaProps&);
00114             friend Ostream& operator<<(Ostream&, const interfaceThetaProps&);
00115     };
00116 
00117     typedef HashTable
00118     <
00119         interfaceThetaProps,
00120         multiphaseMixture::interfacePair,
00121         multiphaseMixture::interfacePair::hash
00122     > thetaPropsTable;
00123 
00124 
00125 private:
00126 
00127     // Private data
00128 
00129         thetaPropsTable thetaProps_;
00130 
00131 
00132 public:
00133 
00134     //- Runtime type information
00135     TypeName("alphaContactAngle");
00136 
00137 
00138     // Constructors
00139 
00140         //- Construct from patch and internal field
00141         alphaContactAngleFvPatchScalarField
00142         (
00143             const fvPatch&,
00144             const DimensionedField<scalar, volMesh>&
00145         );
00146 
00147         //- Construct from patch, internal field and dictionary
00148         alphaContactAngleFvPatchScalarField
00149         (
00150             const fvPatch&,
00151             const DimensionedField<scalar, volMesh>&,
00152             const dictionary&
00153         );
00154 
00155         //- Construct by mapping given alphaContactAngleFvPatchScalarField
00156         //  onto a new patch
00157         alphaContactAngleFvPatchScalarField
00158         (
00159             const alphaContactAngleFvPatchScalarField&,
00160             const fvPatch&,
00161             const DimensionedField<scalar, volMesh>&,
00162             const fvPatchFieldMapper&
00163         );
00164 
00165         //- Construct and return a clone
00166         virtual tmp<fvPatchScalarField> clone() const
00167         {
00168             return tmp<fvPatchScalarField>
00169             (
00170                 new alphaContactAngleFvPatchScalarField(*this)
00171             );
00172         }
00173 
00174         //- Construct as copy setting internal field reference
00175         alphaContactAngleFvPatchScalarField
00176         (
00177             const alphaContactAngleFvPatchScalarField&,
00178             const DimensionedField<scalar, volMesh>&
00179         );
00180 
00181         //- Construct and return a clone setting internal field reference
00182         virtual tmp<fvPatchScalarField> clone
00183         (
00184             const DimensionedField<scalar, volMesh>& iF
00185         ) const
00186         {
00187             return tmp<fvPatchScalarField>
00188             (
00189                 new alphaContactAngleFvPatchScalarField(*this, iF)
00190             );
00191         }
00192 
00193 
00194     // Member functions
00195 
00196         //- Return the contact angle properties
00197         const thetaPropsTable& thetaProps() const
00198         {
00199             return thetaProps_;
00200         }
00201 
00202         //- Write
00203         virtual void write(Ostream&) const;
00204 };
00205 
00206 
00207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00208 
00209 } // End namespace Foam
00210 
00211 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00212 
00213 #endif
00214 
00215 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines