00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 2008-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 \*---------------------------------------------------------------------------*/ 00025 00026 #include "SinglePhaseMixture.H" 00027 00028 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // 00029 00030 template<class CloudType> 00031 void Foam::SinglePhaseMixture<CloudType>::constructIds() 00032 { 00033 if (this->phaseProps().size() == 0) 00034 { 00035 FatalErrorIn 00036 ( 00037 "void Foam::SinglePhaseMixture<CloudType>::constructIds()" 00038 ) << "Phase list is empty" << nl << exit(FatalError); 00039 } 00040 else if (this->phaseProps().size() > 1) 00041 { 00042 FatalErrorIn 00043 ( 00044 "void Foam::SinglePhaseMixture<CloudType>::constructIds()" 00045 ) << "Only one phase permitted" << nl << exit(FatalError); 00046 } 00047 00048 switch (this->phaseProps()[0].phase()) 00049 { 00050 case phaseProperties::GAS: 00051 { 00052 idGas_ = 0; 00053 break; 00054 } 00055 case phaseProperties::LIQUID: 00056 { 00057 idLiquid_ = 0; 00058 break; 00059 } 00060 case phaseProperties::SOLID: 00061 { 00062 idSolid_ = 0; 00063 break; 00064 } 00065 default: 00066 { 00067 FatalErrorIn 00068 ( 00069 "void Foam::SinglePhaseMixture<CloudType>::constructIds()" 00070 ) << "Unknown phase enumeration" << nl << abort(FatalError); 00071 } 00072 } 00073 } 00074 00075 00076 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // 00077 00078 template<class CloudType> 00079 Foam::SinglePhaseMixture<CloudType>::SinglePhaseMixture 00080 ( 00081 const dictionary& dict, 00082 CloudType& owner 00083 ) 00084 : 00085 CompositionModel<CloudType>(dict, owner, typeName), 00086 idGas_(-1), 00087 idLiquid_(-1), 00088 idSolid_(-1) 00089 { 00090 constructIds(); 00091 } 00092 00093 00094 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // 00095 00096 template<class CloudType> 00097 Foam::SinglePhaseMixture<CloudType>::~SinglePhaseMixture() 00098 {} 00099 00100 00101 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // 00102 00103 template<class CloudType> 00104 const Foam::scalarField& 00105 Foam::SinglePhaseMixture<CloudType>::YGas0() const 00106 { 00107 notImplemented 00108 ( 00109 "const Foam::scalarField& " 00110 "Foam::SinglePhaseMixture<CloudType>::YGas0() const" 00111 ); 00112 return this->phaseProps()[0].Y(); 00113 } 00114 00115 00116 template<class CloudType> 00117 const Foam::scalarField& 00118 Foam::SinglePhaseMixture<CloudType>::YLiquid0() const 00119 { 00120 notImplemented 00121 ( 00122 "const Foam::scalarField& " 00123 "Foam::SinglePhaseMixture<CloudType>::YLiquid0() const" 00124 ); 00125 return this->phaseProps()[0].Y(); 00126 } 00127 00128 00129 template<class CloudType> 00130 const Foam::scalarField& 00131 Foam::SinglePhaseMixture<CloudType>::YSolid0() const 00132 { 00133 notImplemented 00134 ( 00135 "const Foam::scalarField& " 00136 "Foam::SinglePhaseMixture<CloudType>::YSolid0() const" 00137 ); 00138 return this->phaseProps()[0].Y(); 00139 } 00140 00141 00142 template<class CloudType> 00143 const Foam::scalarField& 00144 Foam::SinglePhaseMixture<CloudType>::YMixture0() const 00145 { 00146 return this->phaseProps()[0].Y(); 00147 } 00148 00149 00150 template<class CloudType> 00151 Foam::label Foam::SinglePhaseMixture<CloudType>::idGas() const 00152 { 00153 return idGas_; 00154 } 00155 00156 00157 template<class CloudType> 00158 Foam::label Foam::SinglePhaseMixture<CloudType>::idLiquid() const 00159 { 00160 return idLiquid_; 00161 } 00162 00163 00164 template<class CloudType> 00165 Foam::label Foam::SinglePhaseMixture<CloudType>::idSolid() const 00166 { 00167 return idSolid_; 00168 } 00169 00170 00171 // ************************ vim: set sw=4 sts=4 et: ************************ // 00172