[1D] Improve Jacobian evaluation for ReactingSurf1D

Don't normalize coverages when evaluating the residual normally -- only as part
of recovering from a failed timestep, like what is done in StFlow.
This commit is contained in:
Ray Speth 2016-03-14 18:17:00 -04:00
parent 8e81292558
commit af5bbf74a4
2 changed files with 8 additions and 1 deletions

View file

@ -354,6 +354,7 @@ public:
virtual std::string componentName(size_t n) const;
virtual void init();
virtual void resetBadValues(double* xg);
virtual void eval(size_t jg, doublereal* xg, doublereal* rg,
integer* diagg, doublereal rdt);

View file

@ -715,6 +715,12 @@ void ReactingSurf1D::init()
setTransientTolerances(1.0e-5, 1.0e-4, 0);
}
void ReactingSurf1D::resetBadValues(double* xg) {
double* x = xg + loc();
m_sphase->setCoverages(x+1);
m_sphase->getCoverages(x+1);
}
void ReactingSurf1D::eval(size_t jg, doublereal* xg, doublereal* rg,
integer* diagg, doublereal rdt)
{
@ -738,7 +744,7 @@ void ReactingSurf1D::eval(size_t jg, doublereal* xg, doublereal* rg,
sum += x[k+1];
}
m_sphase->setTemperature(x[0]);
m_sphase->setCoverages(m_work.data());
m_sphase->setCoveragesNoNorm(m_work.data());
// set the left gas state to the adjacent point