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