OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

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