I am once again asking for your help.

General discussion about Elmer
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 »

Hey Rich!

Thanks for getting back to me!

I've been using the GMSH library in Python to generate my mesh, and I've attached the code to this message for your reference. I think that the way I'm currently using it might be causing some boundary issues, as each sphere seems to be unaware of the others. Do you have any suggestions on how I can address this problem?

Any help would be greatly appreciated!

Best regards,
Attachments
mesh.txt
(659 Bytes) Downloaded 33 times
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,

Creating a conforming mesh using gmsh has been documented in 'GetStartedElmer.pdf', located here:

https://www.nic.funet.fi/pub/sci/physics/elmer/doc/

See Chapter 9, Section 3, 'Gmsh and Elmer'. Look for 'Fragments' and 'Coherence'.

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

Re: I am once again asking for your help.

Post by kevinarden »

Elmer communicates data between bodies using shared nodes at the boundaries. Many mesh generation programs, like gmsh do not create shared nodes at body boundaries by default. You have to control the mesh at the boundaries, and/or merge coincident nodes. ElmerGrid has a merge option if you use ElmerGrid to convert the mesh to Elmer format.

Sometimes there is a reason to not have a conforming mesh at a boundary between bodies. In these cases Elmer provides mortar boundary conditions to define the desired interaction between the bodies at the boundary.
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 »

Hi!

I wanted to express my gratitude for your valuable assistance! It finally worked, and I couldn't be happier. It took me quite a while to figure it out, but hey, better late than never! The results are incredibly accurate and align with the theoretical predictions in numerous aspects.

Now, I'm planning to take the next step and transition from DC to AC, aiming to generate a time-harmonic magnetic field. This realm is unfamiliar to me, I decided to retain the geometry that worked perfectly in the DC scenario and employ the harmonic version of the WhitneyAVsolver. However, I'm uncertain whether I should incorporate another solver to account for the eddy currents present in my problem. If any of you have any advice or recommendations, I would greatly appreciate it.

I am not interested in representing the eddy currents, but to compute the new magnetic field after adding a metallic sphere. If i do understand the theorical results, i should have in addition to my background magnetic field a dipole magnetic field.

For your convenience, I have attached the complete problem to this message.

Thank you in advance for your kind assistance!

Best regards,
Attachments
AC.rar
(928.68 KiB) Downloaded 33 times
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,

Good to hear there is some progress. Attached is a modified geo file, this one includes the Boolean Fragment command. Boolean Fragment will take both spheres and subtract the small sphere from the large sphere, making the large sphere hollow. It will also keep the small sphere. The Coherence command by itself will not hollow out the large sphere. Try it out and let us know what happens.

To transition from DC to AC, maybe take small steps. Such as frequency = 1 Hz, 10 Hz, 100 Hz, 1000 Hz, and so on, and watch the effect of increasing frequency on your model.

Thanks, Rich.
Attachments
v0-bf.geo
(273 Bytes) Downloaded 31 times
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 »

Hey!

I wanted to reach out and thank you for your assistance. I followed your advice, and things are looking promising. I managed to achieve the right shape, which is great. However, I'm encountering the same magnetic flux density values for both the real (re) and imaginary (im) parts, even when I adjust the frequency. I'm not entirely sure if I made a mistake somewhere or if this is the expected behavior. I've attached two photos showcasing the magnetic field in both DC and AC.

I'm currently working with a time-harmonic magnetic field, where B=B0 exp(-iwt). When I obtain the magnetic flux density in terms of the im/re values (in Paraview), I'm unsure of what it truly represents. Could it be some kind of average value? Please bear with me as my knowledge of electromagnetics is quite limited.

I appreciate your patience and any insights you can provide. Thanks in advance for your help!

Best regards,
Attachments
test.rar
(895.33 KiB) Downloaded 38 times
DC.PNG
DC.PNG (564.59 KiB) Viewed 591 times
AC.PNG
AC.PNG (455.71 KiB) Viewed 591 times
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,

Regarding your question
Could it be some kind of average value?
, you may be seeing the difference between nodal values and element values.

Looking at the list of variables, one is 'Magnetic Flux Density re', and another is ''Magnetic Flux Density re e'. The difference is the small 'e' at the end. Elmer calculates the nodal values of the first variable, and Elmer calculates the elemental values of the second variable. Paraview will 'smear' or average the nodal values, while Paraview will more clearly show the elemental values without being 'smeared' or averaged. I think the recommendation is to use elemental values when there is a jump, such as the jump between air and iron.
variables.png
variables.png (31.47 KiB) Viewed 573 times
Compare the two following screenshots, with 'Surface with Edges' selected. The first one '2-re.png' shows the nodal values, while the second one '4-re e.png' shows the elemental values.
2-re.png
2-re.png (491.84 KiB) Viewed 573 times
4-re-e.png
4-re-e.png (435.05 KiB) Viewed 573 times
Regarding the two screenshots you displayed, if possible, add the legend, it will show the variable name and the range of values.

Your next challenge, should you accept it, will be to add the SaveLine solver and plot the variation of the field versus radius.

Thanks, Rich.
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!

I wanted to express my gratitude for your advice! It was really helpful. I discovered that there were some typos in my .sif file, but after correcting them, I obtained some promising results (the shape is consistently good). I used the SaveLine Solver and plotted the shape, which turned out well. Now, my focus is on determining the precision of the numerical results, and I have a few questions regarding this.

To provide a comprehensive understanding of my problem, let me briefly explain it again. I have two concentric spheres, S1 and S2 (with radii of 0.125 and 1, respectively). S1 represents a vacuum with µ_r=1 and sigma=0, while S2 represents a metal with µ_r=1000 and sigma=1e7. I generated a harmonic-time varying magnetic field with a frequency of 1e4 in S1. Theoretically, I should observe a magnetic moment and consequently a new magnetic field. My aim is to compare these theoretical results with the output obtained from Elmer. Therefore, I need to comprehend the nature of the output generated by Elmer.

As I mentioned earlier, I have a harmonic-time varying magnetic field, which means I should have B = B0 exp(-iwt) and a time-dependent output. However, I obtained B_re and B_im. Does this imply that the resulting magnetic flux density is B_re cos(wt) + i B_im sin(wt)? Or does it have a different interpretation?

Thank you so much for your assistance! Your help is greatly appreciated.

Best regards,

Tom The newbie
Attachments
forum.rar
(894.28 KiB) Downloaded 35 times
kevinarden
Posts: 2317
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: I am once again asking for your help.

Post by kevinarden »

The sif file posted is steady state so there is no variable t. To have a magnetic field that varies with time you need a transient or scanning solution such that you can get the variable t.
Then you could do something like
Magnetization 3 = Variable Time; REAL MATC "tx(0) * 0.01/mu"
Then you would get output for each time step.
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 »

Hi kevin!

I am using (or I believe I am using a quasi-static magnetic field). Therefore, I do not require the time dependence in my output. I simply wish to comprehend the nature of my obtained output. Is it similar to this?
Does this imply that the resulting magnetic flux density is B_re cos(wt) + i B_im sin(wt)? Or does it have a different interpretation?
.
Post Reply