1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend 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 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 #include "ThermoParcel.H"
27 #include "radiationConstants.H"
29 // * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * //
31 template<class ParcelType>
32 template<class TrackData>
33 void Foam::ThermoParcel<ParcelType>::setCellValues
40 KinematicParcel<ParcelType>::setCellValues(td, dt, cellI);
42 cpc_ = td.cpInterp().interpolate(this->position(), cellI);
44 Tc_ = td.TInterp().interpolate(this->position(), cellI);
46 if (Tc_ < td.constProps().TMin())
50 "void Foam::ThermoParcel<ParcelType>::setCellValues"
56 ) << "Limiting observed temperature in cell " << cellI << " to "
57 << td.constProps().TMin() << nl << endl;
59 Tc_ = td.constProps().TMin();
64 template<class ParcelType>
65 template<class TrackData>
66 void Foam::ThermoParcel<ParcelType>::cellValueSourceCorrection
73 this->Uc_ += td.cloud().UTrans()[cellI]/this->massCell(cellI);
75 scalar cpMean = td.cpInterp().psi()[cellI];
76 Tc_ += td.cloud().hsTrans()[cellI]/(cpMean*this->massCell(cellI));
80 template<class ParcelType>
81 template<class TrackData>
82 void Foam::ThermoParcel<ParcelType>::calcSurfaceValues
94 // Surface temperature using two thirds rule
95 Ts = (2.0*T + Tc_)/3.0;
97 // Assuming thermo props vary linearly with T for small dT
98 scalar factor = td.TInterp().interpolate(this->position(), cellI)/Ts;
99 rhos = this->rhoc_*factor;
100 mus = td.muInterp().interpolate(this->position(), cellI)/factor;
102 Pr = td.constProps().Pr();
107 template<class ParcelType>
108 template<class TrackData>
109 void Foam::ThermoParcel<ParcelType>::calc
116 // Define local properties at beginning of time step
117 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
118 const scalar np0 = this->nParticle_;
119 const scalar d0 = this->d_;
120 const vector U0 = this->U_;
121 const scalar rho0 = this->rho_;
122 const scalar T0 = this->T_;
123 const scalar cp0 = this->cp_;
124 const scalar mass0 = this->mass();
127 // Calc surface values
128 // ~~~~~~~~~~~~~~~~~~~
129 scalar Ts, rhos, mus, Pr, kappa;
130 calcSurfaceValues(td, cellI, T0, Ts, rhos, mus, Pr, kappa);
133 scalar Re = this->Re(U0, d0, rhos, mus);
139 // Explicit momentum source for particle
140 vector Su = vector::zero;
142 // Momentum transfer from the particle to the carrier phase
143 vector dUTrans = vector::zero;
145 // Explicit enthalpy source for particle
148 // Sensible enthalpy transfer from the particle to the carrier phase
149 scalar dhsTrans = 0.0;
155 // Sum Ni*Cpi*Wi of emission species
158 // Calculate new particle velocity
181 // Calculate new particle velocity
183 this->calcVelocity(td, dt, cellI, Re, mus, d0, U0, rho0, mass0, Su, dUTrans);
186 // Accumulate carrier phase source terms
187 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
188 if (td.cloud().coupled())
190 // Update momentum transfer
191 td.cloud().UTrans()[cellI] += np0*dUTrans;
193 // Update sensible enthalpy transfer
194 td.cloud().hsTrans()[cellI] += np0*dhsTrans;
197 // Set new particle properties
198 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
204 template<class ParcelType>
205 template <class TrackData>
206 Foam::scalar Foam::ThermoParcel<ParcelType>::calcHeatTransfer
223 if (!td.cloud().heatTransfer().active())
228 // Calc heat transfer coefficient
229 scalar htc = td.cloud().heatTransfer().htc(d, Re, Pr, kappa, NCpW);
231 if (mag(htc) < ROOTVSMALL && !td.cloud().radiation())
233 return max(T + dt*Sh/(this->volume(d)*rho*cp), td.constProps().TMin());
236 const scalar As = this->areaS(d);
237 scalar ap = Tc_ + Sh/As/htc;
238 scalar bp = 6.0*(Sh/As + htc*(Tc_ - T));
239 if (td.cloud().radiation())
241 const scalarField& G =
242 td.cloud().mesh().objectRegistry::template
243 lookupObject<volScalarField>("G");
245 const scalar Gc = G[cellI];
246 const scalar sigma = radiation::sigmaSB.value();
247 const scalar epsilon = td.constProps().epsilon0();
249 ap = (ap + epsilon*Gc/(4.0*htc))/(1.0 + epsilon*sigma*pow3(T)/htc);
250 bp += 6.0*(epsilon*(Gc/4.0 - sigma*pow4(T)));
252 bp /= rho*d*cp*(ap - T);
254 // Integrate to find the new parcel temperature
255 IntegrationScheme<scalar>::integrationResult Tres =
256 td.cloud().TIntegrator().integrate(T, dt, ap, bp);
258 scalar Tnew = max(Tres.value(), td.constProps().TMin());
260 dhsTrans += dt*htc*As*(0.5*(T + Tnew) - Tc_);
266 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
268 template <class ParcelType>
269 Foam::ThermoParcel<ParcelType>::ThermoParcel
271 const ThermoParcel<ParcelType>& p
274 KinematicParcel<ParcelType>(p),
282 // * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
284 #include "ThermoParcelIO.C"
286 // ************************************************************************* //