mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
chemistryModel: removed superfluous time argument to solve
This commit is contained in:
@ -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();
|
||||
|
||||
@ -81,16 +81,15 @@ 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_)
|
||||
if (useReactionRate_)
|
||||
{
|
||||
this->chemistryPtr_->solve(t - dt, dt);
|
||||
this->chemistryPtr_->calculate();
|
||||
}
|
||||
else
|
||||
{
|
||||
this->chemistryPtr_->calculate();
|
||||
this->chemistryPtr_->solve(dt);
|
||||
}
|
||||
|
||||
if (turbulentReaction_)
|
||||
@ -106,25 +105,16 @@ void Foam::combustionModels::PaSR<Type>::correct()
|
||||
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
|
||||
if (tk > SMALL)
|
||||
{
|
||||
kappa_[i] = tc[i]/(tc[i] + tk);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Return to laminar combustion
|
||||
kappa_[i] = 1.0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -691,11 +691,7 @@ void reactingOneDim::evolveRegion()
|
||||
|
||||
if (useChemistrySolvers_)
|
||||
{
|
||||
solidChemistry_->solve
|
||||
(
|
||||
time().value() - time().deltaTValue(),
|
||||
time().deltaTValue()
|
||||
);
|
||||
solidChemistry_->solve(time().deltaTValue());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -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<volScalarField> tc() const = 0;
|
||||
|
||||
@ -744,7 +744,6 @@ void Foam::chemistryModel<CompType, ThermoType>::calculate()
|
||||
template<class CompType, class ThermoType>
|
||||
Foam::scalar Foam::chemistryModel<CompType, ThermoType>::solve
|
||||
(
|
||||
const scalar t0,
|
||||
const scalar deltaT
|
||||
)
|
||||
{
|
||||
@ -795,7 +794,7 @@ Foam::scalar Foam::chemistryModel<CompType, ThermoType>::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;
|
||||
|
||||
@ -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<volScalarField> tc() const;
|
||||
|
||||
@ -580,7 +580,6 @@ template<class CompType, class SolidThermo, class GasThermo>
|
||||
Foam::scalar
|
||||
Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::solve
|
||||
(
|
||||
const scalar t0,
|
||||
const scalar deltaT
|
||||
)
|
||||
{
|
||||
@ -638,7 +637,7 @@ Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::solve
|
||||
|
||||
c0 = c;
|
||||
|
||||
scalar t = t0;
|
||||
scalar t = 0;
|
||||
scalar tauC = this->deltaTChem_[celli];
|
||||
scalar dt = min(deltaT, tauC);
|
||||
scalar timeLeft = deltaT;
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -214,9 +214,9 @@ public:
|
||||
//- Return total solid source term
|
||||
inline tmp<DimensionedField<scalar, volMesh> > 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<volScalarField> tc() const;
|
||||
|
||||
Reference in New Issue
Block a user