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::phase 00026 00027 Description 00028 Single incompressible phase derived from the phase-fraction. 00029 Used as part of the multiPhaseMixture for interface-capturing multi-phase 00030 simulations. 00031 00032 SourceFiles 00033 phase.C 00034 00035 \*---------------------------------------------------------------------------*/ 00036 00037 #ifndef phase_H 00038 #define phase_H 00039 00040 #include <finiteVolume/volFields.H> 00041 #include <OpenFOAM/dictionaryEntry.H> 00042 #include <incompressibleTransportModels/viscosityModel.H> 00043 00044 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00045 00046 namespace Foam 00047 { 00048 00049 /*---------------------------------------------------------------------------*\ 00050 Class phase Declaration 00051 \*---------------------------------------------------------------------------*/ 00052 00053 class phase 00054 : 00055 public volScalarField 00056 { 00057 // Private data 00058 00059 word name_; 00060 dictionary phaseDict_; 00061 autoPtr<viscosityModel> nuModel_; 00062 dimensionedScalar rho_; 00063 00064 00065 public: 00066 00067 // Constructors 00068 00069 //- Construct from components 00070 phase 00071 ( 00072 const word& name, 00073 const dictionary& phaseDict, 00074 const volVectorField& U, 00075 const surfaceScalarField& phi 00076 ); 00077 00078 //- Return clone 00079 autoPtr<phase> clone() const; 00080 00081 //- Return a pointer to a new phase created on freestore 00082 // from Istream 00083 class iNew 00084 { 00085 const volVectorField& U_; 00086 const surfaceScalarField& phi_; 00087 00088 public: 00089 00090 iNew 00091 ( 00092 const volVectorField& U, 00093 const surfaceScalarField& phi 00094 ) 00095 : 00096 U_(U), 00097 phi_(phi) 00098 {} 00099 00100 autoPtr<phase> operator()(Istream& is) const 00101 { 00102 dictionaryEntry ent(dictionary::null, is); 00103 return autoPtr<phase>(new phase(ent.keyword(), ent, U_, phi_)); 00104 } 00105 }; 00106 00107 00108 // Member Functions 00109 00110 const word& name() const 00111 { 00112 return name_; 00113 } 00114 00115 const word& keyword() const 00116 { 00117 return name(); 00118 } 00119 00120 //- Return const-access to phase1 viscosityModel 00121 const viscosityModel& nuModel() const 00122 { 00123 return nuModel_(); 00124 } 00125 00126 //- Return the kinematic laminar viscosity 00127 tmp<volScalarField> nu() const 00128 { 00129 return nuModel_->nu(); 00130 } 00131 00132 //- Return const-access to phase1 density 00133 const dimensionedScalar& rho() const 00134 { 00135 return rho_; 00136 } 00137 00138 //- Correct the phase properties 00139 void correct(); 00140 00141 //- Read base transportProperties dictionary 00142 bool read(const dictionary& phaseDict); 00143 }; 00144 00145 00146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00147 00148 } // End namespace Foam 00149 00150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00151 00152 #endif 00153 00154 // ************************ vim: set sw=4 sts=4 et: ************************ //