Coupling Magnetodynamics to Fluid dynamics

Numerical methods and mathematical models of Elmer
metermera
Posts: 11
Joined: 14 Feb 2023, 17:08
Antispam: Yes

Coupling Magnetodynamics to Fluid dynamics

Post by metermera »

I am new to Elmer but have been impressed so far. I have been able to run the provided TEAM7 3D magnetodynamics test cases on Github without too many problems even on new meshes built on Salome. I am trying to see if I can use Elmer to solve the appropriate formulations of Maxwells and Navier-Stokes equations iteratively for a conductor moving azimuthally through a solenoid magnetic field. The conductor can be assumed to be a metal sphere and the coil a cylinder, giving good degree of axisymmetry to the problem.

I have been able to achieve the static case (i.e. a static conductor near a solenoid coil) using Coilsolver as it is similar to the Transient TEAM7 test problem on Github (if one replaces the Elmer provided plate mesh with the conductor of desired geometry etc).

I don't mind getting my hands dirty so any help would be appreciated. The magnetic reynolds number for my problem is >>1 so only an iterative method would work (velocity ~being high and dominant).
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Coupling Magnetodynamics to Fluid dynamics

Post by raback »

Hi,

Sounds interesting!

What can you assume regarding the conductor? I guess it is rigid? How many degrees of freedom are there? One translations or beyond? Are you trying to solve a ramp up or a steady state with final velocity? Is the coil of finite length? What I'm trying to map what kind of simplications you can make. Is the unstationary flow the only thing breaking the symmetry.

Under favorable assumptions I think this can certainly be solved. The most difficult scenario would be one where you want to move the sphere a long distance. If the coil is finite you end up with some challenge on the mesh deformation that may make it hard to solve the high-Re flows. Devil lies in the detail...

The problem of magnetic levitation has been solved with Elmer & OpenFOAM using EOF library. There is also a Elmer-only setup to be found in this forum on axisymmetric levitation.

-Peter
metermera
Posts: 11
Joined: 14 Feb 2023, 17:08
Antispam: Yes

Re: Coupling Magnetodynamics to Fluid dynamics

Post by metermera »

Thanks Peter for your response and for resetting my password...(-;

To start with, the conductor is rigid. At this stage we shall consider one translational degree of freedom along the axis/vector chosen to be central to the hollow cylindrical coil. The sphere is modeled as moving at terminal high velocity along this vector/axis and drift in other directions can be ignored (in practice there is drift but this simplification can be relaxed later). So deformations of the solid will not be solved for unless you think convergence in reasonable time is possible.

The coil will have a finite length and the aim is to solve for the typical variables in such EM problems i.e. induced eddy current density due to a translating conductor in a magnetic field, JxB force as a vector field, path of the sphere through the coil as an animation etc.

With these simplifications I believe the symmetry is intact. I have attached a Paraview rendering of a static case solved with Circuit Builder/CoilSolver - showing with magnetic flux density streamlines emerging from the hollow part of the coil.

I have examined the axisymmetric levitation example in this discussion forum (i.e. EV levitation (December 2021) and it is quite fun and probably a good starting point. I see the 3D case attempted by Roland solves for mesh deformation but did not solve properly. I can attempt this after solving the simpler case.

Any help greatly appreciated.

Kind regards.

M.
Attachments
sphere approaching coil.png
(145.64 KiB) Not downloaded yet
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Coupling Magnetodynamics to Fluid dynamics

Post by raback »

Hi,

Nice case!

The basic way how to deform mesh in conjunction of rigid shapes are

1) Move discontinuous meshes & use mortar BCs
- results to more difficult linear systems, not good here
- test case: RotatingBeamFlow
2) Move rigid pieces and deform the fluid mesh using RigidMeshMapper
- easier linear systems
- eventually the mesh becomes distored
- test case (one of many): RotatingBeamFlow2 (new!)
- For generic cases MeshSolver is used (one scalar relaxation field not enough)
3) Swap meshes
- used rather little
- might be combined with 2), perhaps
- test case: MeshSwap1

I would study 2) for your case.

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

Re: Coupling Magnetodynamics to Fluid dynamics

Post by kevinarden »

Don't know if it is a fit, but it was an interesting case
viewtopic.php?t=7279
fjimenez
Posts: 63
Joined: 27 Sep 2021, 23:40
Antispam: Yes

Re: Coupling Magnetodynamics to Fluid dynamics

Post by fjimenez »

Hi,

This is a simple case that might help. It is a copper sphere passing through a coil (no NS) at a constant speed. It works as long as the boundaries (top and bottom) do not interfere with the region of interest. I tried to add an NS solver but I think this approach will not work. I am also not that familiar with the NS solver in Elmer so I did not know what knobs to tweak. An approach that might work would be to use precice or EOF to couple Elmer and OpenFOAM. You solve for v and p in Openfoam in a larger domain and then map values to the elmer mesh. I've done dynamic mesh simulations similar to this one in OpenFOAM so I know it is possible.

I've tried to do this in 3D but you have to solve it in parallel otherwise it takes forever. Unfortunately I have not found the way to break the mortar boundaries so they can be in different partitions and I always end up with a very unbalanced parallel mesh.
anim1.gif
anim1.gif (367.42 KiB) Viewed 794 times
Cheers,
Attachments
sphere.tgz
(536.09 KiB) Downloaded 49 times
metermera
Posts: 11
Joined: 14 Feb 2023, 17:08
Antispam: Yes

Re: Coupling Magnetodynamics to Fluid dynamics

Post by metermera »

All very helpful guys. I'd like to work with an Elmer only solution. I'll report back on my progress. Thanks again.
metermera
Posts: 11
Joined: 14 Feb 2023, 17:08
Antispam: Yes

Re: Coupling Magnetodynamics to Fluid dynamics

Post by metermera »

Thanks again guys for all your help and suggestions.

I have been able to run a simulation in transient mode using RigidMeshMapper to translate my spherical conductor in a magnetic field generated by a coil solved for using the Circuit Builder/Coil Solver module. After some trial and error (largely due to my lack of experience with Elmer) this rigid body translation and in a magnetic field now works well. I get convergence and can plot coil current density surfaces and Mag density field lines in Paraview for post processing etc

The issue is that none of my other expected induced properties in the conductor are not solved for. In my problem, I have a conductor moving in a static magnetic field generated by a coil but cannot seem to solve for any induced eddy currents (and Joule heating) or JxB Lorentz forces. My understanding is that the MagneticDynamics solver in Elmer can treat these induced properties for a transient state.

Please can anyone take a look at my Sif file. The Mesh file isn't attached as its quite big (100mb). I can find a way to send if needed.

I am sure I am missing something basic.

Thanks .
Attachments
hgff_0323.sif
(7.46 KiB) Downloaded 44 times
fjimenez
Posts: 63
Joined: 27 Sep 2021, 23:40
Antispam: Yes

Re: Coupling Magnetodynamics to Fluid dynamics

Post by fjimenez »

Hi,

You can try uploading a coarse mesh, that usually works for troubleshooting.

Cheers,
metermera
Posts: 11
Joined: 14 Feb 2023, 17:08
Antispam: Yes

Re: Coupling Magnetodynamics to Fluid dynamics

Post by metermera »

Thanks. I have attached a course mesh in .unv format.
Let me know if it is too coarse.
Attachments
Mesh_4.unv
(268.77 KiB) Downloaded 37 times
Post Reply