Saveline issue

Numerical methods and mathematical models of Elmer
Post Reply
gforti
Posts: 77
Joined: 11 Jan 2022, 20:39
Antispam: Yes

Saveline issue

Post by gforti »

Hello all,

I am trying to use saveline in a simulation, but I've been having issues. The simulation is from a FEMM to Elmer procedure I am trying to create. More information here:
https://www.elmerfem.org/forum/viewtopic.php?t=8094

The results from the saveline for this case is very, very, weird. I've tried to replicate the issue in another case, but it worked fine. All simulation files are here:
https://github.com/gforti84/ElmerFiles/ ... in/debug_7

My case:
Fig_case1.png
(93.86 KiB) Not downloaded yet
Pavel PMSM case:
Fig_case2.png
(91.14 KiB) Not downloaded yet
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Saveline issue

Post by raback »

Hi

Didn't run, just looked the sif files.

It seems that the initial mesh has only one parents for the internal boundary elements. These cause then some issues when the mesh needs to be made discontinuous on the interface. Where does the mesh come from? Based on your comments on the sif file it seems that the 2nd side then gets the no-parents boundary elements when they are split and when SaveLine tries to evaluate the stuff it faces issues. All but nodal elements require the parent element for evalution.

Generally it would be nicer to create two distinct objects to start with. Sometimes you have access to a mesh that does not allow the discontnuity so it needs to be generated in this rather dirty way.

I have more or less forgotton the way how to do coordinate transformation for SaveLine. I think this is generic way to ask Solvers to jump to a different coordinate system. I could imagine that that edge element evaluation could go south. Btw there seems to be a test case "SaveCircle" too.

If you don't do coordinate transformation do think work then? How about if you reduce the radius. Being exactly at the interface is always more difficult than to interpolate mid elements.

-Peter
gforti
Posts: 77
Joined: 11 Jan 2022, 20:39
Antispam: Yes

Re: Saveline issue

Post by gforti »

Hello Peter,

Thank for the response. The mesh came from converting triangle mesh to elmer mesh (FEMM to Elmer FEM). I am trying to create a tutorial to add to elmer-elmag repository.
This is discussed here:
https://github.com/gforti84/ElmerFiles/ ... in/share_1

I've also added more save line examples in the git folder:
https://github.com/gforti84/ElmerFiles/ ... in/debug_7
kevinarden
Posts: 2316
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Saveline issue

Post by kevinarden »

Curious why the Discontinuous Target Bodies(1) = 10 is 10
when boundary elements 2 touch body 12 and 13?

Boundary Condition 2
! Based on Pavel PMSM example
! Also: https://github.com/ElmerCSC/elmerfem/tr ... ubleMortar

! Tried different settings without success

Target Boundaries(1) = 2
Name = "Sliding"
Discontinuous Boundary = Logical True
! Save Line = Logical True -> ERROR:: SaveLine: Parent not associated!

! Without this -> ERROR:: CreateDiscontMesh: Alternative strategy requires all parent elements!
Discontinuous Target Bodies(1) = 10

Mortar BC = 3
Rotational Projector = Logical True
Galerkin Projector = Logical True
End
kevinarden
Posts: 2316
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Saveline issue

Post by kevinarden »

It is the coordinate transformation causing the issue, if you do not use the coordinate transformation in save line, the results look reasonable.
result.png
(569.72 KiB) Not downloaded yet
compare.png
(396.99 KiB) Not downloaded yet
gforti
Posts: 77
Joined: 11 Jan 2022, 20:39
Antispam: Yes

Re: Saveline issue

Post by gforti »

Hello Kevin,

Thanks for the help.

For this setting, it can be 10 or 11, which are the definitions for stator or rotor air-gaps:

Code: Select all

Body 10
  Target Bodies(1) = 13
  Name = "Stator air gap"
  Equation = 1
  Material = 1
End

Body 11
  Target Bodies(1) = 12
  Name = "Rotor air gap"
  Equation = 1
  Material = 1
  Body Force = 1
End
Anyway, for this example, you can run the steady state simulation which does not have this discontinuity in the "dirty way" (case file : case_pmsm_std.sif). Results are weird the same.
If you don't perform the coordinate transformation, results are similar to FEMM (which uses first order elements, but has a smoothing function. This is why the FEMM curves are more smooth).

About the coordinate transformation, it somehow works in the other example.

Anyway. I am trying to set this example the way someone would bring the simulation from FEMM. There, you can not have two contours, two arc segments over each other like in Elmer.
Post Reply