Tightend up the tolerances on the nonlinear solvers.

This commit is contained in:
Harry Moffat 2010-12-15 02:15:27 +00:00
parent ec8bbc5be2
commit 73d8df7f4c
2 changed files with 13 additions and 3 deletions

View file

@ -394,11 +394,21 @@ namespace Cantera {
{
int i;
doublereal sum_norm = 0.0, error;
for (i = 0; i < neq_; i++) {
#ifdef DEBUG_HKM
mdp::checkFinite(resid[i]);
#endif
error = resid[i] / m_residWts[i];
#ifdef DEBUG_HKM
mdp::checkFinite(error);
#endif
sum_norm += (error * error);
}
sum_norm = sqrt(sum_norm / neq_);
#ifdef DEBUG_HKM
mdp::checkFinite(sum_norm);
#endif
if (printLargest) {
const int num_entries = printLargest;
doublereal dmax1, normContrib;
@ -588,7 +598,7 @@ namespace Cantera {
{
double oldVal = m_ScaleSolnNormToResNorm;
if (m_normSolnFRaw > 1.0E-13) {
m_ScaleSolnNormToResNorm = m_normResid0 / m_normSolnFRaw * oldVal;
m_ScaleSolnNormToResNorm = 1.0E-2 * m_normResid0 / m_normSolnFRaw * oldVal;
}
m_normResid0 = m_normSolnFRaw;
computeResidWts();
@ -1769,7 +1779,7 @@ namespace Cantera {
}
sum /= neq_;
for (int i = 0; i < neq_; i++) {
m_residWts[i] = m_ScaleSolnNormToResNorm * (m_residWts[i] + atolBase_ * sum);
m_residWts[i] = m_ScaleSolnNormToResNorm * (m_residWts[i] + atolBase_ * atolBase_ * sum);
}
}
//=====================================================================================================================

View file

@ -224,7 +224,7 @@ namespace Cantera {
if (x1 == 0.0) {
x2 = 0.00001 * (xmax - xmin);
} else {
x2 = x1 * 1.01;
x2 = x1 * 1.0001;
}
if (x2 > xmax) {
x2 = x1 - (xmax - xmin) / 100.;