Simulation of Metallic Sphere in Uniform Magnetic Field

General discussion about Elmer
kevinarden
Posts: 2317
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Simulation of Metallic Sphere in Uniform Magnetic Field

Post by kevinarden »

Normal and Tangential to the boundary, even if it is angles or curved.
Tom_B
Posts: 27
Joined: 14 Jun 2023, 12:28
Antispam: Yes

Re: Simulation of Metallic Sphere in Uniform Magnetic Field

Post by Tom_B »

Hi!

I wanted to share an update on my progress. Unfortunately, using the T-N coordinate system didn't yield the desired results. In the "Thermal Flow in a Curved Pipe" example, setting the velocity on the boundary to 0 made it easier to choose random tangential axes without any issues. However, in my case, I need to fix them for each face before computing the new vector potential formula. I gave it a shot, but the outcomes were way off. To be honest, I've been trying for a week now and haven't gotten anywhere close to what I want. So, I've decided to give up for now.

If anyone has any ideas or suggestions, I would truly appreciate them. Thanks a ton for your help. It's amazing to be part of such a supportive community where everyone helps each other. Good luck to all!

P.S.: If someone is willing to assist me, my ultimate goal is to achieve the following:

I'm working on generating the magnetic field of a magnetic dipole. aka:

Bx = 3M xz/r^5
By = 3M yz/r^5
Bz = M (3z^2-r^2)/r^5
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Simulation of Metallic Sphere in Uniform Magnetic Field

Post by raback »

Hi,

Unfortunately the n-t coordinate system is only applicable to vector field given by cartesian components. The MagnetoDynamics solvers use edge elements where the components are not present. Instead the degrees of freedom are multipliers of basis functions that have direction associated to the edges.

So setting up the vector potential component-wise there is some internal projections taking place. The desired vector is projected to the edge basis functions. As the edge basis functions at the boundary are always aligned with the surface you can only define the tangential components. Normal components at the surface cannot be defined. So whatever you give only the tangential components will be enforced.

-Peter
Rich_B
Posts: 423
Joined: 24 Aug 2009, 20:18

Re: Simulation of Metallic Sphere in Uniform Magnetic Field

Post by Rich_B »

Hello Tom,

I have to apologize for suggesting N-T without realizing it doesn't apply in this case.

I tried running your sim6.sif, using an elmergrid cube for geometry. It failed with this message:
1 NaN
ERROR:: IterSolve: Numerical Error: System diverged over maximum tolerance.
The (not) working example is attached.

Rich.
Attachments
sim6.zip
(1.64 KiB) Downloaded 24 times
Tom_B
Posts: 27
Joined: 14 Jun 2023, 12:28
Antispam: Yes

Re: Simulation of Metallic Sphere in Uniform Magnetic Field

Post by Tom_B »

Hi Peter,

I hope this message finds you well. I have a question that has been bothering me lately, and I believe your expertise could help shed some light on it. I'm trying to understand if there's a way to enforce the magnetic field in a specific area, such as working within a cube.

To put it simply, I'm wondering if we can create a desired magnetic field, given the formula for B (Bx, By, Bz) for all x, y, z, using only the boundary conditions. For instance, when attempting to generate a homogeneous magnetic field, I initially enforced the magnetic flux value on the boundaries. However, I found that the solution I obtained was not very accurate near the boundaries.

In my research, I came across the suggestion of using the vector potential as a more suitable approach with the solver I'm using. So, I tried enforcing a certain pattern to achieve a homogeneous curl(A). It seemed to work, and I was quite happy, thinking that by setting the right values for the vector potential on the boundaries, I could generate any desired magnetic field. However, to my disappointment, it didn't quite work out as I had hoped.

This brings me to my question: Is there a method or technique that allows for precise manipulation of magnetic fields within a specified region using boundary conditions alone? I would greatly appreciate any insights or guidance you could provide.

Thank you in advance for your time and assistance. I look forward to hearing your thoughts on this matter.

Best regards,
kevinarden
Posts: 2317
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Simulation of Metallic Sphere in Uniform Magnetic Field

Post by kevinarden »

There is a method known as "Boundary Element Method" (BEM) that can be used to precisely manipulate magnetic fields within a specified region using boundary conditions alone.

The Boundary Element Method is a numerical technique that focuses on solving partial differential equations (such as the magnetic field equation) by discretizing only the boundary of the problem domain, rather than the entire volume. In the context of electromagnetic analysis, this means that only the boundaries where the desired magnetic field needs to be controlled are discretized.

I do not know if Elmer has this capability.
mika
Posts: 236
Joined: 15 Sep 2009, 07:44

Re: Simulation of Metallic Sphere in Uniform Magnetic Field

Post by mika »

Tom_B wrote: 04 Jul 2023, 14:53 I'm wondering if we can create a desired magnetic field, given the formula for B (Bx, By, Bz) for all x, y, z, using only the boundary conditions
A mathematical feature of the vector potential formulation is that a vector potential producing the desired B as B = curl A is not unique (if A is a suitable solution, a field of the form A* = A + grad Q would also serve as a solution). I believe you may need to impose an additional constraint for div A over the body in order to produce your known candidate A with Elmer. I checked that your candidate A seems to satisfy the Coulomb gauge div A = 0, so you could probably try to impose it by using the keyword "Use Lagrange Gauge", together with giving suitable boundary conditions for the vector potential.

-- Mika
Tom_B
Posts: 27
Joined: 14 Jun 2023, 12:28
Antispam: Yes

Re: Simulation of Metallic Sphere in Uniform Magnetic Field

Post by Tom_B »

Massive thanks for the advice! I'm all geared up to give it my best shot. Truly, you're the best! Your guidance is much appreciated.
Post Reply