34 template<
class CloudType>
37 template<
class CloudType>
43 template<
class CloudType>
51 D0_(this->coeffDict().getScalar(
"D0")),
52 rho0_(this->coeffDict().getScalar(
"rho0")),
53 T0_(this->coeffDict().getScalar(
"T0")),
54 Dn_(this->coeffDict().getScalar(
"Dn")),
55 A_(this->coeffDict().getScalar(
"A")),
56 E_(this->coeffDict().getScalar(
"E")),
57 n_(this->coeffDict().getScalar(
"n")),
58 WVol_(this->coeffDict().getScalar(
"WVol")),
67 label idSolid =
owner.composition().idSolid();
68 CsLocalId_ =
owner.composition().localId(idSolid,
"C");
71 WO2_ =
owner.thermo().carrier().W(O2GlobalId_);
72 const scalar WCO2 =
owner.thermo().carrier().W(CO2GlobalId_);
75 HcCO2_ =
owner.thermo().carrier().Hc(CO2GlobalId_);
77 const scalar YCloc =
owner.composition().Y0(idSolid)[CsLocalId_];
78 const scalar YSolidTot =
owner.composition().YMixture0()[idSolid];
79 Info<<
" C(s): particle mass fraction = " << YCloc*YSolidTot <<
endl;
83 template<
class CloudType>
98 CsLocalId_(srm.CsLocalId_),
99 O2GlobalId_(srm.O2GlobalId_),
100 CO2GlobalId_(srm.CO2GlobalId_),
109 template<
class CloudType>
134 const label idSolid = CloudType::parcelType::SLD;
135 const scalar fComb = YMixture[idSolid]*YSolid[CsLocalId_];
143 const SLGThermo&
thermo = this->owner().thermo();
146 const scalar rhoO2 = rhoc*
thermo.carrier().Y(O2GlobalId_)[celli];
158 const scalar
D = D0_*(rho0_/rhoc)*
pow(Tc/T0_, Dn_);
161 const scalar ppO2 = rhoO2/WO2_*
RR*Tc;
164 const scalar
C = pc/(
RR*Tc);
168 Pout<<
"mass = " << mass <<
nl 169 <<
"fComb = " << fComb <<
nl 170 <<
"Ap = " << Ap <<
nl 171 <<
"dt = " << dt <<
nl 180 const scalar qCsLim = mass*fComb/(WC_*Ap*dt);
184 Pout<<
"qCsLim = " << qCsLim <<
endl;
188 while ((
mag(qCs - qCsOld)/qCs > tolerance_) && (iter <= maxIters_))
191 const scalar PO2Surface = ppO2*
exp(-(qCs +
N)*d/(2*
C*
D));
192 qCs = A_*
exp(-E_/(
RR*
T))*
pow(PO2Surface, n_);
193 qCs = (100.0*qCs + iter*qCsOld)/(100.0 + iter);
194 qCs =
min(qCs, qCsLim);
198 Pout<<
"iter = " << iter
199 <<
", qCsOld = " << qCsOld
207 if (iter > maxIters_)
210 <<
"iter limit reached (" << maxIters_ <<
")" <<
nl <<
endl;
214 scalar dOmega = qCs*Ap*dt;
217 dMassSRCarrier[O2GlobalId_] += -dOmega*WO2_;
218 dMassSRCarrier[CO2GlobalId_] += dOmega*(WC_ + WO2_);
221 dMassSolid[CsLocalId_] += dOmega*WC_;
223 const scalar HsC =
thermo.solids().properties()[CsLocalId_].Hs(
T);
228 return dOmega*(WC_*HsC - (WC_ + WO2_)*HcCO2_);
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
basicSpecieMixture & composition
dimensionedSymmTensor sqr(const dimensionedVector &dv)
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
const CloudType & owner() const
Return const access to the owner cloud.
Limited to C(s) + O2 -> CO2.
psiReactionThermo & thermo
const dimensionedScalar e
Elementary charge.
dimensionedScalar exp(const dimensionedScalar &ds)
COxidationMurphyShaddix(const dictionary &dict, CloudType &owner)
Construct from dictionary.
constexpr scalar pi(M_PI)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
int debug
Static debugging option.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
virtual scalar calculate(const scalar dt, const scalar Re, const scalar nu, const label celli, const scalar d, const scalar T, const scalar Tc, const scalar pc, const scalar rhoc, const scalar mass, const scalarField &YGas, const scalarField &YLiquid, const scalarField &YSolid, const scalarField &YMixture, const scalar N, scalarField &dMassGas, scalarField &dMassLiquid, scalarField &dMassSolid, scalarField &dMassSRCarrier) const
Update surface reactions.
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)
#define WarningInFunction
Report a warning using Foam::Warning.
messageStream Info
Information stream (stdout output on master, null elsewhere)
const scalar RR
Universal gas constant: default in [J/(kmol K)].
const dimensionedScalar & D
Templated surface reaction model class.
Templated base class for dsmc cloud.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.