36 template<
class ParcelType>
39 template<
class ParcelType>
42 template<
class ParcelType>
48 template<
class ParcelType>
49 template<
class TrackCloudType>
52 TrackCloudType&
cloud,
62 this->Y_[GAS]*
cloud.composition().Cp(idG, YGas_,
p,
T)
63 + this->Y_[LIQ]*
cloud.composition().Cp(idL, YLiquid_,
p,
T)
64 + this->Y_[SLD]*
cloud.composition().Cp(idS, YSolid_,
p,
T);
68 template<
class ParcelType>
69 template<
class TrackCloudType>
72 TrackCloudType&
cloud,
82 this->Y_[GAS]*
cloud.composition().hs(idG, YGas_,
p,
T)
83 + this->Y_[LIQ]*
cloud.composition().hs(idL, YLiquid_,
p,
T)
84 + this->Y_[SLD]*
cloud.composition().hs(idS, YSolid_,
p,
T);
88 template<
class ParcelType>
89 template<
class TrackCloudType>
92 TrackCloudType&
cloud,
102 this->Y_[GAS]*
cloud.composition().L(idG, YGas_,
p,
T)
103 + this->Y_[LIQ]*
cloud.composition().L(idL, YLiquid_,
p,
T)
104 + this->Y_[SLD]*
cloud.composition().L(idS, YSolid_,
p,
T);
108 template<
class ParcelType>
120 this->updateMassFraction(mass0*YMix[GAS], dMassGas, YGas_);
122 this->updateMassFraction(mass0*YMix[LIQ], dMassLiquid, YLiquid_);
124 this->updateMassFraction(mass0*YMix[SLD], dMassSolid, YSolid_);
126 scalar massNew =
max(massGas + massLiquid + massSolid, rootVSmall);
128 YMix[GAS] = massGas/massNew;
129 YMix[LIQ] = massLiquid/massNew;
130 YMix[SLD] = 1.0 - YMix[GAS] - YMix[LIQ];
138 template<
class ParcelType>
139 template<
class TrackCloudType>
142 TrackCloudType&
cloud,
146 ParcelType::setCellValues(
cloud, td);
150 template<
class ParcelType>
151 template<
class TrackCloudType>
154 TrackCloudType&
cloud,
160 ParcelType::cellValueSourceCorrection(
cloud, td, dt);
164 template<
class ParcelType>
165 template<
class TrackCloudType>
168 TrackCloudType&
cloud,
173 typedef typename TrackCloudType::thermoCloudType thermoCloudType;
181 const scalar np0 = this->nParticle_;
182 const scalar d0 = this->d_;
183 const vector& U0 = this->U_;
184 const scalar
T0 = this->T_;
185 const scalar mass0 = this->mass();
187 const scalar pc = td.pc();
196 scalar Ts, rhos, mus, Prs, kappas;
197 this->calcSurfaceValues(
cloud, td,
T0, Ts, rhos, mus, Prs, kappas);
198 scalar Res = this->
Re(rhos, U0, td.Uc(), d0, mus);
220 scalar dhsTrans = 0.0;
242 this->calcPhaseChange
334 updateMassFractions(mass0, dMassGas, dMassLiquid, dMassSolid);
336 this->Cp_ = CpEff(
cloud, td, pc,
T0, idG, idL, idS);
339 if (
cloud.constProps().constantVolume())
341 this->rho_ = mass1/this->volume();
345 this->d_ =
cbrt(mass1/this->rho_*6.0/
pi);
349 if (np0*mass1 <
cloud.constProps().minParcelMass())
351 td.keepParticle =
false;
353 if (
cloud.solution().coupled())
355 scalar dm = np0*mass0;
361 cloud.rhoTrans(gid)[this->
cell()] += dm*YMix[GAS]*YGas_[i];
366 cloud.rhoTrans(gid)[this->
cell()] += dm*YMix[LIQ]*YLiquid_[i];
378 cloud.UTransRef()[this->
cell()] += dm*U0;
381 dm*hsEff(
cloud, td, pc,
T0, idG, idL, idS);
383 cloud.phaseChange().addToPhaseChangeMass(np0*mass1);
390 this->correctSurfaceValues(
cloud, td, Ts, Cs, rhos, mus, Prs, kappas);
391 Res = this->
Re(rhos, U0, td.Uc(), this->d_, mus);
402 this->calcHeatTransfer
417 this->Cp_ = CpEff(
cloud, td, pc, this->T_, idG, idL, idS);
425 this->calcVelocity(
cloud, td, dt, Res, mus, mass1,
Su, dUTrans, Spu);
431 if (
cloud.solution().coupled())
436 scalar dm = np0*dMassGas[i];
440 cloud.UTransRef()[this->
cell()] += dm*U0;
445 scalar dm = np0*dMassLiquid[i];
449 cloud.UTransRef()[this->
cell()] += dm*U0;
468 scalar dm = np0*dMassSRCarrier[i];
471 cloud.UTransRef()[this->
cell()] += dm*U0;
476 cloud.UTransRef()[this->
cell()] += np0*dUTrans;
477 cloud.UCoeffRef()[this->
cell()] += np0*Spu;
480 cloud.hsTransRef()[this->
cell()] += np0*dhsTrans;
481 cloud.hsCoeffRef()[this->
cell()] += np0*Sph;
484 if (
cloud.radiation())
486 const scalar ap = this->areaP();
487 const scalar T4 =
pow4(
T0);
488 cloud.radAreaP()[this->
cell()] += dt*np0*ap;
489 cloud.radT4()[this->
cell()] += dt*np0*T4;
490 cloud.radAreaPT4()[this->
cell()] += dt*np0*ap*T4;
498 template<
class ParcelType>
499 template<
class TrackCloudType>
502 TrackCloudType&
cloud,
528 typename TrackCloudType::reactingMultiphaseCloudType
532 cloud.devolatilisation()
536 if (canCombust != -1)
544 (void)
cloud.constProps().TDevol();
545 (void)
cloud.constProps().LDevol();
549 if (
T <
cloud.constProps().TDevol() || canCombust == -1)
554 typedef typename TrackCloudType::thermoCloudType thermoCloudType;
558 const typename TrackCloudType::parcelType&
p =
559 static_cast<const typename TrackCloudType::parcelType&
>(*this);
560 typename TrackCloudType::parcelType::trackingData& ttd =
561 static_cast<typename TrackCloudType::parcelType::trackingData&
>(td);
564 cloud.devolatilisation().calculate
579 scalar dMassTot =
sum(dMassDV);
581 cloud.devolatilisation().addToDevolatilisationMass
583 this->nParticle_*dMassTot
586 Sh -= dMassTot*
cloud.constProps().LDevol()/dt;
589 if (
cloud.heatTransfer().BirdCorrection())
592 const scalar Wc =
max(small, td.rhoc()*
RR*td.Tc()/td.pc());
601 const scalar
Cp = composition.
carrier().
Cpi(
id, td.pc(), Ts);
603 const scalar Ni = dMassDV[i]/(this->areaS(d)*dt*
W);
607 3.6059e-3*(
pow(1.8*Ts, 1.75))
608 *
sqrt(1.0/
W + 1.0/Wc)
613 Cs[id] += Ni*d/(2.0*Dab);
619 template<
class ParcelType>
620 template<
class TrackCloudType>
623 TrackCloudType&
cloud,
629 const label canCombust,
650 typename TrackCloudType::reactingMultiphaseCloudType
654 cloud.surfaceReaction()
662 (void)
cloud.constProps().hRetentionCoeff();
663 (void)
cloud.constProps().TMax();
673 const scalar hReaction =
cloud.surfaceReaction().calculate
694 cloud.surfaceReaction().addToSurfaceReactionMass
697 *(
sum(dMassSRGas) +
sum(dMassSRLiquid) +
sum(dMassSRSolid))
700 const scalar xsi =
min(
T/
cloud.constProps().TMax(), 1.0);
702 (1.0 - xsi*xsi)*
cloud.constProps().hRetentionCoeff();
704 Sh += coeff*hReaction/dt;
706 dhsTrans += (1.0 - coeff)*hReaction;
712 template<
class ParcelType>
721 YLiquid_(
p.YLiquid_),
723 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.
A cloud is a collection of lagrangian particles.
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.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
bool isType(const Type &t)
Check the typeid.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
scalarList W(const fluidMulticomponentThermo &thermo)
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensionedScalar pow4(const dimensionedScalar &ds)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
dimensionedScalar cbrt(const dimensionedScalar &ds)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
scalarField Re(const UList< complex > &cf)