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] = massSolid/massNew;
132 scalar Ytotal =
sum(YMix);
142 template<
class ParcelType>
143 template<
class TrackCloudType>
146 TrackCloudType&
cloud,
157 const auto& props =
cloud.composition().phaseProps()[idG];
163 label cid = props.carrierIds()[i];
164 dVolGas[i] = -dMassGas[i]/
thermo.carrier().rho(cid,
p,
T);
171 -dMassLiquid[i]/
thermo.liquids().properties()[i].rho(
p,
T);
177 dVolSolid[i] = -dMassSolid[i]/
thermo.solids().properties()[i].rho();
180 return (
sum(dVolGas) +
sum(dVolLiquid) +
sum(dMassSolid));
186 template<
class ParcelType>
187 template<
class TrackCloudType>
190 TrackCloudType&
cloud,
198 template<
class ParcelType>
199 template<
class TrackCloudType>
202 TrackCloudType&
cloud,
208 ParcelType::cellValueSourceCorrection(
cloud,
td, dt);
212 template<
class ParcelType>
213 template<
class TrackCloudType>
216 TrackCloudType&
cloud,
221 typedef typename TrackCloudType::reactingCloudType reactingCloudType;
228 const scalar np0 = this->nParticle_;
229 const scalar d0 = this->d_;
230 const vector& U0 = this->U_;
231 const scalar
T0 = this->T_;
232 const scalar mass0 = this->mass();
233 const scalar
rho0 = this->rho_;
236 const scalar pc =
td.pc();
245 scalar Ts, rhos, mus, Prs, kappas;
246 this->calcSurfaceValues(
cloud,
td,
T0, Ts, rhos, mus, Prs, kappas);
247 scalar Res = this->
Re(rhos, U0,
td.Uc(), d0, mus);
269 scalar dhsTrans = 0.0;
291 this->calcPhaseChange
386 scalar mass1 = mass0 -
sum(dMassGas) -
sum(dMassLiquid) -
sum(dMassSolid);
389 if (np0*mass1 <
cloud.constProps().minParcelMass())
391 td.keepParticle =
false;
393 if (
cloud.solution().coupled())
395 scalar dm = np0*mass0;
401 cloud.rhoTrans(gid)[this->
cell()] += dm*YMix[GAS]*YGas_[i];
406 cloud.rhoTrans(gid)[this->cell()] += dm*YMix[LIQ]*YLiquid_[i];
418 cloud.UTrans()[this->cell()] += dm*U0;
420 cloud.hsTrans()[this->cell()] +=
421 dm*HsEff(cloud,
td, pc,
T0, idG, idL, idS);
423 cloud.phaseChange().addToPhaseChangeMass(np0*mass1);
429 (void)updateMassFractions(mass0, dMassGas, dMassLiquid, dMassSolid);
433 cloud.constProps().volUpdateType()
434 == constantProperties::volumeUpdateType::mUndefined
437 if (cloud.constProps().constantVolume())
439 this->rho_ = mass1/this->
volume();
443 this->d_ =
cbrt(mass1/this->rho_*6/
pi);
448 switch (cloud.constProps().volUpdateType())
450 case constantProperties::volumeUpdateType::mConstRho :
452 this->d_ =
cbrt(mass1/this->rho_*6/
pi);
455 case constantProperties::volumeUpdateType::mConstVol :
457 this->rho_ = mass1/this->
volume();
460 case constantProperties::volumeUpdateType::mUpdateRhoAndVol :
476 this->rho_ = mass1/(this->
volume() + deltaVol);
477 this->d_ =
cbrt(mass1/this->rho_*6/
pi);
483 this->correctSurfaceValues(cloud,
td, Ts,
Cs, rhos, mus, Prs, kappas);
484 Res = this->
Re(rhos, U0,
td.Uc(), this->d_, mus);
495 this->calcHeatTransfer
510 this->Cp_ = CpEff(cloud,
td, pc, this->T_, idG, idL, idS);
518 this->calcVelocity(cloud,
td, dt, Res, mus, mass1,
Su, dUTrans, Spu);
524 if (cloud.solution().coupled())
529 scalar dm = np0*dMassGas[i];
532 cloud.rhoTrans(gid)[this->cell()] += dm;
533 cloud.UTrans()[this->cell()] += dm*U0;
534 cloud.hsTrans()[this->cell()] += dm*hs;
538 scalar dm = np0*dMassLiquid[i];
541 cloud.rhoTrans(gid)[this->cell()] += dm;
542 cloud.UTrans()[this->cell()] += dm*U0;
543 cloud.hsTrans()[this->cell()] += dm*hs;
561 scalar dm = np0*dMassSRCarrier[i];
563 cloud.rhoTrans(i)[this->cell()] += dm;
564 cloud.UTrans()[this->cell()] += dm*U0;
565 cloud.hsTrans()[this->cell()] += dm*hs;
569 cloud.UTrans()[this->cell()] += np0*dUTrans;
570 cloud.UCoeff()[this->cell()] += np0*Spu;
573 cloud.hsTrans()[this->cell()] += np0*dhsTrans;
574 cloud.hsCoeff()[this->cell()] += np0*Sph;
577 if (cloud.radiation())
579 const scalar ap = this->areaP();
580 const scalar T4 =
pow4(
T0);
581 cloud.radAreaP()[this->cell()] += dt*np0*ap;
582 cloud.radT4()[this->cell()] += dt*np0*T4;
583 cloud.radAreaPT4()[this->cell()] += dt*np0*ap*T4;
591 template<
class ParcelType>
592 template<
class TrackCloudType>
595 TrackCloudType&
cloud,
616 if (!
cloud.devolatilisation().active())
622 (void)
cloud.constProps().TDevol();
623 (void)
cloud.constProps().LDevol();
627 if (
T <
cloud.constProps().TDevol() || canCombust == -1)
632 typedef typename TrackCloudType::reactingCloudType reactingCloudType;
638 cloud.devolatilisation().calculate
652 scalar dMassTot =
sum(dMassDV);
654 cloud.devolatilisation().addToDevolatilisationMass
656 this->nParticle_*dMassTot
659 Sh -= dMassTot*
cloud.constProps().LDevol()/dt;
662 if (
cloud.heatTransfer().BirdCorrection())
665 const scalar Wc =
max(SMALL,
td.rhoc()*
RR*
td.Tc()/
td.pc());
673 const label
id =
composition.localToCarrierId(GAS, i);
676 const scalar Ni = dMassDV[i]/(this->areaS(d)*dt*W);
680 3.6059e-3*(
pow(1.8*Ts, 1.75))
681 *
sqrt(1.0/W + 1.0/Wc)
686 Cs[id] += Ni*d/(2.0*Dab);
692 template<
class ParcelType>
693 template<
class TrackCloudType>
696 TrackCloudType& cloud,
704 const label canCombust,
719 if (!cloud.surfaceReaction().active())
725 (void)cloud.constProps().hRetentionCoeff();
726 (void)cloud.constProps().TMax();
736 const scalar hReaction = cloud.surfaceReaction().calculate
759 cloud.surfaceReaction().addToSurfaceReactionMass
762 *(
sum(dMassSRGas) +
sum(dMassSRLiquid) +
sum(dMassSRSolid))
765 const scalar xsi =
min(
T/cloud.constProps().TMax(), 1.0);
767 (1.0 - xsi*xsi)*cloud.constProps().hRetentionCoeff();
769 Sh += coeff*hReaction/dt;
771 dhsTrans += (1.0 - coeff)*hReaction;
777 template<
class ParcelType>
780 const ReactingMultiphaseParcel<ParcelType>&
p 785 YLiquid_(
p.YLiquid_),
787 canCombust_(
p.canCombust_)
791 template<
class ParcelType>
794 const ReactingMultiphaseParcel<ParcelType>&
p,
800 YLiquid_(
p.YLiquid_),
802 canCombust_(
p.canCombust_)
void size(const label n)
Older name for setAddressableSize.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &f1)
basicSpecieMixture & composition
wallPoints::trackData td(isBlockedFace, regionToBlockSize)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
void calcDevolatilisation(TrackCloudType &cloud, trackingData &td, const scalar dt, const scalar age, 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.
dimensionedScalar sqrt(const dimensionedScalar &ds)
void calc(TrackCloudType &cloud, trackingData &td, const scalar dt)
Update parcel properties over the time interval.
#define forAll(list, i)
Loop across all elements in list.
psiReactionThermo & thermo
ReactingMultiphaseParcel(const polyMesh &mesh, const barycentric &coordinates, const label celli, const label tetFacei, const label tetPti)
Construct from mesh, position and topology.
ParcelType::trackingData trackingData
Use base tracking data.
void calcSurfaceReactions(TrackCloudType &cloud, trackingData &td, const scalar dt, const scalar d, const scalar Re, const scalar nu, 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.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
A cloud is a registry collection of lagrangian particles.
dimensionedScalar cbrt(const dimensionedScalar &ds)
constexpr scalar pi(M_PI)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
const wordList volume
Standard volume field types (scalar, vector, tensor, etc)
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
const volScalarField & Cp
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
const Vector< label > N(dict.get< Vector< label >>("N"))
scalarField Re(const UList< complex > &cmplx)
Extract real component.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
A cell is defined as a list of faces with extra functionality.
dimensionedScalar pow4(const dimensionedScalar &ds)
Multiphase variant of the reacting parcel class with one/two-way coupling with the continuous phase...
scalar updatedDeltaVolume(TrackCloudType &cloud, const scalarField &dMassGas, const scalarField &dMassLiquid, const scalarField &dMassSolid, const label idG, const label idL, const label idS, const scalar p, const scalar T)
Return change of volume due to mass exchange.
dimensionedScalar beta("beta", dimless/dimTemperature, laminarTransport)
const scalar RR
Universal gas constant: default in [J/(kmol K)].
Templated reacting parcel composition model class Consists of carrier species (via thermo package)...
void cellValueSourceCorrection(TrackCloudType &cloud, trackingData &td, const scalar dt)
Correct cell values using latest transfer information.
void setCellValues(TrackCloudType &cloud, trackingData &td)
Set cell values.
static constexpr const zero Zero
Global zero (0)