I am once again asking for your help.

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

Re: I am once again asking for your help.

Post by kevinarden »

I think you have a harmonic varying magnetic field, which means B = B0 exp(-iw) and a frequency dependent-dependent output.
such that magnetic flux density is B_re cos(w) + i B_im sin(w)
Rich_B
Posts: 423
Joined: 24 Aug 2009, 20:18

Re: I am once again asking for your help.

Post by Rich_B »

Hello Tom,

As Kevin mentioned, running a transient case may be helpful for you. Basically calculate how long one cycle takes (in seconds), and divide that into about 20 steps. Output to vtu after each step and use Paraview to make an animation of the results. Watching how the magnetic field changes over one cycle should be educational.

For an example of a transient study, refer to this forum post:

viewtopic.php?t=8008

Thanks, Rich.
kevinarden
Posts: 2317
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: I am once again asking for your help.

Post by kevinarden »

You can go to the time domain using transient, or if you want to stay in the frequency domain, Elmer provides a scanning solution, that sets up a variable that the happen to define as time for convivence, SO if you wanted to solve over a range of frequencies you could use scanning and
Angular Frequency = Variable Time; REAL MACT "tx(0) * w"
scanning allows multiple steady state solutions in one sif.
Tom_B
Posts: 27
Joined: 14 Jun 2023, 12:28
Antispam: Yes

Re: I am once again asking for your help.

Post by Tom_B »

Hello Rich and Kevin,

I've been working on a project where I initially tried out the transient study, only to realize that a time variable was unnecessary in my context. I've made some progress, which appears quite promising. Currently, my goal is to expose a metallic sphere to a magnetic dipole field and examine if any multipoles arise using Elmer.

Essentially, I'm looking to calculate the magnetic field generated by a metallic sphere exposed to a dipole field and then compare this with the field of a dipole located at the sphere's center. The key interest is in studying the differences between these two magnetic fields in hopes of finding a multipole.

However, before proceeding further, I thought it would be prudent to confirm the accuracy of the magnetic field computed by Elmer. Hence, I began with a simpler example - a metallic sphere exposed to a harmonic uniform magnetic field. On comparing the numerical and theoretical results, I got some fairly good outcomes, using two metrics for accuracy measurement, which you can see here:
metrics.PNG
metrics.PNG (6.1 KiB) Viewed 519 times
Here are some observations I've made during the process:
  • The accuracy dramatically falls when the value of the magnetic field is extremely low ( < 10**(-6)).
  • As we increase the Background magnetic field, the accuracy improves significantly.
  • Increasing the mesh size also enhances accuracy.
  • We encounter low accuracy values near the axes (where |x|< 10**(-5), same for y and z).
  • Changing the position of the spheres so that they do not intersect the axes seems to help. Here, any point in our geometry has x, y, z greater than an epsilon > 0.
  • I've noticed some outliers in my values, where 99% of the values are between [x1, x2], and some points of the remaining 1% can reach 10**4 x2. These outliers seem to be randomly distributed, or at least I'm yet to identify any geometrical dependencies.
Theoretically, if R denotes the radius of the metallic sphere and d is greater than R, the magnetic field should resemble that of a dipole. The accuracy is quite good for points where d > 3*R, but the values close to the sphere, which interest me the most, do not have satisfactory accuracy. I'm working on optimizing these results by studying the metrics as functions of the BG magnetic field and the mesh density, among other things.

I've attached my code for your review. I would greatly appreciate your expert advice on how to enhance the accuracy of the computations. For solvers, I've mostly used default values or made adjustments according to the Elmer Solver Manual. I'm unsure if I need to introduce any boundary conditions to stabilize my results.

Any tips, tricks, or advice you might have would be invaluable. Thanks in advance for your assistance.

Using the first metric, I calculated the median difference between the numerical and theoretical magnetic fields as a function of radius r. In simpler terms, for all points where d>r, I computed the median difference. To further comprehend the distribution as r changes, I incorporated box plots into my analysis. I excluded the outliers for visual clarity in the figure. It's worth noting, however, that these outliers were so extreme that the mean resided outside the confines of the box plot. In this plot, the x-axis uses 'i' to represent r, where r = 0.0125 + 0.05*i.
metric variation.PNG
(87.47 KiB) Not downloaded yet
Best,

Tom the newbie,
Attachments
Forum.rar
(190.06 KiB) Downloaded 29 times
kevinarden
Posts: 2317
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: I am once again asking for your help.

Post by kevinarden »

Not sure if you have seen this, but the best practices are kept here
https://github.com/ElmerCSC/elmer-elmag
kevinarden
Posts: 2317
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: I am once again asking for your help.

Post by kevinarden »

sphere.PNG
sphere.PNG (34.82 KiB) Viewed 487 times
The mesh of the metal sphere is not really a sphere, all of the nodes like lay on the surface but the element faces do not. This like impacts accuracy of the results. Finer mesh of the ball or quadratic elements (mid-side nodes would be on the sphere) would likely improve results.
kevinarden
Posts: 2317
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: I am once again asking for your help.

Post by kevinarden »

This produces reasonable looking sphere meshes
newsphere.geo
(458 Bytes) Downloaded 31 times
Post Reply