MagnetoDynamics: Source current with StaticConduction, jfix

Clearly defined bug reports and their fixes
Post Reply
Takala
Posts: 186
Joined: 23 Aug 2009, 23:59

MagnetoDynamics: Source current with StaticConduction, jfix

Post by Takala »

Hello,

I have a case where I try to give a divergence free source current to the MagnetoDynamics module. It has the same idea as in tests/mgdynamics_bh. However, it does not converge. But if I give the source current analytically, it does converge.

See the attached test case.

if the body force section is changed from

Code: Select all

Body Force 1
  Name = "Current Density"
 
  Current Density 1 = Variable Coordinate 1, Coordinate 2, Coordinate 3
   Real Procedure "func.so" "currdens1"
  Current Density 2 = Variable Coordinate 1, Coordinate 2, Coordinate 3
   Real Procedure "func.so" "currdens2"
  Current Density 3 = Variable Coordinate 1, Coordinate 2, Coordinate 3
   Real Procedure "func.so" "currdens3"

!  Current Density 1 = Equals Volume current 1
!  Current Density 2 = Equals Volume current 2
!  Current Density 3 = Equals Volume current 3
End
to

Code: Select all

Body Force 1
  Name = "Current Density"
 
!  Current Density 1 = Variable Coordinate 1, Coordinate 2, Coordinate 3
!   Real Procedure "func.so" "currdens1"
!  Current Density 2 = Variable Coordinate 1, Coordinate 2, Coordinate 3
!   Real Procedure "func.so" "currdens2"
!  Current Density 3 = Variable Coordinate 1, Coordinate 2, Coordinate 3
!   Real Procedure "func.so" "currdens3"

  Current Density 1 = Equals Volume current 1
  Current Density 2 = Equals Volume current 2
  Current Density 3 = Equals Volume current 3
End
it does not converge. Otherwise yes.

Is this a bug, or what is going on?

Cheers,

Eelis
Attachments
jfixbug.zip
(1.76 MiB) Downloaded 540 times
mika
Posts: 230
Joined: 15 Sep 2009, 07:44

Re: MagnetoDynamics: Source current with StaticConduction, jfix

Post by mika »

Hi,

I hope that the revision 6355 eventually offers a fix to this issue. The observed convergence problem appears to be related to the part of computation where the user-specified source is computed to be divergence-free via applying the Helmholtz projection to the user-specified source. This computation involves an additional scalar potential Q (known as the field Jfix in Elmer), and the solver has originally employed automated, in-built Dirichlet boundary conditions to constrain Q. Unfortunately, they appear to be risky and may lead to modifying the source even when the original source is already divergence-free. I therefore recommend that setting the automated boundary conditions is disabled and the Dirichlet constraint for Q is specified explicitly in the sif file. The basic rule for specifying the Dirichlet constraint for Q is then that the condition Q=0 should be specified on precisely the same boundaries where the potential field which generates the electric current density is constrained by a Dirichlet condition.

To make the fix effective, you should add a command

Automated Source Projection BCs = Logical False

to the solver section which controls the A-V solver (Solver 2). In addition, add the line

Jfix = real 0.0

to the section Boundary Condition 3, as the potential which generates the electric current density is constrained there (Potential=0 in the sif file).

I also updated the documentation of the A-V solver. For additional details see especially the section "The stationary equations and the Helmholtz projection of a source" on p. 84. as available at

http://www.nic.funet.fi/pub/sci/physics ... Manual.pdf

This is the late first-aid fix to the observed difficulty. Perhaps the way to set the automated, in-built Dirichlet boundary conditions for the potential Q should be changed in future such that the automated constraints are physically sound and less risky.

Thanks for reporting,
Mika
mika
Posts: 230
Joined: 15 Sep 2009, 07:44

Re: MagnetoDynamics: Source current with StaticConduction, jfix

Post by mika »

Hi,

The revision r6362 contain an additional fix and may work better.

- Mika
Takala
Posts: 186
Joined: 23 Aug 2009, 23:59

Re: MagnetoDynamics: Source current with StaticConduction, jfix

Post by Takala »

Excellent! thanks a lot Mika for the exhaustive and clear explanation and of course for the fix!!

I didn't see this before now. Due to lack of time, haven't been to the forum since a long time....


-Eelis
Takala
Posts: 186
Joined: 23 Aug 2009, 23:59

Re: MagnetoDynamics: Source current with StaticConduction, jfix

Post by Takala »

Mika, very nice work with the documentation! I like it, the punctuality, bravo!

-Eelis
jtapas3761
Posts: 8
Joined: 16 Jul 2018, 10:17
Antispam: Yes

Re: MagnetoDynamics: Source current with StaticConduction, jfix

Post by jtapas3761 »

Hi

I made the changes you suggested but i still get numerical error : IterSolve: System diverged over tolerance
Attachments
hgf.PNG
hgf.PNG (23.99 KiB) Viewed 6145 times
jtapas3761
Posts: 8
Joined: 16 Jul 2018, 10:17
Antispam: Yes

Re: MagnetoDynamics: Source current with StaticConduction, jfix

Post by jtapas3761 »

Can anyone give a clue of what might be going wrong and what else i can do ?
Post Reply