Opened 5 years ago
Last modified 5 years ago
#6106 closed defect
The default nonlinear solver accepts solutions which are not fulfilling NewtonXTol — at Version 1
Reported by: | Francesco Casella | Owned by: | Andreas Heuermann |
---|---|---|---|
Priority: | critical | Milestone: | 1.16.0 |
Component: | Run-time | Version: | |
Keywords: | Cc: | Andrea Bartolini, Andreas Heuermann |
Description (last modified by )
Consider the attached test package. The test case represents a simple thermo-hydraulic system with a fixed pressure and temperature source, two series-connected laminar pressure losses and a variable volume, that breathes air in and out through the two pressure losses.
The two series-connected components generate a nonlinear system of equation in the regular section, which is torn and results in a system with two iteration variables p1
and p2
.
If you simulate Test1
, the simulation fails at time 0.32. Some analysis reveals that the derivative of the state p2rel
is very noise, and that depends on the fact that w
is also very noisy. This noise fools the error estimator of the ODE solver, causing it to reduce the time step and to eventually fail because it cannot guarantee the required tolerance.
By running the test with LOG_NLS_V
turned on, several messages "NO ITERATION NECESSARY" pop up, at time instants corresponding to the spikes in w
and der(p2rel)
. It seems that the code of the default nonlinear solver checks the residuals of the nonlinear system at each new time step, and in case they are below the tolerance NewtonFTol they accept the solution. This is not good, because also the tolerance on the unknowns NewtonXTol should be checked, triggering a few iterations of the solver and guaranteeing that not only the residual is small, but also that the solution is precise enough.
This problem only affects systems which are badly conditioned from a numerical point of view, but this often happens with thermo-hydraulic systems, in particular when components with small pressure losses are included in the circuit.
For the record, Test2
usese the KINSOL solver, which is not affected by this issue, resulting in the simulation to be successful and only require 14 steps.
Change History (2)
comment:1 by , 5 years ago
Cc: | added |
---|---|
Description: | modified (diff) |
Summary: | The default nonlinear solver accepts solution which are not fulfilling NewtonXTol → The default nonlinear solver accepts solutions which are not fulfilling NewtonXTol |
by , 5 years ago
Attachment: | TestNewton.mo added |
---|