Foam::injectorModel::injectorModel ( const dictionary& dict, spray& sm ) : dict_(dict), sm_(sm), injectors_(sm.injectors()), rndGen_(sm.rndGen()) {}
// Construct from components atomizationModel::atomizationModel ( const dictionary& dict, spray& sm ) : dict_(dict), spray_(sm), rndGen_(sm.rndGen()) {}
// Construct from components blobsSheetAtomization::blobsSheetAtomization ( const dictionary& dict, spray& sm ) : atomizationModel(dict, sm), coeffsDict_(dict.subDict(typeName + "Coeffs")), B_(readScalar(coeffsDict_.lookup("B"))), angle_(readScalar(coeffsDict_.lookup("angle"))), rndGen_(sm.rndGen()) {}
Foam::ORourkeCollisionModel::ORourkeCollisionModel ( const dictionary& dict, spray& sm, cachedRandom& rndGen ) : collisionModel(dict, sm, rndGen), vols_(sm.mesh().V()), coeffsDict_(dict.subDict(typeName + "Coeffs")), coalescence_(coeffsDict_.lookup("coalescence")) {}
// Construct from components SHF::SHF ( const dictionary& dict, spray& sm ) : breakupModel(dict, sm), coeffsDict_(dict.subDict(typeName + "Coeffs")), g_(sm.g()), rndGen_(sm.rndGen()), weCorrCoeff_(readScalar(coeffsDict_.lookup("weCorrCoeff"))), weBuCrit_(readScalar(coeffsDict_.lookup("weBuCrit"))), weBuBag_(readScalar(coeffsDict_.lookup("weBuBag"))), weBuMM_(readScalar(coeffsDict_.lookup("weBuMM"))), ohnCoeffCrit_(readScalar(coeffsDict_.lookup("ohnCoeffCrit"))), ohnCoeffBag_(readScalar(coeffsDict_.lookup("ohnCoeffBag"))), ohnCoeffMM_(readScalar(coeffsDict_.lookup("ohnCoeffMM"))), ohnExpCrit_(readScalar(coeffsDict_.lookup("ohnExpCrit"))), ohnExpBag_(readScalar(coeffsDict_.lookup("ohnExpBag"))), ohnExpMM_(readScalar(coeffsDict_.lookup("ohnExpMM"))), cInit_(readScalar(coeffsDict_.lookup("Cinit"))), c1_(readScalar(coeffsDict_.lookup("C1"))), c2_(readScalar(coeffsDict_.lookup("C2"))), c3_(readScalar(coeffsDict_.lookup("C3"))), cExp1_(readScalar(coeffsDict_.lookup("Cexp1"))), cExp2_(readScalar(coeffsDict_.lookup("Cexp2"))), cExp3_(readScalar(coeffsDict_.lookup("Cexp3"))), weConst_(readScalar(coeffsDict_.lookup("Weconst"))), weCrit1_(readScalar(coeffsDict_.lookup("Wecrit1"))), weCrit2_(readScalar(coeffsDict_.lookup("Wecrit2"))), coeffD_(readScalar(coeffsDict_.lookup("CoeffD"))), onExpD_(readScalar(coeffsDict_.lookup("OnExpD"))), weExpD_(readScalar(coeffsDict_.lookup("WeExpD"))), mu_(readScalar(coeffsDict_.lookup("mu"))), sigma_(readScalar(coeffsDict_.lookup("sigma"))), d32Coeff_(readScalar(coeffsDict_.lookup("d32Coeff"))), cDmaxBM_(readScalar(coeffsDict_.lookup("cDmaxBM"))), cDmaxS_(readScalar(coeffsDict_.lookup("cDmaxS"))), corePerc_(readScalar(coeffsDict_.lookup("corePerc"))) {}
// Construct from components dispersionRASModel::dispersionRASModel ( const dictionary& dict, spray& sm ) : dispersionModel(dict, sm), turbulence_ ( sm.mesh().lookupObject<compressible::RASModel> ( "RASProperties" ) ) {}
// Construct from components myLISA_3_InjPos::myLISA_3_InjPos ( const dictionary& dict, spray& sm ) : atomizationModel(dict, sm), coeffsDict_(dict.subDict(typeName+"Coeffs")), rndGen_(sm.rndGen()), Cl_(readScalar(coeffsDict_.lookup("Cl"))), cTau_(readScalar(coeffsDict_.lookup("cTau"))), Q_(readScalar(coeffsDict_.lookup("Q"))), J_(readScalar(coeffsDict_.lookup("J"))), lisaExp_(readScalar(coeffsDict_.lookup("lisaExp"))) {}
// Construct from components reitzKHRT::reitzKHRT ( const dictionary& dict, spray& sm ) : breakupModel(dict, sm), coeffsDict_(dict.subDict(typeName + "Coeffs")), g_(sm.g()), b0_(readScalar(coeffsDict_.lookup("B0"))), b1_(readScalar(coeffsDict_.lookup("B1"))), cTau_(readScalar(coeffsDict_.lookup("Ctau"))), cRT_(readScalar(coeffsDict_.lookup("CRT"))), msLimit_(readScalar(coeffsDict_.lookup("msLimit"))), weberLimit_(readScalar(coeffsDict_.lookup("WeberLimit"))) {}
bool Foam::parcel::move(spray& sDB) { const polyMesh& mesh = cloud().pMesh(); const polyBoundaryMesh& pbMesh = mesh.boundaryMesh(); const liquidMixture& fuels = sDB.fuels(); scalar deltaT = sDB.runTime().deltaT().value(); label Nf = fuels.components().size(); label Ns = sDB.composition().Y().size(); // Calculate the interpolated gas properties at the position of the parcel vector Up = sDB.UInterpolator().interpolate(position(), cell()) + Uturb(); scalar rhog = sDB.rhoInterpolator().interpolate(position(), cell()); scalar pg = sDB.pInterpolator().interpolate(position(), cell()); scalar Tg = sDB.TInterpolator().interpolate(position(), cell()); scalarField Yfg(Nf, 0.0); scalar cpMixture = 0.0; for(label i=0; i<Ns; i++) { const volScalarField& Yi = sDB.composition().Y()[i]; if (sDB.isLiquidFuel()[i]) { label j = sDB.gasToLiquidIndex()[i]; scalar Yicelli = Yi[cell()]; Yfg[j] = Yicelli; } cpMixture += Yi[cell()]*sDB.gasProperties()[i].Cp(Tg); } // Correct the gaseous temperature for evaporated fuel scalar cellV = sDB.mesh().V()[cell()]; scalar cellMass = rhog*cellV; Tg += sDB.shs()[cell()]/(cpMixture*cellMass); // Changed cut-off temperature for evaporation. HJ, 27/Apr/2011 Tg = max(273, Tg); scalar tauMomentum = GREAT; scalar tauHeatTransfer = GREAT; scalarField tauEvaporation(Nf, GREAT); scalarField tauBoiling(Nf, GREAT); bool keepParcel = true; setRelaxationTimes ( cell(), tauMomentum, tauEvaporation, tauHeatTransfer, tauBoiling, sDB, rhog, Up, Tg, pg, Yfg, m()*fuels.Y(X()), deltaT ); // set the end-time for the track scalar tEnd = (1.0 - stepFraction())*deltaT; // Set the maximum time step for this parcel // FPK changes: avoid temperature-out-of-range errors // in spray tracking. HJ, 13/Oct/2007 // tauEvaporation no longer multiplied by 1e20, // to account for the evaporation timescale // FPK, 13/Oct/2007 scalar dtMax = min ( tEnd, min ( tauMomentum, min ( mag(min(tauEvaporation)), min ( mag(tauHeatTransfer), mag(min(tauBoiling)) ) ) ) )/sDB.subCycles(); // prevent the number of subcycles from being too many // (10 000 seems high enough) dtMax = max(dtMax, 1.0e-4*tEnd); bool switchProcessor = false; vector planeNormal = vector::zero; if (sDB.twoD()) { planeNormal = n() ^ sDB.axisOfSymmetry(); planeNormal /= mag(planeNormal); } // move the parcel until there is no 'timeLeft' while (keepParcel && tEnd > SMALL && !switchProcessor) { // set the lagrangian time-step scalar dt = min(dtMax, tEnd); // remember which cell the parcel is in // since this will change if a face is hit label celli = cell(); scalar p = sDB.p()[celli]; // track parcel to face, or end of trajectory if (keepParcel) { // Track and adjust the time step if the trajectory // is not completed dt *= trackToFace(position() + dt*U_, sDB); // Decrement the end-time acording to how much time the track took tEnd -= dt; // Set the current time-step fraction. stepFraction() = 1.0 - tEnd/deltaT; if (onBoundary()) // hit face { # include "boundaryTreatment.H" } } if (keepParcel && sDB.twoD()) { scalar z = position() & sDB.axisOfSymmetry(); vector r = position() - z*sDB.axisOfSymmetry(); if (mag(r) > SMALL) { correctNormal(sDB.axisOfSymmetry()); } } // **** calculate the lagrangian source terms **** // First we get the 'old' properties. // and then 'update' them to get the 'new' // properties. // The difference is then added to the source terms. scalar oRho = fuels.rho(p, T(), X()); scalarField oMass(Nf, 0.0); scalar oHg = 0.0; scalar oTotMass = m(); scalarField oYf(fuels.Y(X())); forAll(oMass, i) { oMass[i] = m()*oYf[i]; label j = sDB.liquidToGasIndex()[i]; oHg += oYf[i]*sDB.gasProperties()[j].Hs(T()); } vector oMom = m()*U(); scalar oHv = fuels.hl(p, T(), X()); scalar oH = oHg - oHv; scalar oPE = (p - fuels.pv(p, T(), X()))/oRho; // update the parcel properties (U, T, D) updateParcelProperties ( dt, sDB, celli, face() ); scalar nRho = fuels.rho(p, T(), X()); scalar nHg = 0.0; scalarField nMass(Nf, 0.0); scalarField nYf(fuels.Y(X())); forAll(nMass, i) { nMass[i] = m()*nYf[i]; label j = sDB.liquidToGasIndex()[i]; nHg += nYf[i]*sDB.gasProperties()[j].Hs(T()); }
void parcel::setRelaxationTimes ( label celli, scalar& tauMomentum, scalarField& tauEvaporation, scalar& tauHeatTransfer, scalarField& tauBoiling, const spray& sDB, const scalar rho, const vector& Up, const scalar temperature, const scalar pressure, const scalarField& Yfg, const scalarField& m0, const scalar dt ) { const liquidMixture& fuels = sDB.fuels(); scalar mCell = rho*sDB.mesh().V()[cell()]; scalarField mfg(Yfg*mCell); label Ns = sDB.composition().Y().size(); label Nf = fuels.components().size(); // Tf is based on the 1/3 rule scalar Tf = T() + (temperature - T())/3.0; // calculate mixture properties scalar W = 0.0; scalar kMixture = 0.0; scalar cpMixture = 0.0; scalar muf = 0.0; for(label i=0; i<Ns; i++) { scalar Y = sDB.composition().Y()[i][celli]; W += Y/sDB.gasProperties()[i].W(); // Using mass-fractions to average... kMixture += Y*sDB.gasProperties()[i].kappa(Tf); cpMixture += Y*sDB.gasProperties()[i].Cp(Tf); muf += Y*sDB.gasProperties()[i].mu(Tf); } W = 1.0/W; scalarField Xf(Nf, 0.0); scalarField Yf(Nf, 0.0); scalarField psat(Nf, 0.0); scalarField msat(Nf, 0.0); for(label i=0; i<Nf; i++) { label j = sDB.liquidToGasIndex()[i]; scalar Y = sDB.composition().Y()[j][celli]; scalar Wi = sDB.gasProperties()[j].W(); Yf[i] = Y; Xf[i] = Y*W/Wi; psat[i] = fuels.properties()[i].pv(pressure, temperature); msat[i] = min(1.0, psat[i]/pressure)*Wi/W; } scalar nuf = muf/rho; scalar liquidDensity = fuels.rho(pressure, T(), X()); scalar liquidcL = fuels.cp(pressure, T(), X()); scalar heatOfVapour = fuels.hl(pressure, T(), X()); // calculate the partial rho of the fuel vapour // alternative is to use the mass fraction // however, if rhoFuelVap is small (zero) // d(mass)/dt = 0 => no evaporation... hmmm... is that good? NO! // Assume equilibrium at drop-surface => pressure @ surface // = vapour pressure to calculate fuel-vapour density @ surface scalar pressureAtSurface = fuels.pv(pressure, T(), X()); scalar rhoFuelVap = pressureAtSurface*fuels.W(X())/(specie::RR*Tf); scalarField Xs(sDB.fuels().Xs(pressure, temperature, T(), Xf, X())); scalarField Ys(Nf, 0.0); scalar Wliq = 0.0; for(label i=0; i<Nf; i++) { label j = sDB.liquidToGasIndex()[i]; scalar Wi = sDB.gasProperties()[j].W(); Wliq += Xs[i]*Wi; } for(label i=0; i<Nf; i++) { label j = sDB.liquidToGasIndex()[i]; scalar Wi = sDB.gasProperties()[j].W(); Ys[i] = Xs[i]*Wi/Wliq; } scalar Reynolds = Re(Up, nuf); scalar Prandtl = Pr(cpMixture, muf, kMixture); // calculate the characteritic times if(liquidCore_> 0.5) { // no drag for parcels in the liquid core.. tauMomentum = GREAT; } else { tauMomentum = sDB.drag().relaxationTime ( Urel(Up), d(), rho, liquidDensity, nuf, dev() ); } // store the relaxationTime since it is needed in some breakup models. tMom_ = tauMomentum; tauHeatTransfer = sDB.heatTransfer().relaxationTime ( liquidDensity, d(), liquidcL, kMixture, Reynolds, Prandtl ); // evaporation-properties are evaluated at averaged temperature // set the boiling conditions true if pressure @ surface is 99.9% // of the pressure // this is mainly to put a limit on the evaporation time, // since tauEvaporation is very very small close to the boiling point. for(label i=0; i<Nf; i++) { scalar Td = min(T(), 0.999*fuels.properties()[i].Tc()); bool boiling = fuels.properties()[i].pv(pressure, Td) >= 0.999*pressure; scalar Di = fuels.properties()[i].D(pressure, Td); scalar Schmidt = Sc(nuf, Di); scalar partialPressure = Xf[i]*pressure; // saturated vapour if(partialPressure > psat[i]) { tauEvaporation[i] = GREAT; } // not saturated vapour else { if (!boiling) { // for saturation evaporation, only use 99.99% for numerical robustness scalar dm = max(SMALL, 0.9999*msat[i] - mfg[i]); tauEvaporation[i] = sDB.evaporation().relaxationTime ( d(), fuels.properties()[i].rho(pressure, Td), rhoFuelVap, Di, Reynolds, Schmidt, Xs[i], Xf[i], m0[i], dm, dt ); } else { scalar Nusselt = sDB.heatTransfer().Nu(Reynolds, Prandtl); // calculating the boiling temperature of the liquid at ambient pressure scalar tBoilingSurface = Td; label Niter = 0; scalar deltaT = 10.0; scalar dp0 = fuels.properties()[i].pv(pressure, tBoilingSurface) - pressure; while ((Niter < 200) && (mag(deltaT) > 1.0e-3)) { Niter++; scalar pBoil = fuels.properties()[i].pv(pressure, tBoilingSurface); scalar dp = pBoil - pressure; if ( (dp > 0.0) && (dp0 > 0.0) ) { tBoilingSurface -= deltaT; } else { if ( (dp < 0.0) && (dp0 < 0.0) ) { tBoilingSurface += deltaT; } else { deltaT *= 0.5; if ( (dp > 0.0) && (dp0 < 0.0) ) { tBoilingSurface -= deltaT; } else { tBoilingSurface += deltaT; } } } dp0 = dp; } scalar vapourSurfaceEnthalpy = 0.0; scalar vapourFarEnthalpy = 0.0; for(label k = 0; k < sDB.gasProperties().size(); k++) { vapourSurfaceEnthalpy += sDB.composition().Y()[k][celli]*sDB.gasProperties()[k].H(tBoilingSurface); vapourFarEnthalpy += sDB.composition().Y()[k][celli]*sDB.gasProperties()[k].H(temperature); } scalar kLiquid = fuels.properties()[i].K(pressure, 0.5*(tBoilingSurface+T())); tauBoiling[i] = sDB.evaporation().boilingTime ( fuels.properties()[i].rho(pressure, Td), fuels.properties()[i].cp(pressure, Td), heatOfVapour, kMixture, Nusselt, temperature - T(), d(), liquidCore(), sDB.runTime().value() - ct(), Td, tBoilingSurface, vapourSurfaceEnthalpy, vapourFarEnthalpy, cpMixture, temperature, kLiquid ); } } } }