force the CVODE solver to continue despite the error test failed repeatedly or with |h| = hmin

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

force the CVODE solver to continue despite the error test failed repeatedly or with |h| = hmin

mary-2
Dear CVODE users,

I am using cvode to solve the chemistry. My case in one dimensional. The
chemistry is receiving the temperature and velocity profiles of the fluid
and the concentration of species are calculated by the ODE solver of
sundials CVODE. We have equilibrium everywhere except one point where there
is an abrupt change of temperature/velocity and consequently the species
concentration. I had the following errors :

the error test failed repeatedly or with |h| = hmin

In the beginning this was occurring where I had the abrupt change of
temperature. So, I though that maybe by treating this point as
discontinuity, the problem would be solved. That was not the case. So I was
obliged to remove the point where due to numerical solution the temperature
had a pick (this point is circled in red on the attached image). This point
has no physical meaning, so its removal does not bother me. My solving
consists on doing the calculation of the fluid part first and after based on
temperature and velocity profiles I do chemistry calculation. And I should
say that from one iteration to another, the profile of temperature and
velocity do not change. So, with the same profile of temperature profile,
the CVODE does well for one iteration and after for another give the above
error for places where there is equilibrium (regions circled bu green). I do
not understand why because the concentration calculated for different
iterations are the exact same thing (as temperature and velocity do not
change). At extreme case, I can even put a condition to say if the
temperature and velocity changes are not bigger than X, do not do the
calculation of the chemistry. However, I would like to understand why such a
thing happens and how we can avoid that.

I would like also to know how I can *force the CVODE solver to continue even
though it ends up with this error * ? Because, it might continue well for
next iterations (for each iteration, the initialization is the same. The
results of previous calculation of the chemistry part is not used for
initialization of the chemistry of next steps (I don't know if we can
initialize the field with the results of the previous step) ).


Thanks for helping me,
Mary
<http://sundials.2283335.n4.nabble.com/file/t374957/sundials_CVODE_Tprofile.png>



--
Sent from: http://sundials.2283335.n4.nabble.com/Sundials-Users-f3239170.html

  ############################

  To unsubscribe from the SUNDIALS-USERS list:
  write to: mailto:[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: force the CVODE solver to continue despite the error test failed repeatedly or with |h| = hmin

Hindmarsh, Alan Carleton
Hello Mary,

To answer your last question, no there is no way to force CVODE to
continue when it has given up with a repeated failure condition.
(The "or ... hmin" part of the message does not apply, as the default
value of hmin is 0, assuming you did not call CVodeSetMinStep.)

The closest thing to such a forcing is to restart CVODE from the
last good solution (t,y) reached.  By starting over, with a smaller
step size than what was last tried, that may succeed.  If it also fails
to make progress, then some other approach is needed.
In general, that kind of error return calls for some diagnostics to
determine the cause of the failures.

-Alan H


On 4/12/19 5:58 AM, mary wrote:

> Dear CVODE users,
>
> I am using cvode to solve the chemistry. My case in one dimensional. The
> chemistry is receiving the temperature and velocity profiles of the fluid
> and the concentration of species are calculated by the ODE solver of
> sundials CVODE. We have equilibrium everywhere except one point where there
> is an abrupt change of temperature/velocity and consequently the species
> concentration. I had the following errors :
>
> the error test failed repeatedly or with |h| = hmin
>
> In the beginning this was occurring where I had the abrupt change of
> temperature. So, I though that maybe by treating this point as
> discontinuity, the problem would be solved. That was not the case. So I was
> obliged to remove the point where due to numerical solution the temperature
> had a pick (this point is circled in red on the attached image). This point
> has no physical meaning, so its removal does not bother me. My solving
> consists on doing the calculation of the fluid part first and after based on
> temperature and velocity profiles I do chemistry calculation. And I should
> say that from one iteration to another, the profile of temperature and
> velocity do not change. So, with the same profile of temperature profile,
> the CVODE does well for one iteration and after for another give the above
> error for places where there is equilibrium (regions circled bu green). I do
> not understand why because the concentration calculated for different
> iterations are the exact same thing (as temperature and velocity do not
> change). At extreme case, I can even put a condition to say if the
> temperature and velocity changes are not bigger than X, do not do the
> calculation of the chemistry. However, I would like to understand why such a
> thing happens and how we can avoid that.
>
> I would like also to know how I can *force the CVODE solver to continue even
> though it ends up with this error * ? Because, it might continue well for
> next iterations (for each iteration, the initialization is the same. The
> results of previous calculation of the chemistry part is not used for
> initialization of the chemistry of next steps (I don't know if we can
> initialize the field with the results of the previous step) ).
>
>
> Thanks for helping me,
> Mary
> <http://sundials.2283335.n4.nabble.com/file/t374957/sundials_CVODE_Tprofile.png>
>
>
>
> --
> Sent from: http://sundials.2283335.n4.nabble.com/Sundials-Users-f3239170.html
>
>    ############################
>
>    To unsubscribe from the SUNDIALS-USERS list:
>    write to: mailto:[hidden email]


  ############################

  To unsubscribe from the SUNDIALS-USERS list:
  write to: mailto:[hidden email]