diff --git a/applications/solvers/combustion/chemFoam/solveChemistry.H b/applications/solvers/combustion/chemFoam/solveChemistry.H index daf56309bd..cb4258c31d 100644 --- a/applications/solvers/combustion/chemFoam/solveChemistry.H +++ b/applications/solvers/combustion/chemFoam/solveChemistry.H @@ -1,7 +1,3 @@ - dtChem = chemistry.solve - ( - runTime.value() - runTime.deltaT().value(), - runTime.deltaT().value() - ); + dtChem = chemistry.solve(runTime.deltaT().value()); scalar Sh = chemistry.Sh()()[0]/rho[0]; integratedHeat += Sh*runTime.deltaT().value(); diff --git a/src/combustionModels/PaSR/PaSR.C b/src/combustionModels/PaSR/PaSR.C index 8cf2f03171..7bf26a18cb 100644 --- a/src/combustionModels/PaSR/PaSR.C +++ b/src/combustionModels/PaSR/PaSR.C @@ -81,16 +81,15 @@ void Foam::combustionModels::PaSR::correct() { if (this->active()) { - const scalar t = this->mesh().time().value(); const scalar dt = this->mesh().time().deltaTValue(); - if (!useReactionRate_) + if (useReactionRate_) { - this->chemistryPtr_->solve(t - dt, dt); + this->chemistryPtr_->calculate(); } else { - this->chemistryPtr_->calculate(); + this->chemistryPtr_->solve(dt); } if (turbulentReaction_) @@ -107,24 +106,15 @@ void Foam::combustionModels::PaSR::correct() forAll(epsilon, i) { - if (epsilon[i] > 0) - { - scalar tk = - Cmix_*Foam::sqrt(muEff[i]/rho[i]/(epsilon[i] + SMALL)); + 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); - } + if (tk > SMALL) + { + kappa_[i] = tc[i]/(tc[i] + tk); } else { - // Return to laminar combustion kappa_[i] = 1.0; } } diff --git a/src/regionModels/pyrolysisModels/reactingOneDim/reactingOneDim.C b/src/regionModels/pyrolysisModels/reactingOneDim/reactingOneDim.C index 1e6a30627e..b98417e52a 100644 --- a/src/regionModels/pyrolysisModels/reactingOneDim/reactingOneDim.C +++ b/src/regionModels/pyrolysisModels/reactingOneDim/reactingOneDim.C @@ -691,11 +691,7 @@ void reactingOneDim::evolveRegion() if (useChemistrySolvers_) { - solidChemistry_->solve - ( - time().value() - time().deltaTValue(), - time().deltaTValue() - ); + solidChemistry_->solve(time().deltaTValue()); } else { diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModel.H b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModel.H index 75ea14eb67..f7143df63f 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModel.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/basicChemistryModel/basicChemistryModel.H @@ -152,9 +152,9 @@ public: //- Calculates the reaction rates virtual void calculate() = 0; - //- Solve the reaction system for the given start time and - // timestep and return the characteristic time - virtual scalar solve(const scalar t0, const scalar deltaT) = 0; + //- Solve the reaction system for the given time step + // and return the characteristic time + virtual scalar solve(const scalar deltaT) = 0; //- Return the chemical time scale virtual tmp tc() const = 0; diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModel.C b/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModel.C index f23a80b6ef..098083b6fd 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModel.C +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModel.C @@ -744,7 +744,6 @@ void Foam::chemistryModel::calculate() template Foam::scalar Foam::chemistryModel::solve ( - const scalar t0, const scalar deltaT ) { @@ -795,7 +794,7 @@ Foam::scalar Foam::chemistryModel::solve c0 = c; // initialise timing parameters - scalar t = t0; + scalar t = 0; scalar tauC = this->deltaTChem_[celli]; scalar dt = min(deltaT, tauC); scalar timeLeft = deltaT; diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModel.H b/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModel.H index 475fc7c8fd..232855d620 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModel.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/chemistryModel/chemistryModel.H @@ -217,9 +217,9 @@ public: const label i ); - //- Solve the reaction system for the given start time and time - // step and return the characteristic time - virtual scalar solve(const scalar t0, const scalar deltaT); + //- Solve the reaction system for the given time step + // and return the characteristic time + virtual scalar solve(const scalar deltaT); //- Return the chemical time scale virtual tmp tc() const; diff --git a/src/thermophysicalModels/solidChemistryModel/pyrolysisChemistryModel/pyrolysisChemistryModel.C b/src/thermophysicalModels/solidChemistryModel/pyrolysisChemistryModel/pyrolysisChemistryModel.C index 4962bf716b..f5cb38648b 100644 --- a/src/thermophysicalModels/solidChemistryModel/pyrolysisChemistryModel/pyrolysisChemistryModel.C +++ b/src/thermophysicalModels/solidChemistryModel/pyrolysisChemistryModel/pyrolysisChemistryModel.C @@ -580,7 +580,6 @@ template Foam::scalar Foam::pyrolysisChemistryModel::solve ( - const scalar t0, const scalar deltaT ) { @@ -638,7 +637,7 @@ Foam::pyrolysisChemistryModel::solve c0 = c; - scalar t = t0; + scalar t = 0; scalar tauC = this->deltaTChem_[celli]; scalar dt = min(deltaT, tauC); scalar timeLeft = deltaT; diff --git a/src/thermophysicalModels/solidChemistryModel/pyrolysisChemistryModel/pyrolysisChemistryModel.H b/src/thermophysicalModels/solidChemistryModel/pyrolysisChemistryModel/pyrolysisChemistryModel.H index 7ae76c5233..fd82b4d09a 100644 --- a/src/thermophysicalModels/solidChemistryModel/pyrolysisChemistryModel/pyrolysisChemistryModel.H +++ b/src/thermophysicalModels/solidChemistryModel/pyrolysisChemistryModel/pyrolysisChemistryModel.H @@ -224,9 +224,9 @@ public: const label i ) const; - //- Solve the reaction system for the given start time and time - // step and return the characteristic time - virtual scalar solve(const scalar t0, const scalar deltaT) ; + //- Solve the reaction system for the given time step + // and return the characteristic time + virtual scalar solve(const scalar deltaT); // ODE functions (overriding abstract functions in ODE.H) diff --git a/src/thermophysicalModels/solidChemistryModel/solidChemistryModel/solidChemistryModel.H b/src/thermophysicalModels/solidChemistryModel/solidChemistryModel/solidChemistryModel.H index bf67f1ca4d..93a6833250 100644 --- a/src/thermophysicalModels/solidChemistryModel/solidChemistryModel/solidChemistryModel.H +++ b/src/thermophysicalModels/solidChemistryModel/solidChemistryModel/solidChemistryModel.H @@ -214,9 +214,9 @@ public: //- Return total solid source term inline tmp > RRs() const; - //- Solve the reaction system for the given start time and time - // step and return the characteristic time - virtual scalar solve(const scalar t0, const scalar deltaT) = 0; + //- Solve the reaction system for the given time step + // and return the characteristic time + virtual scalar solve(const scalar deltaT) = 0; //- Return the chemical time scale virtual tmp tc() const;