chemistryModel: removed superfluous time argument to solve

This commit is contained in:
Henry
2013-09-26 22:40:13 +01:00
parent ca6fb03260
commit e197117805
9 changed files with 24 additions and 44 deletions

View File

@ -1,7 +1,3 @@
dtChem = chemistry.solve dtChem = chemistry.solve(runTime.deltaT().value());
(
runTime.value() - runTime.deltaT().value(),
runTime.deltaT().value()
);
scalar Sh = chemistry.Sh()()[0]/rho[0]; scalar Sh = chemistry.Sh()()[0]/rho[0];
integratedHeat += Sh*runTime.deltaT().value(); integratedHeat += Sh*runTime.deltaT().value();

View File

@ -81,16 +81,15 @@ void Foam::combustionModels::PaSR<Type>::correct()
{ {
if (this->active()) if (this->active())
{ {
const scalar t = this->mesh().time().value();
const scalar dt = this->mesh().time().deltaTValue(); const scalar dt = this->mesh().time().deltaTValue();
if (!useReactionRate_) if (useReactionRate_)
{ {
this->chemistryPtr_->solve(t - dt, dt); this->chemistryPtr_->calculate();
} }
else else
{ {
this->chemistryPtr_->calculate(); this->chemistryPtr_->solve(dt);
} }
if (turbulentReaction_) if (turbulentReaction_)
@ -106,25 +105,16 @@ void Foam::combustionModels::PaSR<Type>::correct()
const volScalarField& tc = ttc(); const volScalarField& tc = ttc();
forAll(epsilon, i) forAll(epsilon, i)
{
if (epsilon[i] > 0)
{ {
scalar tk = scalar tk =
Cmix_*Foam::sqrt(muEff[i]/rho[i]/(epsilon[i] + SMALL)); Cmix_*Foam::sqrt(muEff[i]/rho[i]/(epsilon[i] + SMALL));
// Chalmers PaSR model if (tk > SMALL)
if (!useReactionRate_)
{
kappa_[i] = (dt + tc[i])/(dt + tc[i] + tk);
}
else
{ {
kappa_[i] = tc[i]/(tc[i] + tk); kappa_[i] = tc[i]/(tc[i] + tk);
} }
}
else else
{ {
// Return to laminar combustion
kappa_[i] = 1.0; kappa_[i] = 1.0;
} }
} }

View File

@ -691,11 +691,7 @@ void reactingOneDim::evolveRegion()
if (useChemistrySolvers_) if (useChemistrySolvers_)
{ {
solidChemistry_->solve solidChemistry_->solve(time().deltaTValue());
(
time().value() - time().deltaTValue(),
time().deltaTValue()
);
} }
else else
{ {

View File

@ -152,9 +152,9 @@ public:
//- Calculates the reaction rates //- Calculates the reaction rates
virtual void calculate() = 0; virtual void calculate() = 0;
//- Solve the reaction system for the given start time and //- Solve the reaction system for the given time step
// timestep and return the characteristic time // and return the characteristic time
virtual scalar solve(const scalar t0, const scalar deltaT) = 0; virtual scalar solve(const scalar deltaT) = 0;
//- Return the chemical time scale //- Return the chemical time scale
virtual tmp<volScalarField> tc() const = 0; virtual tmp<volScalarField> tc() const = 0;

View File

@ -744,7 +744,6 @@ void Foam::chemistryModel<CompType, ThermoType>::calculate()
template<class CompType, class ThermoType> template<class CompType, class ThermoType>
Foam::scalar Foam::chemistryModel<CompType, ThermoType>::solve Foam::scalar Foam::chemistryModel<CompType, ThermoType>::solve
( (
const scalar t0,
const scalar deltaT const scalar deltaT
) )
{ {
@ -795,7 +794,7 @@ Foam::scalar Foam::chemistryModel<CompType, ThermoType>::solve
c0 = c; c0 = c;
// initialise timing parameters // initialise timing parameters
scalar t = t0; scalar t = 0;
scalar tauC = this->deltaTChem_[celli]; scalar tauC = this->deltaTChem_[celli];
scalar dt = min(deltaT, tauC); scalar dt = min(deltaT, tauC);
scalar timeLeft = deltaT; scalar timeLeft = deltaT;

View File

@ -217,9 +217,9 @@ public:
const label i const label i
); );
//- Solve the reaction system for the given start time and time //- Solve the reaction system for the given time step
// step and return the characteristic time // and return the characteristic time
virtual scalar solve(const scalar t0, const scalar deltaT); virtual scalar solve(const scalar deltaT);
//- Return the chemical time scale //- Return the chemical time scale
virtual tmp<volScalarField> tc() const; virtual tmp<volScalarField> tc() const;

View File

@ -580,7 +580,6 @@ template<class CompType, class SolidThermo, class GasThermo>
Foam::scalar Foam::scalar
Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::solve Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::solve
( (
const scalar t0,
const scalar deltaT const scalar deltaT
) )
{ {
@ -638,7 +637,7 @@ Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::solve
c0 = c; c0 = c;
scalar t = t0; scalar t = 0;
scalar tauC = this->deltaTChem_[celli]; scalar tauC = this->deltaTChem_[celli];
scalar dt = min(deltaT, tauC); scalar dt = min(deltaT, tauC);
scalar timeLeft = deltaT; scalar timeLeft = deltaT;

View File

@ -224,9 +224,9 @@ public:
const label i const label i
) const; ) const;
//- Solve the reaction system for the given start time and time //- Solve the reaction system for the given time step
// step and return the characteristic time // and return the characteristic time
virtual scalar solve(const scalar t0, const scalar deltaT) ; virtual scalar solve(const scalar deltaT);
// ODE functions (overriding abstract functions in ODE.H) // ODE functions (overriding abstract functions in ODE.H)

View File

@ -214,9 +214,9 @@ public:
//- Return total solid source term //- Return total solid source term
inline tmp<DimensionedField<scalar, volMesh> > RRs() const; inline tmp<DimensionedField<scalar, volMesh> > RRs() const;
//- Solve the reaction system for the given start time and time //- Solve the reaction system for the given time step
// step and return the characteristic time // and return the characteristic time
virtual scalar solve(const scalar t0, const scalar deltaT) = 0; virtual scalar solve(const scalar deltaT) = 0;
//- Return the chemical time scale //- Return the chemical time scale
virtual tmp<volScalarField> tc() const; virtual tmp<volScalarField> tc() const;