1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
27 #include "ThermoParcel.H"
28 #include "radiationConstants.H"
30 // * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * //
32 template<class ParcelType>
33 template<class TrackData>
34 void Foam::ThermoParcel<ParcelType>::setCellValues
41 KinematicParcel<ParcelType>::setCellValues(td, dt, cellI);
43 cpc_ = td.cpInterp().interpolate(this->position(), cellI);
45 Tc_ = td.TInterp().interpolate(this->position(), cellI);
47 if (Tc_ < td.constProps().TMin())
51 "void Foam::ThermoParcel<ParcelType>::setCellValues"
57 ) << "Limiting observed temperature in cell " << cellI << " to "
58 << td.constProps().TMin() << nl << endl;
60 Tc_ = td.constProps().TMin();
65 template<class ParcelType>
66 template<class TrackData>
67 void Foam::ThermoParcel<ParcelType>::cellValueSourceCorrection
74 this->Uc_ += td.cloud().UTrans()[cellI]/this->massCell(cellI);
76 scalar cpMean = td.cpInterp().psi()[cellI];
77 Tc_ += td.cloud().hsTrans()[cellI]/(cpMean*this->massCell(cellI));
81 template<class ParcelType>
82 template<class TrackData>
83 void Foam::ThermoParcel<ParcelType>::calcSurfaceValues
95 // Surface temperature using two thirds rule
96 Ts = (2.0*T + Tc_)/3.0;
98 // Assuming thermo props vary linearly with T for small dT
99 scalar factor = td.TInterp().interpolate(this->position(), cellI)/Ts;
100 rhos = this->rhoc_*factor;
101 mus = td.muInterp().interpolate(this->position(), cellI)/factor;
103 Pr = td.constProps().Pr();
108 template<class ParcelType>
109 template<class TrackData>
110 void Foam::ThermoParcel<ParcelType>::calc
117 // Define local properties at beginning of time step
118 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
119 const scalar np0 = this->nParticle_;
120 const scalar d0 = this->d_;
121 const vector U0 = this->U_;
122 const scalar rho0 = this->rho_;
123 const scalar T0 = this->T_;
124 const scalar cp0 = this->cp_;
125 const scalar mass0 = this->mass();
128 // Calc surface values
129 // ~~~~~~~~~~~~~~~~~~~
130 scalar Ts, rhos, mus, Pr, kappa;
131 calcSurfaceValues(td, cellI, T0, Ts, rhos, mus, Pr, kappa);
134 scalar Re = this->Re(U0, d0, rhos, mus);
140 // Explicit momentum source for particle
141 vector Su = vector::zero;
143 // Momentum transfer from the particle to the carrier phase
144 vector dUTrans = vector::zero;
146 // Explicit enthalpy source for particle
149 // Sensible enthalpy transfer from the particle to the carrier phase
150 scalar dhsTrans = 0.0;
156 // Sum Ni*Cpi*Wi of emission species
159 // Calculate new particle velocity
182 // Calculate new particle velocity
184 calcVelocity(td, dt, cellI, Re, mus, d0, U0, rho0, mass0, Su, dUTrans);
187 // Accumulate carrier phase source terms
188 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
189 if (td.cloud().coupled())
191 // Update momentum transfer
192 td.cloud().UTrans()[cellI] += np0*dUTrans;
194 // Update sensible enthalpy transfer
195 td.cloud().hsTrans()[cellI] += np0*dhsTrans;
198 // Set new particle properties
199 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
205 template<class ParcelType>
206 template <class TrackData>
207 Foam::scalar Foam::ThermoParcel<ParcelType>::calcHeatTransfer
224 if (!td.cloud().heatTransfer().active())
229 // Calc heat transfer coefficient
230 scalar htc = td.cloud().heatTransfer().htc(d, Re, Pr, kappa, NCpW);
232 if (mag(htc) < ROOTVSMALL && !td.cloud().radiation())
234 return max(T + dt*Sh/(this->volume(d)*rho*cp), td.constProps().TMin());
237 const scalar As = this->areaS(d);
238 scalar ap = Tc_ + Sh/As/htc;
239 scalar bp = 6.0*(Sh/As + htc*(Tc_ - T));
240 if (td.cloud().radiation())
242 const scalarField& G =
243 td.cloud().mesh().objectRegistry::lookupObject<volScalarField>("G");
244 const scalar Gc = G[cellI];
245 const scalar sigma = radiation::sigmaSB.value();
246 const scalar epsilon = td.constProps().epsilon0();
248 ap = (ap + epsilon*Gc/(4.0*htc))/(1.0 + epsilon*sigma*pow3(T)/htc);
249 bp += 6.0*(epsilon*(Gc/4.0 - sigma*pow4(T)));
251 bp /= rho*d*cp*(ap - T);
253 // Integrate to find the new parcel temperature
254 IntegrationScheme<scalar>::integrationResult Tres =
255 td.cloud().TIntegrator().integrate(T, dt, ap, bp);
257 scalar Tnew = max(Tres.value(), td.constProps().TMin());
259 dhsTrans += dt*htc*As*(0.5*(T + Tnew) - Tc_);
265 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
267 template <class ParcelType>
268 Foam::ThermoParcel<ParcelType>::ThermoParcel
270 const ThermoParcel<ParcelType>& p
273 KinematicParcel<ParcelType>(p),
281 // * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
283 #include "ThermoParcelIO.C"
285 // ************************************************************************* //