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 threePhaseMixture 00027 00028 Description 00029 00030 SourceFiles 00031 threePhaseMixture.C 00032 00033 \*---------------------------------------------------------------------------*/ 00034 00035 #ifndef threePhaseMixture_H 00036 #define threePhaseMixture_H 00037 00038 #include <incompressibleTransportModels/transportModel.H> 00039 #include <incompressibleTransportModels/viscosityModel.H> 00040 #include <OpenFOAM/dimensionedScalar.H> 00041 #include <finiteVolume/volFields.H> 00042 00043 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00044 00045 namespace Foam 00046 { 00047 00048 /*---------------------------------------------------------------------------*\ 00049 Class threePhaseMixture Declaration 00050 \*---------------------------------------------------------------------------*/ 00051 00052 class threePhaseMixture 00053 : 00054 public transportModel 00055 { 00056 // Private data 00057 00058 word phase1Name_; 00059 word phase2Name_; 00060 word phase3Name_; 00061 00062 autoPtr<viscosityModel> nuModel1_; 00063 autoPtr<viscosityModel> nuModel2_; 00064 autoPtr<viscosityModel> nuModel3_; 00065 00066 dimensionedScalar rho1_; 00067 dimensionedScalar rho2_; 00068 dimensionedScalar rho3_; 00069 00070 const volVectorField& U_; 00071 const surfaceScalarField& phi_; 00072 00073 const volScalarField& alpha1_; 00074 const volScalarField& alpha2_; 00075 const volScalarField& alpha3_; 00076 00077 volScalarField nu_; 00078 00079 00080 // Private Member Functions 00081 00082 //- Calculate and return the laminar viscosity 00083 void calcNu(); 00084 00085 00086 public: 00087 00088 // Constructors 00089 00090 //- Construct from components 00091 threePhaseMixture 00092 ( 00093 const volVectorField& U, 00094 const surfaceScalarField& phi 00095 ); 00096 00097 00098 // Destructor 00099 00100 ~threePhaseMixture() 00101 {} 00102 00103 00104 // Member Functions 00105 00106 //- Return const-access to phase1 viscosityModel 00107 const viscosityModel& nuModel1() const 00108 { 00109 return nuModel1_(); 00110 } 00111 00112 //- Return const-access to phase2 viscosityModel 00113 const viscosityModel& nuModel2() const 00114 { 00115 return nuModel2_(); 00116 } 00117 00118 //- Return const-access to phase3 viscosityModel 00119 const viscosityModel& nuModel3() const 00120 { 00121 return nuModel3_(); 00122 } 00123 00124 //- Return const-access to phase1 density 00125 const dimensionedScalar& rho1() const 00126 { 00127 return rho1_; 00128 } 00129 00130 //- Return const-access to phase2 density 00131 const dimensionedScalar& rho2() const 00132 { 00133 return rho2_; 00134 }; 00135 00136 //- Return const-access to phase3 density 00137 const dimensionedScalar& rho3() const 00138 { 00139 return rho3_; 00140 }; 00141 00142 const volScalarField& alpha1() const 00143 { 00144 return alpha1_; 00145 } 00146 00147 const volScalarField& alpha2() const 00148 { 00149 return alpha2_; 00150 } 00151 00152 const volScalarField& alpha3() const 00153 { 00154 return alpha3_; 00155 } 00156 00157 //- Return the velocity 00158 const volVectorField& U() const 00159 { 00160 return U_; 00161 } 00162 00163 //- Return the dynamic laminar viscosity 00164 tmp<volScalarField> mu() const; 00165 00166 //- Return the face-interpolated dynamic laminar viscosity 00167 tmp<surfaceScalarField> muf() const; 00168 00169 //- Return the kinematic laminar viscosity 00170 tmp<volScalarField> nu() const 00171 { 00172 return nu_; 00173 } 00174 00175 //- Return the face-interpolated dynamic laminar viscosity 00176 tmp<surfaceScalarField> nuf() const; 00177 00178 //- Correct the laminar viscosity 00179 void correct() 00180 { 00181 calcNu(); 00182 } 00183 00184 //- Read base transportProperties dictionary 00185 bool read(); 00186 }; 00187 00188 00189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00190 00191 } // End namespace Foam 00192 00193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00194 00195 #endif 00196 00197 // ************************************************************************* //