Electric dipole. Convergence problem.

Numerical methods and mathematical models of Elmer
Post Reply
Rick85
Posts: 6
Joined: 26 Jan 2024, 13:05
Antispam: Yes

Electric dipole. Convergence problem.

Post by Rick85 »

Hi,
I'm a new Elmer user and I'm trying to model an electric dipole using the WhitneyAVHarmonicSolver with f = 50 Hz. I got stuck with convergence problems and strange results and I hope to find some help here.
I have used Salome+NETGEN for the mesh and ElmerGui for setting up the sif-file. The mesh was converted via "ElmerGrid 8 2 Mesh.unv -autoclean".

First, I made a model with two spheres ("electrodes") emerged in "water" of electrical conductivity 1 S/m. I set the boundary conditions on the spheres to constant potentials of +1 and -1:

Boundary Condition 2
Target Boundaries(1) = 4
Name = "VoltagePlus"
AV re {e} 3 = 0
AV re = 1
AV re {e} 1 = 0
AV im {e} = 0
AV re {e} = 0
AV im = 0
AV re {e} 2 = 0
AV im {e} 1 = 0
AV im {e} 3 = 0
AV im {e} 2 = 0
End

Boundary Condition 3
Target Boundaries(1) = 5
Name = "VoltageMinus"
AV im {e} 3 = 0
AV re {e} = 0
AV re = -1
AV im {e} 1 = 0
AV re {e} 2 = 0
AV im = 0
AV re {e} 1 = 0
AV re {e} 3 = 0
AV im {e} = 0
AV im {e} 2 = 0
End

On the outer Boundary box I set this condition:

Boundary Condition 1
Target Boundaries(6) = 1 2 3 6 7 8
Name = "Farfield"
AV re {e} = 0
AV im {e} = 0
End

I'm not sure if the above boundary conditions are the correct ones to use? Ideally, I think it the condition on the outer box should have been a PML boundary. I guess that the outer boundary condition I use may cause some problem when the conductivity is finite?

The result looks very strange at 1 S/m and also when I reduce the conductivity to 1e-2 S/m. The problem seems to be related to the conductivity of the water, because when I reduce the water conductivity to 1e-5 S/m the results looks more reasonable. Here are the results at 1e-2 S/m and 1e-5 S/m:
electricfield_cond1e-2.png
(400.63 KiB) Not downloaded yet
electricfield_cond1e-5.png
(458.82 KiB) Not downloaded yet

In my second case the boundary conditions on the electrode spheres was replaced by "AV Loads" at the target coordinates corresponding to the center of each sphere:

Boundary Condition 2
Target Coordinates(1,3) = Real 2400 2500 2500
AV re Load = Real 1.0
End

Boundary Condition 3
Target Coordinates(1,3) = Real 2600 2500 2500
AV re Load = Real -1.0
End

For this case I did not get convergence with the water conductivity I wanted to use (1 S/m). However, if I reduced the conductivity to 1e-7 S/m the solver converged. Does anybody know why the conductivity has to be lowered for convergence and is there some fix for this? Is the issue that I need a finer mesh due to the conductivity or something else?
I assume that the mesh size needs to be lower than the skin depth, which is 71 meters for 50 Hz at conductivity 1 S/m, but I don't think that it explains why I had to reduce the conductivity so much (to 1e-7 S/m) to get convergence. Here is the resulting E-field at 1e-7 S/m.
electricfield_AVloads.png
electricfield_AVloads.png (269.95 KiB) Viewed 257 times

The input files are uploaded here: https://github.com/CJRicky/elmerfem_electricdipole
Note that in the second case the sif-file was modified outside ElmerGUI so the project-file "egproject.xml" is not up to date, since (I think) that the GUI does not support adding a potential load? Anyway, the files on git should run with ElmerSolver.
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Electric dipole. Convergence problem.

Post by raback »

Hi

Maybe it is an issue with the vector potential. You cannot use ILU as it is not uniquely defined. Try changing these:

Code: Select all

  Linear System Iterative Method = BiCGStab
  Linear System Max Iterations = 500
  BiCGstabl polynomial degree = 2
  Linear System Preconditioning = ILU0
To these, e.g.

Code: Select all

  Linear System Iterative Method = BiCGStabl
  Linear System Max Iterations = 1000
  BiCGstabl polynomial degree = 4
  Linear System Preconditioning = none
