SaveLine with MagnetoDynamics2D axi-symmetric case (SOLVED)

General discussion about Elmer
Post Reply
fjimenez
Posts: 63
Joined: 27 Sep 2021, 23:40
Antispam: Yes

SaveLine with MagnetoDynamics2D axi-symmetric case (SOLVED)

Post by fjimenez »

Hi All,

I have a simple case with a magnet and I want to plot B over a line. I am using SaveLine to generate the data. In 3D I get an OK line but in 2D (axi-symmetric) the line is wrong (see figure). I am using a very coarse mesh for now, only for testing my scripts. Is there a limitation with SaveLine when trying to interpolate in 2D cases or am I doing something wrong?
simple_case.png
simple_case.png (54.44 KiB) Viewed 807 times

Cheers,

Francisco
simple_case.tgz
(12.33 KiB) Downloaded 54 times
Last edited by fjimenez on 26 Oct 2022, 18:31, edited 1 time in total.
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: SaveLine with MagnetoDynamics2D axi-symmetric case

Post by kevinarden »

When I do it in paraview it looks good
line.png
(250.73 KiB) Not downloaded yet
fjimenez
Posts: 63
Joined: 27 Sep 2021, 23:40
Antispam: Yes

Re: SaveLine with MagnetoDynamics2D axi-symmetric case

Post by fjimenez »

Thanks for taking a look at the case. Yes, in paraview it looks OK, that is why I am wondering if this is a limitation of SaveLine. I'd rather get all the data directly from Elmer since I have struggled in the past with scripts that I wrote for old versions of paraview that do not work with new ones. Particularly when they went from 5.9 to 5.10.

Cheers,

Francisco
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: SaveLine with MagnetoDynamics2D axi-symmetric case

Post by kevinarden »

The nodal values look OK, there are nodes along the line, the element values are choppy, the element centers are off the line
column c are the nodal values
curve.png
(234.68 KiB) Not downloaded yet
fjimenez
Posts: 63
Joined: 27 Sep 2021, 23:40
Antispam: Yes

Re: SaveLine with MagnetoDynamics2D axi-symmetric case

Post by fjimenez »

oh, I forgot about the nodal values. I think this will work for what I need to do, thanks for your help. Still wondering why the elements interpolation
does not work. They are OK in 3D though.

Cheers,

Francisco
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: SaveLine with MagnetoDynamics2D axi-symmetric case

Post by kevinarden »

Might be due to the tolerance of the element centers to the line. The nodes are spot on, but due to mesh size some element centers may be considered on the line and some may not be considered on the line.
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: SaveLine with MagnetoDynamics2D axi-symmetric case

Post by raback »

Hi

There was an unfortunate confusion among the solvers. Historically the VTU output was the 1st Solver to properly treat DG fields with jumps. So the averaging was implemented to the ResultOutputSolver. When SaveLine is used after that the lines look pretty. Unfortunately in your case you had chosen the execution slots such that the SaveLine is called before averaging.

Code: Select all

Solver 3  !---- ResultOuputSolve, ResultOuputSolver
   Exec Solver = after all
   Procedure = "ResultOutputSolve" "ResultOutputSolver"
..

Solver 4
  Exec Solver = After timestep
  Procedure = "SaveData" "SaveLine"
...
It is indeed quite a poor feature that the averaging is a side effect of saving VTU files. Hence I added a keyword "Average Within Materials = True" such that the averaging may be done in the primary solver of MagnetoDynamics (and also EMWaveSolver and VectorHelmholtz). The ResultOutputSolver knows not to do it again. This way we are no longer dependent on the VTU output to average things.

Note that the keyword "Average Within Materials" is already used by some proper DG solvers to add glueing terms. This make the averaging implicit whereas the new use of the keyword is done after the elemental fields have been created.

I will commit this to "devel" within ~30 minutes after running the tests.

-Peter
fjimenez
Posts: 63
Joined: 27 Sep 2021, 23:40
Antispam: Yes

Re: SaveLine with MagnetoDynamics2D axi-symmetric case

Post by fjimenez »

Thanks Peter. It is now very clear to me why I was getting a non interpolated line as output. This also explains why a similar approach in 3D was
working well.

Cheers,

Francisco
Reynold50
Posts: 1
Joined: 26 Oct 2022, 16:44
Antispam: Yes

Re: SaveLine with MagnetoDynamics2D axi-symmetric case (SOLVED)

Post by Reynold50 »

Hello and thank you for these explanations. It helps me a lot and indeed, it works well.
Here to watch 3D Video Porn
Post Reply