Heat equation (step-26): Negative values with small time step

125 views
Skip to first unread message

Marc Fehling

unread,
Dec 7, 2017, 11:52:39 AM12/7/17
to deal.II User Group
Dear deal.ii community!

I stumbled over some interesting behavior of the heat equation from step-26. If I reduce the time step to a smaller value, let's say to 1e-6, I observe negative values for the solution near the sources (where gradients are large), which I would not expect. I guess it is related to the sharpness of the used right hand side function, since I could not observe this behavior with a smooth Gaussian shaped one. So my idea was then that DG methods may suppress this behavior. How are your thoughts about that?

I stumbled over this issue while working on buoyancy-driven flows. It causes negative temperature differences in my setup, yielding downward buoyancy forces which ruin the whole dynamic of the fluid in the end.

I would be grateful for any comment on that!

Best,
Marc

Bruno Turcksin

unread,
Dec 7, 2017, 12:32:04 PM12/7/17
to deal.II User Group
Marc,


On Thursday, December 7, 2017 at 11:52:39 AM UTC-5, Marc Fehling wrote:
I stumbled over some interesting behavior of the heat equation from step-26. If I reduce the time step to a smaller value, let's say to 1e-6, I observe negative values for the solution near the sources (where gradients are large), which I would not expect. I guess it is related to the sharpness of the used right hand side function, since I could not observe this behavior with a smooth Gaussian shaped one. So my idea was then that DG methods may suppress this behavior. How are your thoughts about that?
This is a well-know problem and using DG won't solve it (unless you use DG_0, i.e., finite volume). You need some kind of flux limiter I don't know what works for your problem so you probably need to check the literature.




Marc Fehling

unread,
Dec 11, 2017, 10:21:51 AM12/11/17
to deal.II User Group

Hi Bruno,

I only heard about applying flux limiters on advection/convection problems, but not on diffusion-related ones. This conforms with what I recently found in literature, but I may skipped something crucial.

The equation of interest is the heat equation:

Do you think that flux limiters or TVDs work for a combination like this?

I also suspect that I missed some lower bound on a stability constraint for the factor (k*timestepsize)? But from von Neumann analysis, I only get an upper one on that.

I hope that one of you has any experience on that to share :)

Best,
Marc

Praveen C

unread,
Dec 11, 2017, 12:06:00 PM12/11/17
to Deal. II Googlegroup
Thomee shows that using small time steps can lose positivity in some schemes, see


Best
praveen

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Marc Fehling

unread,
Dec 13, 2017, 11:06:04 AM12/13/17
to deal.II User Group
Hi Praveen,

thank you for your hint! Indeed, choosing a time step size according to the threshold of positivity from Theorem 6 of Thomée's paper will lead to nonnegative results.

However, choosing a step size slightly below this lower bound still yields the desired nonnegative results, probably because the system matrix is not a Stieltjes matrix, as I checked the entries of the stiffness matrix. But this more restrictive condition certainly puts you on the safe side.

Best,
Marc

Wolfgang Bangerth

unread,
Dec 17, 2017, 7:45:15 PM12/17/17
to dea...@googlegroups.com
On 12/13/2017 09:06 AM, Marc Fehling wrote:
>
> thank you for your hint! Indeed, choosing a time step size according to the
> /threshold of positivity/ from Theorem 6 of Thomée's paper will lead to
> nonnegative results.
>
> However, choosing a step size slightly below this lower bound still yields the
> desired nonnegative results, probably because the system matrix is not a
> Stieltjes matrix, as I checked the entries of the stiffness matrix. But this
> more restrictive condition certainly puts you on the safe side.

I think your observation of negative values is an interesting one (and
surprising one, for many). Would you be interested in writing a couple of
paragraphs about time step choice for the introduction of this program?

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/

Marc Fehling

unread,
Jan 3, 2018, 8:06:07 AM1/3/18
to deal.II User Group
Hi Wolfgang,


On Monday, December 18, 2017 at 1:45:15 AM UTC+1, Wolfgang Bangerth wrote:
I think your observation of negative values is an interesting one (and
surprising one, for many). Would you be interested in writing a couple of
paragraphs about time step choice for the introduction of this program?

Yes, I will do that. I could either enhance the introduction, or write a new paragraph in the 'Possibilities for extensions' sections. I guess the latter option would be the better one.

I could provide a code snippet on how to check for positivity preservation, but for that I need a way to access the non-diagonal entries of a SparseMatrix. Do you have an idea on how to do it in a fast way?

Best,
Marc

Wolfgang Bangerth

unread,
Jan 4, 2018, 10:14:32 AM1/4/18
to dea...@googlegroups.com, Marc Fehling

> Yes, I will do that. I could either enhance the introduction, or write a new
> paragraph in the 'Possibilities for extensions' sections. I guess the latter
> option would be the better one.

Either would be great!


> I could provide a code snippet on how to check for positivity preservation,
> but for that I need a way to access the non-diagonal entries of a
> SparseMatrix. Do you have an idea on how to do it in a fast way?

You can create an iterator to the elements of a matrix row. Would that do what
you need?

Marc Fehling

unread,
Jan 6, 2018, 9:03:52 PM1/6/18
to deal.II User Group
I extended the step-26 documentation and provided a pull request on github.


You can create an iterator to the elements of a matrix row. Would that do what
you need?

Yes, that's exactly what I was looking for. I just somehow missed the information that diagonal elements were stored as the first element of each row in quadratic matrices. But with that, one is able to distinguish between those entries easily.

Best,
Marc
Reply all
Reply to author
Forward
0 new messages