void Foam::combustionModels::PaSR<Type>::correct() { if (this->active()) { laminar<Type>::correct(); if (turbulentReaction_) { tmp<volScalarField> tepsilon(this->turbulence().epsilon()); const volScalarField& epsilon = tepsilon(); tmp<volScalarField> tmuEff(this->turbulence().muEff()); const volScalarField& muEff = tmuEff(); tmp<volScalarField> ttc(this->tc()); const volScalarField& tc = ttc(); tmp<volScalarField> trho(this->rho()); const volScalarField& rho = trho(); forAll(epsilon, i) { scalar tk = Cmix_*sqrt(max(muEff[i]/rho[i]/(epsilon[i] + SMALL), 0)); if (tk > SMALL) { kappa_[i] = tc[i]/(tc[i] + tk); } else { kappa_[i] = 1.0; } } }
void Foam::combustionModels::EDC<ReactionThermo>::correct() { tmp<volScalarField> tepsilon(this->turbulence().epsilon()); const volScalarField& epsilon = tepsilon(); tmp<volScalarField> tmu(this->turbulence().mu()); const volScalarField& mu = tmu(); tmp<volScalarField> tk(this->turbulence().k()); const volScalarField& k = tk(); tmp<volScalarField> trho(this->rho()); const volScalarField& rho = trho(); scalarField tauStar(epsilon.size(), 0); if (version_ == EDCversions::v2016) { tmp<volScalarField> ttc(this->chemistryPtr_->tc()); const volScalarField& tc = ttc(); forAll(tauStar, i) { const scalar nu = mu[i]/(rho[i] + small); const scalar Da = max(min(sqrt(nu/(epsilon[i] + small))/tc[i], 10), 1e-10); const scalar ReT = sqr(k[i])/(nu*epsilon[i] + small); const scalar CtauI = min(C1_/(Da*sqrt(ReT + 1)), 2.1377); const scalar CgammaI = max(min(C2_*sqrt(Da*(ReT + 1)), 5), 0.4082); const scalar gammaL = CgammaI*pow025(nu*epsilon[i]/(sqr(k[i]) + small)); tauStar[i] = CtauI*sqrt(nu/(epsilon[i] + small)); if (gammaL >= 1) { kappa_[i] = 1; } else { kappa_[i] = max ( min ( pow(gammaL, exp1_)/(1 - pow(gammaL, exp2_)), 1 ), 0 ); } } }
void Foam::combustionModels::PaSR<Type>::correct() { if (this->active()) { const scalar t = this->mesh().time().value(); const scalar dt = this->mesh().time().deltaTValue(); if (!useReactionRate_) { this->chemistryPtr_->solve(t - dt, dt); } else { this->chemistryPtr_->calculate(); } if (turbulentReaction_) { tmp<volScalarField> trho(this->rho()); const volScalarField& rho = trho(); tmp<volScalarField> tepsilon(this->turbulence().epsilon()); const volScalarField& epsilon = tepsilon(); tmp<volScalarField> tmuEff(this->turbulence().muEff()); const volScalarField& muEff = tmuEff(); tmp<volScalarField> ttc(tc()); const volScalarField& tc = ttc(); forAll(epsilon, i) { if (epsilon[i] > 0) { scalar tk = Cmix_*Foam::sqrt(muEff[i]/rho[i]/(epsilon[i] + SMALL)); // Chalmers PaSR model if (!useReactionRate_) { kappa_[i] = (dt + tc[i])/(dt + tc[i] + tk); } else { kappa_[i] = tc[i]/(tc[i] + tk); } } else { // Return to laminar combustion kappa_[i] = 1.0; } } } else { kappa_ = 1.0; } }