Unexpected behavior of (adaptive) BDF time stepping (with WhitneyAVSolver)

Numerical methods and mathematical models of Elmer
Post Reply
wiesi
Posts: 27
Joined: 12 Apr 2011, 21:29
Antispam: Yes

Unexpected behavior of (adaptive) BDF time stepping (with WhitneyAVSolver)

Post by wiesi »

Hi,

I try to simulate the current diffusion in a conductor and started with a simple testcase (straight wire). The initial condition is zero current and the boundary condition is a potential step at one end.
The expected behavior is to see the current conduction starting at the outer surface of the wire. The current density more at the center should be delayed.

This works if I set the BDF order to 1. The second timestep current density, for example, is:
anim.0001.png
anim.0001.png (46.56 KiB) Viewed 1133 times
Setting the BDF order to 2, the current density starts at the side of the potential step and kind of "propagates" down the wire:
bdf2anim.0001.png
bdf2anim.0001.png (19.54 KiB) Viewed 1133 times
This is unexpected and the solution also seems to violate div(J) = 0 (just from the pictures, didn't calculate it). Maybe I violate some requirements of the BDF solver so I'd usually think it is my fault.

However, using BDF Order = 1 and and an adaptive timestep, the result is rather similar to the fixed timestep with order = 2. I don't understand why. (No image because only 3 files can be attached? All images can be found in the attached archive.)
I also tried a smoother tanh-step a little bit later (not immediately at the simulation start) just in case the immediate step somehow conflicts with the initial condition, but the result shows the same problem.

Elmer version is: Version: 9.0 (Rev: 6ab20a47, Compiled: 2021-11-21), Compiled on Debian 11.

The complete testcase including the sif, mesh files and pictures is attached.
Attachments
testcase.tar.gz
(500.57 KiB) Downloaded 111 times
kevinarden
Posts: 2312
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Unexpected behavior of (adaptive) BDF time stepping (with WhitneyAVSolver)

Post by kevinarden »

Immediate reaction from the images is that the mesh is too coarse for meaningful results, I would try some mesh refinement, or higher order elements before proceeding. Unfortunately iterative solutions can arrive at an end result without converging to a meaningful solution, leading to an impression that the case is 'solved'
Rich_B
Posts: 423
Joined: 24 Aug 2009, 20:18

Re: Unexpected behavior of (adaptive) BDF time stepping (with WhitneyAVSolver)

Post by Rich_B »

By decreasing time step size and increasing number of steps like this:
Timestep Sizes(1) = 1e-7
Timestep Intervals(1) = 30
then both BDF Order = 1 and BDF Order = 2 give similar results that look like the desired results. Also both orders now have the same peak current density magnitude of 5.2e5.

Making the same change with adaptive time steps did not help.

BTW, trying second order edge elements didn't help either.

Hope this helps, Rich.
kevinarden
Posts: 2312
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Unexpected behavior of (adaptive) BDF time stepping (with WhitneyAVSolver)

Post by kevinarden »

Thanks Rich,
Smaller time steps and smaller elements almost always help any problem. When you look at a contour of results it should be smooth not jagged.
wiesi
Posts: 27
Joined: 12 Apr 2011, 21:29
Antispam: Yes

Re: Unexpected behavior of (adaptive) BDF time stepping (with WhitneyAVSolver)

Post by wiesi »

kevinarden wrote: 07 Dec 2021, 00:21 Immediate reaction from the images is that the mesh is too coarse for meaningful results, I would try some mesh refinement, or higher order elements before proceeding.
I just used such a coarse mesh for the uploaded example to keep the file size down. It happens with finer meshes, too.

Hm. Setting the timestep settings to

Code: Select all

Timestep Sizes(1) = 1e-7
Timestep Intervals(1) = 30
doesn't help for me. Still the same problem with BDF order = 2. Only the first timestep looks better, but the remaining ones show the same effect. I attached two animated gifs showing the difference. Maybe it depends on the Elmer version? Did you change anything else?
The adaptive timestep result seems to be the worst of all with 1e-7 timestep (no pictures attached).
Attachments
bdf2.gif
bdf2.gif (475.18 KiB) Viewed 1113 times
bdf1.gif
bdf1.gif (693.55 KiB) Viewed 1113 times
Rich_B
Posts: 423
Joined: 24 Aug 2009, 20:18

Re: Unexpected behavior of (adaptive) BDF time stepping (with WhitneyAVSolver)

Post by Rich_B »

Hello,

attached are two animations and two solver logs, for each of the bdf cases, also the sif files.

Note the animations show current density magnitude, not current density e magnitude. Also the geometry was converted from gmsh msh format to elmer format using ElmerGui, which is the equivalent to 'elmergrid 14 2 inputfilename -autoclean'. This step renumbered the boundaries.

Windows 10, Version: 9.0 (Rev: Release, Compiled: 2021-11-22

Rich.
Attachments
mytry1.7z
(146.76 KiB) Downloaded 101 times
Last edited by Rich_B on 08 Dec 2021, 16:08, edited 1 time in total.
raback
Site Admin
Posts: 4828
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Unexpected behavior of (adaptive) BDF time stepping (with WhitneyAVSolver)

Post by raback »

Hi

A challenge in the AV solver is that the current source or whatever terms we get on the r.h.s. should always be divergence free. I wonder if there is something in the higher order schemes that results to fishy source terms. We have not used higher order too much for the AV solver ourselves as a main application field has been related to rotating machines and there higher order accuracy is anyways spoiled by the rotating parts. For EM wave solver higher order schemes worked well.

Have you tried the opposite of very small timesteps ;-) I guess rather long timesteps should be ok since the system approaches steady state which is ok.

-Peter
wiesi
Posts: 27
Joined: 12 Apr 2011, 21:29
Antispam: Yes

Re: Unexpected behavior of (adaptive) BDF time stepping (with WhitneyAVSolver)

Post by wiesi »

@Rich: Thank you for checking the testcase with your installed version. Seems to have the same problem.

@Peter:
I just checked with a timestep of 1e-4. Is does converge to a meaningful constant stationary value. The transient part, however is still messed up and observing the transient behavior is the point of this simulation.

If a BDF order > 1 is a problem, why doesn't it work with adaptive timestepping and BDF order set to 1? Can the adaptive timestepping also mess up the divergence?
Post Reply