## Linear mesh motion

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

### Linear mesh motion

Hi,

Before I go down the rabbit hole I would like to ask the community in case anyone knows the answer. Say I have a permanent magnet in proximity to a piece of metal. Is it possible to simulate linear movement (move magnet in a straight line in the x or y direction only) with Elmer? I've already run several cases with a static mesh both in 2d and 3d but I need to run some cases where the magnets are moving in a straight line relative to the piece of metal. Any help would be greatly appreciated.

Cheers,

Francisco
raback
Posts: 4237
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

### Re: Linear mesh motion

Hi,

Yes we can!

Two main choices:
a) deform the air mesh with (MeshSolve or RigidMeshMapper)
b) use mortar BCs to let two mesh pieces slide with each other

In both you would use time dependency mode "scanning" and move the pieces in pseudo-time. Which strategy you choose depends on what type the movement is. There is a more experimental approach (even I don't remember exactly how to use it) which allows you also to switch meshes on-the-fly to deal with more extreme deformations. In all cases the meshes should be predetermined.

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

### Re: Linear mesh motion

Thanks Peter. This looks promising. I need to calculate the impact of magnet speed on a piece of metal for an industrial application and I am trying
to convince myself that we can do it in Elmer. I already have some results and it looks that we will use elmer but I need to know how to do simulate this problem before we move forward. Three more questions:
1.- Do you have a test case you can refer me to that would do something like this? For instance, I can't find that much info on scanning mode.
2.- Would case a) be applicable to something that is moving fast and would deform the mesh significantly? I case b) would be more appropriate for our problem but I might be mistaken.
3.- if we run in pseudo-time we would lose real time dependency of the problem, right? Say I want to calculate the eddy current generated by moving the magnets and their diffusion timescale, how would the solver account for the real dt if we are running in pseudo-time?

Cheers,

Francisco
raback
Posts: 4237
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

### Re: Linear mesh motion

Hi

2 & 3) If you have real physical time, you don't need scanning. They work the same way except for scanning dt=1 and d/dt is zero.

1) I just added a test case that combines the two strategies of mesh movement. Did it in 2D mainly because it is a lot smaller & quicker and the test can be run in seconds. Test can be found in: https://github.com/ElmerCSC/elmerfem/tr ... ingObjects.

Below is a picture from the test.
Potential between two moving squares
MortarMovingObjects.PNG (615.5 KiB) Viewed 764 times
-Peter
fjimenez
Posts: 4
Joined: 27 Sep 2021, 23:40
Antispam: Yes

### Re: Linear mesh motion

Thanks Peter, much appreciated. It took me a little bit to figure out how to set up the mesh for mortar bcs using my workflow (freecad+salome) but at the end I figured it out and now I have a very basic version that seems to work. Next step is to try a more complex case and see how it compares to previous simulations (not sure what software they used for that). I assume that there is not nothing limiting from this case to work with axi-symmetrical cases, right?

Cheers,

Francisco
raback
Posts: 4237
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

### Re: Linear mesh motion

Hi

Yes, but note that for 2D and 3D you have very different solvers for magnetoquasistatics (for fluids and structures the same solvers are used for both).

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

### Re: Linear mesh motion

Hi Peter,

Thanks for the advice, I was able to get a simple magnet to move using MagnetoDynamics2D. However, I think this approach won’t work with a more complex 3D geometry (very slow). I then switched to WhitneyAVSolver and added a body force to the moving object to include the vxB force using Lorentz Velocity keyword. This approach works well for what I need. However, I have two symmetry planes (cylindrical) to reduce the system size, and I also need to impose v on the moving surface but if I am not mistaken I can only impose boundary conditions related to the vector potential, right? Would I need to work out the math to make the boundary conditions consistent with having a velocity component at the boundary? I tried mortar boundary conditions to see if this approach would work better but I don’t seem to find any difference between the radial and anti radial projectors even for the static case (no v).

Cheers,