[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:
parent
8e81292558
commit
af5bbf74a4
2 changed files with 8 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue