Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include <lagrangianIntermediate/SingleMixtureFraction.H>
00027
00028
00029
00030 template<class CloudType>
00031 void Foam::SingleMixtureFraction<CloudType>::constructIds()
00032 {
00033 forAll(this->phaseProps(), phaseI)
00034 {
00035 switch (this->phaseProps()[phaseI].phase())
00036 {
00037 case phaseProperties::GAS:
00038 {
00039 idGas_ = phaseI;
00040 break;
00041 }
00042 case phaseProperties::LIQUID:
00043 {
00044 idLiquid_ = phaseI;
00045 break;
00046 }
00047 case phaseProperties::SOLID:
00048 {
00049 idSolid_ = phaseI;
00050 break;
00051 }
00052 default:
00053 {
00054 FatalErrorIn
00055 (
00056 "void Foam::SingleMixtureFraction<CloudType>::"
00057 "constructIds()"
00058 ) << "Unknown phase enumeration" << nl << abort(FatalError);
00059 }
00060 }
00061 }
00062
00063 if (idGas_ < 0)
00064 {
00065 FatalErrorIn("Foam::SingleMixtureFraction<CloudType>::constructIds()")
00066 << "No gas phase found in phase list:" << nl
00067 << this->phaseTypes() << nl << endl;
00068 }
00069 if (idLiquid_ < 0)
00070 {
00071 FatalErrorIn("Foam::SingleMixtureFraction<CloudType>::constructIds()")
00072 << "No liquid phase found in phase list:" << nl
00073 << this->phaseTypes() << nl << endl;
00074 }
00075 if (idSolid_ < 0)
00076 {
00077 FatalErrorIn("Foam::SingleMixtureFraction<CloudType>::constructIds()")
00078 << "No solid phase found in phase list:" << nl
00079 << this->phaseTypes() << nl << endl;
00080 }
00081 }
00082
00083
00084
00085
00086 template<class CloudType>
00087 Foam::SingleMixtureFraction<CloudType>::SingleMixtureFraction
00088 (
00089 const dictionary& dict,
00090 CloudType& owner
00091 )
00092 :
00093 CompositionModel<CloudType>(dict, owner, typeName),
00094
00095 idGas_(-1),
00096 idLiquid_(-1),
00097 idSolid_(-1),
00098
00099 YMixture0_(3)
00100 {
00101 constructIds();
00102
00103 if (this->phaseProps().size() != 3)
00104 {
00105 FatalErrorIn
00106 (
00107 "Foam::SingleMixtureFraction<CloudType>::"
00108 "SingleMixtureFraction"
00109 "("
00110 "const dictionary&, "
00111 "CloudType&"
00112 ")"
00113 ) << "Incorrect numebr of phases: " << nl
00114 << " Please specify 1 gas, 1 liquid and 1 solid" << nl
00115 << exit(FatalError);
00116 }
00117
00118 this->coeffDict().lookup("YGasTot0") >> YMixture0_[idGas_];
00119 this->coeffDict().lookup("YLiquidTot0") >> YMixture0_[idLiquid_];
00120 this->coeffDict().lookup("YSolidTot0") >> YMixture0_[idSolid_];
00121
00122 if (mag(sum(YMixture0_) - 1.0) > SMALL)
00123 {
00124 FatalErrorIn
00125 (
00126 "Foam::SingleMixtureFraction<CloudType>::"
00127 "SingleMixtureFraction"
00128 "("
00129 "const dictionary&, "
00130 "CloudType&"
00131 ")"
00132 ) << "Sum of phases should be 1. Phase fractions:" << nl
00133 << YMixture0_ << nl << exit(FatalError);
00134 }
00135 }
00136
00137
00138
00139
00140 template<class CloudType>
00141 Foam::SingleMixtureFraction<CloudType>::~SingleMixtureFraction()
00142 {}
00143
00144
00145
00146
00147 template<class CloudType>
00148 const Foam::scalarField&
00149 Foam::SingleMixtureFraction<CloudType>::YGas0() const
00150 {
00151 return this->phaseProps()[idGas_].Y();
00152 }
00153
00154
00155 template<class CloudType>
00156 const Foam::scalarField&
00157 Foam::SingleMixtureFraction<CloudType>::YLiquid0() const
00158 {
00159 return this->phaseProps()[idLiquid_].Y();
00160 }
00161
00162
00163 template<class CloudType>
00164 const Foam::scalarField&
00165 Foam::SingleMixtureFraction<CloudType>::YSolid0() const
00166 {
00167 return this->phaseProps()[idSolid_].Y();
00168 }
00169
00170
00171 template<class CloudType>
00172 const Foam::scalarField&
00173 Foam::SingleMixtureFraction<CloudType>::YMixture0() const
00174 {
00175 return YMixture0_;
00176 }
00177
00178
00179 template<class CloudType>
00180 Foam::label Foam::SingleMixtureFraction<CloudType>::idGas() const
00181 {
00182 return idGas_;
00183 }
00184
00185
00186 template<class CloudType>
00187 Foam::label Foam::SingleMixtureFraction<CloudType>::idLiquid() const
00188 {
00189 return idLiquid_;
00190 }
00191
00192
00193 template<class CloudType>
00194 Foam::label Foam::SingleMixtureFraction<CloudType>::idSolid() const
00195 {
00196 return idSolid_;
00197 }
00198
00199
00200
00201
00202