Strange problem with MgDyn-Solver

Numerical methods and mathematical models of Elmer
Post Reply
joosy
Posts: 4
Joined: 25 Apr 2024, 09:34
Antispam: Yes

Strange problem with MgDyn-Solver

Post by joosy »

Dear all,

I'm currently trying to simulate the transient magnetic field and current density of a cylindrical waveguide and noticed something strange. I applied a sinusoidal potential (50 Hz) on the first boundary and ground to the second boundary. Then I used SaveScalar to calculate the current at the boundary. The current is as expected a sinus. Now in Paraview I would expect the magnetic field to rotate once to the left and once to the right, depending on whether the sinus is a positive or negative. But this is not the case. The magnetic field is almost zero during the negative half wave and always rotates to one direction. The current density and the potential (av) are changing as excpected their directions / signs in Paraview. What am I doing wrong?

The mesh was created with Salome. I added the case and the screenshots.

Thanks in advance for the help.

Josef
Attachments
HField_10ms.png
(692.64 KiB) Not downloaded yet
case.sif
(5.44 KiB) Downloaded 14 times
HField_20ms.png
(180.48 KiB) Not downloaded yet
kevinarden
Posts: 2327
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Strange problem with MgDyn-Solver

Post by kevinarden »

Looks OK to me. The magnitude of the magnetic field in Paraview appears to be always a postive number, but the components x, y, z oscillate. I used your sif, but I had to build the mesh.
mag_magnitude.png
(223.73 KiB) Not downloaded yet
mag_components.png
(250.89 KiB) Not downloaded yet
joosy
Posts: 4
Joined: 25 Apr 2024, 09:34
Antispam: Yes

Re: Strange problem with MgDyn-Solver

Post by joosy »

Hi,

I added the Salome-File and removed the mesh. I did a transient simulation with a DC-voltage on its input (2.8923e-04 V) and received approx. 26 A, which matches the theory. But when I add a sinus-function, the H-field-vector is not only in the wrong direction, the magnitude is also nearly 0 A.

One interesting thing this, if I change the waveguide to a normal conductor (material and boundary change in the middle) then everything is correct.

Can this be a mesh problem? Although, I already tried a lot of different meshes ...

Timestep: 1ms
Input voltage: 2.8923e-04*sin(2*pi*50*t)

Waveguide geometry:
Outer radius: ra=0.167 m
Inner radius: ri=0.155 m
Length: l=7.2 m
Attachments
HField_39ms.png
(390.72 KiB) Not downloaded yet
HField_29ms.png
(905.4 KiB) Not downloaded yet
WaveGuideMesh.hdf.zip
(32.15 KiB) Downloaded 6 times
kevinarden
Posts: 2327
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Strange problem with MgDyn-Solver

Post by kevinarden »

My mesh was very different, generally with magdyn the part is placed in a volume of air, preferably a sphere since the far field boundary is tangent to the surface.
farfield.png
(213.26 KiB) Not downloaded yet

cylinder.zip
(14.83 KiB) Downloaded 6 times
If you look at the elmag examples they are generally done this way.

https://github.com/ElmerCSC/elmer-elmag
joosy
Posts: 4
Joined: 25 Apr 2024, 09:34
Antispam: Yes

Re: Strange problem with MgDyn-Solver

Post by joosy »

Thanks, I will try the sphere air volume.
I thought I would help the solver if I use a cylindric air, due to the radial magnetic field. Additionally, I added a very small mesh in the middle due to my small copper thickness (10 mm) in comparison to the big conductor diameter with 330 mm.
joosy
Posts: 4
Joined: 25 Apr 2024, 09:34
Antispam: Yes

Re: Strange problem with MgDyn-Solver

Post by joosy »

Hi again,

last night I tried a lot of things with the sphere, but the results are getting worse than before. One problem is, that I do not really manage it make a fine mesh in the copper-cylinder without getting memory troubles and all other meshing solutions e.g. extrusion 3D, netgen on 2D and 1D wire discretization lead to a bad mesh and totally wrong results.

Then I did a few quick estimations with your geometry data (ri = 50 mm, ra = 100 mm, l = 300 mm): Under these assumptions the stationary current would be approx. 1300 A @ an input voltage of 2.8923e-04 V. What I noticed, is that the magnetic field in your image is too low for the current. On the corner of the wire the H-field should be approx. I / (2 * pi * ra) = 2070 A / m.
Did you also apply the voltage and ground to the circular side or somewhere else?

Another question: How did you manage it to get rid of the air volume in Paraview? Do you use the threshold-filter on the geometry IDs? If I do this with parallel processings then my Paraview crashes. If I use single processing, then it works ...
kevinarden
Posts: 2327
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Strange problem with MgDyn-Solver

Post by kevinarden »

The air volume in paraview can be turned off and one by using the threshold filter, filter on geometry IDs, you can filter to only show the bodies you want to see.

In the run I posted I had put voltage on the outer skin, and ground on the inner skin. I will re-run with voltage on the end.

I tried meshing your geometry and had similar problems. The cylinder is very long and thin, making element ratios difficult.
kevinarden
Posts: 2327
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Strange problem with MgDyn-Solver

Post by kevinarden »

With your geometry it my be best to stick with a cylinder for the air with a mesh similar to Figure 14.1 on page 91
https://www.nic.funet.fi/pub/sci/physic ... orials.pdf
kevinarden
Posts: 2327
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Strange problem with MgDyn-Solver

Post by kevinarden »

I took a cylinder of the same size and meshed it in a sphere of air and a cylinder of air and the results were very different. Same element type and density.
sphereresults.png
(209.81 KiB) Not downloaded yet
cylinderresult.png
(167.9 KiB) Not downloaded yet
Post Reply