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
00027 #include "ThermoParcel.H"
00028
00029
00030
00031 template<class ParcelType>
00032 template<class TrackData>
00033 void Foam::ThermoParcel<ParcelType>::setCellValues
00034 (
00035 TrackData& td,
00036 const scalar dt,
00037 const label cellI
00038 )
00039 {
00040 KinematicParcel<ParcelType>::setCellValues(td, dt, cellI);
00041
00042 cpc_ = td.cpInterp().interpolate(this->position(), cellI);
00043
00044 Tc_ = td.TInterp().interpolate(this->position(), cellI);
00045
00046 if (Tc_ < td.constProps().TMin())
00047 {
00048 WarningIn
00049 (
00050 "void Foam::ThermoParcel<ParcelType>::setCellValues"
00051 "("
00052 "TrackData&, "
00053 "const scalar, "
00054 "const label"
00055 ")"
00056 ) << "Limiting observed temperature in cell " << cellI << " to "
00057 << td.constProps().TMin() << nl << endl;
00058
00059 Tc_ = td.constProps().TMin();
00060 }
00061 }
00062
00063
00064 template<class ParcelType>
00065 template<class TrackData>
00066 void Foam::ThermoParcel<ParcelType>::cellValueSourceCorrection
00067 (
00068 TrackData& td,
00069 const scalar dt,
00070 const label cellI
00071 )
00072 {
00073 this->Uc_ += td.cloud().UTrans()[cellI]/this->massCell(cellI);
00074
00075 scalar cpMean = td.cpInterp().psi()[cellI];
00076 Tc_ += td.cloud().hsTrans()[cellI]/(cpMean*this->massCell(cellI));
00077 }
00078
00079
00080 template<class ParcelType>
00081 template<class TrackData>
00082 void Foam::ThermoParcel<ParcelType>::calc
00083 (
00084 TrackData& td,
00085 const scalar dt,
00086 const label cellI
00087 )
00088 {
00089
00090
00091 const scalar np0 = this->nParticle_;
00092 const scalar d0 = this->d_;
00093 const vector U0 = this->U_;
00094 const scalar rho0 = this->rho_;
00095 const scalar T0 = this->T_;
00096 const scalar cp0 = this->cp_;
00097 const scalar mass0 = this->mass();
00098
00099
00100 vector Su = vector::zero;
00101
00102
00103 vector dUTrans = vector::zero;
00104
00105
00106 scalar Sh = 0.0;
00107
00108
00109 scalar dhsTrans = 0.0;
00110
00111
00112
00113
00114
00115 scalar T1 =
00116 calcHeatTransfer(td, dt, cellI, d0, U0, rho0, T0, cp0, Sh, dhsTrans);
00117
00118
00119
00120
00121
00122
00123 vector U1 = calcVelocity(td, dt, cellI, d0, U0, rho0, mass0, Su, dUTrans);
00124
00125
00126
00127
00128 if (td.cloud().coupled())
00129 {
00130
00131 td.cloud().UTrans()[cellI] += np0*dUTrans;
00132
00133
00134 td.cloud().hsTrans()[cellI] += np0*dhsTrans;
00135 }
00136
00137
00138
00139 this->U_ = U1;
00140 T_ = T1;
00141 }
00142
00143
00144 template<class ParcelType>
00145 template <class TrackData>
00146 Foam::scalar Foam::ThermoParcel<ParcelType>::calcHeatTransfer
00147 (
00148 TrackData& td,
00149 const scalar dt,
00150 const label cellI,
00151 const scalar d,
00152 const vector& U,
00153 const scalar rho,
00154 const scalar T,
00155 const scalar cp,
00156 const scalar Sh,
00157 scalar& dhsTrans
00158 )
00159 {
00160 if (!td.cloud().heatTransfer().active())
00161 {
00162 return T;
00163 }
00164
00165
00166 scalar htc = td.cloud().heatTransfer().h
00167 (
00168 d,
00169 U - this->Uc_,
00170 this->rhoc_,
00171 rho,
00172 cpc_,
00173 cp,
00174 this->muc_
00175 );
00176
00177 const scalar As = this->areaS(d);
00178
00179 if (mag(htc) < ROOTVSMALL && !td.cloud().radiation())
00180 {
00181 return T + dt*Sh/(this->volume(d)*rho*cp);
00182 }
00183
00184 scalar ap;
00185 scalar bp;
00186
00187 if (td.cloud().radiation())
00188 {
00189 const scalarField& G =
00190 td.cloud().mesh().objectRegistry::lookupObject<volScalarField>("G");
00191 const scalar sigma = radiation::sigmaSB.value();
00192 const scalar epsilon = td.constProps().epsilon0();
00193
00194 ap =
00195 (Sh/As + htc*Tc_ + epsilon*G[cellI]/4.0)
00196 /(htc + epsilon*sigma*pow3(T));
00197
00198 bp =
00199 6.0
00200 *(Sh/As + htc*(Tc_ - T) + epsilon*(G[cellI]/4.0 - sigma*pow4(T)))
00201 /(rho*d*cp*(ap - T));
00202 }
00203 else
00204 {
00205 ap = Tc_ + Sh/As/htc;
00206 bp = 6.0*(Sh/As + htc*(Tc_ - T))/(rho*d*cp*(ap - T));
00207 }
00208
00209
00210 IntegrationScheme<scalar>::integrationResult Tres =
00211 td.cloud().TIntegrator().integrate(T, dt, ap, bp);
00212
00213 dhsTrans += dt*htc*As*(Tres.average() - Tc_);
00214
00215 return Tres.value();
00216 }
00217
00218
00219
00220
00221 template <class ParcelType>
00222 Foam::ThermoParcel<ParcelType>::ThermoParcel
00223 (
00224 const ThermoParcel<ParcelType>& p
00225 )
00226 :
00227 KinematicParcel<ParcelType>(p),
00228 T_(p.T_),
00229 cp_(p.cp_),
00230 Tc_(p.Tc_),
00231 cpc_(p.cpc_)
00232 {}
00233
00234
00235
00236
00237 #include "ThermoParcelIO.C"
00238
00239