37 template<
class ParcelType>
38 template<
class TrackCloudType>
41 TrackCloudType&
cloud,
51 this->Y_[idG]*
cloud.composition().Cp(idG, YGas_,
p,
T)
52 + this->Y_[idL]*
cloud.composition().Cp(idL, YLiquid_,
p,
T)
53 + this->Y_[idS]*
cloud.composition().Cp(idS, YSolid_,
p,
T);
57 template<
class ParcelType>
58 template<
class TrackCloudType>
61 TrackCloudType&
cloud,
71 this->Y_[idG]*
cloud.composition().hs(idG, YGas_,
p,
T)
72 + this->Y_[idL]*
cloud.composition().hs(idL, YLiquid_,
p,
T)
73 + this->Y_[idS]*
cloud.composition().hs(idS, YSolid_,
p,
T);
77 template<
class ParcelType>
78 template<
class TrackCloudType>
81 TrackCloudType&
cloud,
91 this->Y_[idG]*
cloud.composition().L(idG, YGas_,
p,
T)
92 + this->Y_[idL]*
cloud.composition().L(idL, YLiquid_,
p,
T)
93 + this->Y_[idS]*
cloud.composition().L(idS, YSolid_,
p,
T);
97 template<
class ParcelType>
112 this->updateMassFraction(mass0*YMix[idG], dMassGas, YGas_);
114 this->updateMassFraction(mass0*YMix[idL], dMassLiquid, YLiquid_);
116 this->updateMassFraction(mass0*YMix[idS], dMassSolid, YSolid_);
118 scalar massNew =
max(massGas + massLiquid + massSolid, rootVSmall);
120 YMix[idG] = massGas/massNew;
121 YMix[idL] = massLiquid/massNew;
122 YMix[idS] = 1.0 - YMix[idG] - YMix[idL];
130 template<
class ParcelType>
131 template<
class TrackCloudType>
134 TrackCloudType&
cloud,
138 ParcelType::setCellValues(
cloud, td);
142 template<
class ParcelType>
143 template<
class TrackCloudType>
146 TrackCloudType&
cloud,
152 ParcelType::cellValueSourceCorrection(
cloud, td, dt);
156 template<
class ParcelType>
157 template<
class TrackCloudType>
160 TrackCloudType&
cloud,
165 typedef typename TrackCloudType::thermoCloudType thermoCloudType;
173 const scalar np0 = this->nParticle_;
174 const scalar d0 = this->d_;
175 const vector& U0 = this->U_;
176 const scalar
T0 = this->T_;
177 const scalar mass0 = this->mass();
179 const scalar pc = td.pc();
188 scalar Ts, rhos, mus, Prs, kappas;
189 this->calcSurfaceValues(
cloud, td,
T0, Ts, rhos, mus, Prs, kappas);
190 scalar Res = this->
Re(rhos, U0, td.Uc(), d0, mus);
212 scalar dhsTrans = 0.0;
234 this->calcPhaseChange
337 this->Cp_ = CpEff(
cloud, td, pc,
T0, idG, idL, idS);
340 if (
cloud.constProps().constantVolume())
342 this->rho_ = mass1/this->volume();
346 this->d_ =
cbrt(mass1/this->rho_*6.0/
pi);
350 if (np0*mass1 <
cloud.constProps().minParcelMass())
352 td.keepParticle =
false;
354 if (
cloud.solution().coupled())
356 scalar dm = np0*mass0;
362 cloud.rhoTrans(gid)[this->
cell()] += dm*YMix[idG]*YGas_[i];
367 cloud.rhoTrans(gid)[this->
cell()] += dm*YMix[idL]*YLiquid_[i];
379 cloud.UTransRef()[this->
cell()] += dm*U0;
382 dm*hsEff(
cloud, td, pc,
T0, idG, idL, idS);
384 cloud.phaseChange().addToPhaseChangeMass(np0*mass1);
391 this->correctSurfaceValues(
cloud, td, Ts, Cs, rhos, mus, Prs, kappas);
392 Res = this->
Re(rhos, U0, td.Uc(), this->d_, mus);
403 this->calcHeatTransfer
418 this->Cp_ = CpEff(
cloud, td, pc, this->T_, idG, idL, idS);
426 this->calcVelocity(
cloud, td, dt, Res, mus, mass1,
Su, dUTrans, Spu);
432 if (
cloud.solution().coupled())
437 scalar dm = np0*dMassGas[i];
441 cloud.UTransRef()[this->
cell()] += dm*U0;
446 scalar dm = np0*dMassLiquid[i];
450 cloud.UTransRef()[this->
cell()] += dm*U0;
469 scalar dm = np0*dMassSRCarrier[i];
472 cloud.UTransRef()[this->
cell()] += dm*U0;
477 cloud.UTransRef()[this->
cell()] += np0*dUTrans;
478 cloud.UCoeffRef()[this->
cell()] += np0*Spu;
481 cloud.hsTransRef()[this->
cell()] += np0*dhsTrans;
482 cloud.hsCoeffRef()[this->
cell()] += np0*Sph;
485 if (
cloud.radiation())
487 const scalar ap = this->areaP();
488 const scalar T4 =
pow4(
T0);
489 cloud.radAreaP()[this->
cell()] += dt*np0*ap;
490 cloud.radT4()[this->
cell()] += dt*np0*T4;
491 cloud.radAreaPT4()[this->
cell()] += dt*np0*ap*T4;
499 template<
class ParcelType>
500 template<
class TrackCloudType>
503 TrackCloudType&
cloud,
529 typename TrackCloudType::reactingMultiphaseCloudType
533 cloud.devolatilisation()
537 if (canCombust != -1)
545 (void)
cloud.constProps().TDevol();
546 (void)
cloud.constProps().LDevol();
550 if (
T <
cloud.constProps().TDevol() || canCombust == -1)
555 typedef typename TrackCloudType::thermoCloudType thermoCloudType;
561 const typename TrackCloudType::parcelType&
p =
562 static_cast<const typename TrackCloudType::parcelType&
>(*this);
563 typename TrackCloudType::parcelType::trackingData& ttd =
564 static_cast<typename TrackCloudType::parcelType::trackingData&
>(td);
582 scalar dMassTot =
sum(dMassDV);
584 cloud.devolatilisation().addToDevolatilisationMass
586 this->nParticle_*dMassTot
589 Sh -= dMassTot*
cloud.constProps().LDevol()/dt;
592 if (
cloud.heatTransfer().BirdCorrection())
595 const scalar Wc =
max(small, td.rhoc()*
RR*td.Tc()/td.pc());
604 const scalar
Cp = composition.
carrier().
Cpi(
id, td.pc(), Ts);
606 const scalar Ni = dMassDV[i]/(this->areaS(d)*dt*
W);
610 3.6059e-3*(
pow(1.8*Ts, 1.75))
611 *
sqrt(1.0/
W + 1.0/Wc)
616 Cs[id] += Ni*d/(2.0*Dab);
622 template<
class ParcelType>
623 template<
class TrackCloudType>
626 TrackCloudType&
cloud,
632 const label canCombust,
653 typename TrackCloudType::reactingMultiphaseCloudType
657 cloud.surfaceReaction()
665 (void)
cloud.constProps().hRetentionCoeff();
666 (void)
cloud.constProps().TMax();
697 cloud.surfaceReaction().addToSurfaceReactionMass
700 *(
sum(dMassSRGas) +
sum(dMassSRLiquid) +
sum(dMassSRSolid))
703 const scalar xsi =
min(
T/
cloud.constProps().TMax(), 1.0);
705 (1.0 - xsi*xsi)*
cloud.constProps().hRetentionCoeff();
707 Sh += coeff*hReaction/dt;
709 dhsTrans += (1.0 - coeff)*hReaction;
715 template<
class ParcelType>
724 YLiquid_(
p.YLiquid_),
726 canCombust_(
p.canCombust_)
scalar hs(const scalar p, const scalar T) const
scalar Cp(const scalar p, const scalar T) const
#define forAll(list, i)
Loop across all elements in list.
Templated reacting parcel composition model class Consists of carrier species (via thermo package),...
virtual label idLiquid() const =0
Liquid id.
const fluidMulticomponentThermo & carrier() const
Return the carrier components (wrapper function)
label localToCarrierId(const label phaseI, const label id, const bool allowNotFound=false) const
Return carrier id of component given local id.
virtual label idSolid() const =0
Solid id.
virtual label idGas() const =0
Gas id.
void size(const label)
Override size to be inconsistent with allocated storage.
Dummy devolatilisation model for 'none'.
Dummy surface reaction model for 'none'.
Multiphase variant of the reacting parcel class with one/two-way coupling with the continuous phase.
void calcSurfaceReactions(TrackCloudType &cloud, trackingData &td, const scalar dt, const scalar d, const scalar T, const scalar mass, const label canCombust, const scalar N, const scalarField &YMix, const scalarField &YGas, const scalarField &YLiquid, const scalarField &YSolid, scalarField &dMassSRGas, scalarField &dMassSRLiquid, scalarField &dMassSRSolid, scalarField &dMassSRCarrier, scalar &Sh, scalar &dhsTrans) const
Calculate surface reactions.
void cellValueSourceCorrection(TrackCloudType &cloud, trackingData &td, const scalar dt)
Correct cell values using latest transfer information.
void calcDevolatilisation(TrackCloudType &cloud, trackingData &td, const scalar dt, const scalar Ts, const scalar d, const scalar T, const scalar mass, const scalar mass0, const scalarField &YGasEff, const scalarField &YLiquidEff, const scalarField &YSolidEff, label &canCombust, scalarField &dMassDV, scalar &Sh, scalar &N, scalar &NCpW, scalarField &Cs) const
Calculate Devolatilisation.
ParcelType::trackingData trackingData
Use base tracking data.
ReactingMultiphaseParcel(const polyMesh &mesh, const barycentric &coordinates, const label celli, const label tetFacei, const label tetPti, const label facei)
Construct from mesh, coordinates and topology.
void setCellValues(TrackCloudType &cloud, trackingData &td)
Set cell values.
void calc(TrackCloudType &cloud, trackingData &td, const scalar dt)
Update parcel properties over the time interval.
A cell is defined as a list of faces with extra functionality.
Base class for clouds. Provides a basic evolution algorithm, models, and a database for caching deriv...
virtual void calculate(const LagrangianSubScalarField &deltaT, const bool final)
Update the cloud properties.
virtual scalar Cpi(const label speciei, const scalar p, const scalar T) const =0
Heat capacity at constant pressure [J/kg/K].
virtual const speciesTable & species() const =0
The table of species.
virtual scalar WiValue(const label speciei) const =0
Molecular weight [kg/kmol].
virtual scalar hsi(const label speciei, const scalar p, const scalar T) const =0
Sensible enthalpy [J/kg].
const dimensionedScalar RR
Universal gas constant: default SI units: [J/kmol/K].
tmp< VolField< Type > > Su(const VolField< Type > &su, const VolField< Type > &vf)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void T(LagrangianPatchField< Type > &f, const LagrangianPatchField< Type > &f1)
bool isType(const Type &t)
Check the typeid.
void pow4(LagrangianPatchField< scalar > &f, const LagrangianPatchField< scalar > &f1)
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
void pow(LagrangianPatchField< typename powProduct< Type, r >::type > &f, const LagrangianPatchField< Type > &f1)
scalarList W(const fluidMulticomponentThermo &thermo)
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
void cbrt(LagrangianPatchField< scalar > &f, const LagrangianPatchField< scalar > &f1)
void sqr(LagrangianPatchField< typename outerProduct< Type, Type >::type > &f, const LagrangianPatchField< Type > &f1)
void sqrt(LagrangianPatchField< scalar > &f, const LagrangianPatchField< scalar > &f1)
scalarField Re(const UList< complex > &cf)