-Peter
Rick85
Posts: 6
Joined: 26 Jan 2024, 13:05
Antispam: Yes

Re: Electric dipole. Convergence problem.

Post by Rick85 »

Thank you Peter, for pointing out that ILU should not be used. I changed my sif-files according to your suggestion. Still I do not obtain convergence for the Point Load case when I try to increase the "water" electrical conductivity from 1e-7 to 1e-4 S/m. And the case with potential set on the surfaces of the electrodes converges but the result is not correct, for example at conductivity 1e-2 the electric field looks like this:
efield_noILU.png
(730.66 KiB) Not downloaded yet
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Electric dipole. Convergence problem.

Post by raback »

Hi

I looked quickly on the 1st case. Converges ok for me. Is the frequency relevant or could you solve this as pure current condution problem?

I missed that this was harmonic. For that actually ILU works fine, but not for the magnestatic case.

Attached is sif file with some modifications.

-Peter
Attachments
case2.sif
(2.55 KiB) Downloaded 7 times
Rick85
Posts: 6
Joined: 26 Jan 2024, 13:05
Antispam: Yes

Re: Electric dipole. Convergence problem.

Post by Rick85 »

Hi,

Thank you. Yes the frequency is relevant. I have an experiment where I know the current drawn by the electrodes in the water. The frequency is varied from case to case.

I ran your sif-file (Thank you!). The results are good at 1e-5 S/m. At 1e-3 S/m they might be good near the electrodes (I need to check the results a bit more), but at 1e-2 the electric field no longer looks like a dipole. I think this might be mesh-related and I will try to improve my mesh. I recall from Opera FEM software that they recommend using at most skindepth/3 as the mesh size with their harmonic solver. Can we assume it is similar in Elmer? In my mesh used 150 m as the largest mesh size and at 50 Hz and 1e-2 S/m the skin depth is 700 m, which perhaps is too close to the mesh size. I think it may also help to put my outer boundary far away from the area of interest, which is around the electrodes.

Result at conductivity 1e-3:
electricfield_cond1e-3.png
(459.96 KiB) Not downloaded yet
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Electric dipole. Convergence problem.

Post by raback »

Hi

Indeed, the farfield seems the get nonsymmetric with frequency. I added scanning over electric conductivity to study this. Sif attached.

My guess is that when electric conductivity gets larger the outer BCs for electric scalar potential start to have their own fun. Maybe the natural BCs are not any more ok. When I replaced them with homogeneous Dirichlet condition things start to look symmetric again. I guess one should go through the case and study what BCs to ideally have.

Ultimately the initial disturbance for the asymmetry may lie in the mesh. However, it is impractical to demand fully symmetric meshes.

-Peter
Attachments
case3.sif
(3.47 KiB) Downloaded 14 times
Rick85
Posts: 6
Joined: 26 Jan 2024, 13:05
Antispam: Yes

Re: Electric dipole. Convergence problem.

Post by Rick85 »

Hi, I think the attached file is not the file you intended to attach? I looks like my original file. Sounds like a good idea with homogeneous Dirichlet. I'm eager to try it out myself.
Thanks!
Rick85
Posts: 6
Joined: 26 Jan 2024, 13:05
Antispam: Yes

Re: Electric dipole. Convergence problem.

Post by Rick85 »

Hi

I changed the outer boundary condition from:

AV re {e} = 0
AV im {e} = 0

to:

AV re = 0
AV im = 0

The resulting E-field looks more symmetric, see the attached. Is this the same boundary condition and result that you saw Peter?
The solver never converged below 0.5e-4 when I used the new boundary condition. Any thoughts on why that is and how I fix this? I used the file case2.sif attached in Peter's post above and just changed the outer boundary condition.
Efield_cond1e-3_BdryAV0.png
Efield_cond1e-3_BdryAV0.png (400.49 KiB) Viewed 121 times
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Electric dipole. Convergence problem.

Post by raback »

Hi,

You should have both BCs at the same time.

VarName = Real ! nodal dofs (H0)
VarName {e} = Real ! refers to edge dofs (Hcurl)
VarName {f} = Real ! refers to face dofs (Hdiv)

So "AV" has both the scalar (H0) and vector (Hcurl) potential in the same field.

-Peter
Post Reply