Closed coil with core simulation

Numerical methods and mathematical models of Elmer
raback
Site Admin
Posts: 4827
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Closed coil with core simulation

Post by raback »

Hi

Maybe this will help to understand some weirdness of the solver: The "AV" variable is such that vector potential lives on edges (Hcurl space) and scalar potential lives on nodes (H1 space). It is a convention of Elmer that you can request elements with suitable degrees of freedom. The defintion for the lowest order AV solver would be "Element = n:1 e:1" i.e. one dof on node, and one on edge (it is hidded from end-user).

Now, you can only visualize nodal fields (or cell values, but that's another story). Therefore for visualization there is nothing on the solution for the edges. Instead you need to map it from edge field to nodal field. There the CalcFields routine has even keyword "Calculate Magnetic Vector Potential = True'" which does not make sense unless you understand that it asks to map the from Hcurl to H1.

To complicate things when giving Dirichlet BCs the library functionality assigns the default name to the nodal field, whereas you need to use {e} for edge field. So

Code: Select all

  AV = 0.0      ! sets electric scalar potential to zero
  AV {e} = 0.0 ! sets magnetic vector potential to zero
Hope this helps.

-Peter
Cedric54
Posts: 17
Joined: 13 Jan 2020, 15:14
Antispam: Yes

Re: Closed coil with core simulation

Post by Cedric54 »

Hello Peter and Kevin,

Peter thanks for clarifying the BCs on AV.

I'm struggling on my problem to close the loop...
I began to use coilsolver but I'm not sure if I can use it in my case: the coil is a cylinder and I want a constant current inside.
In the coilsolver dialog box, I checked the case "closed loop", defined the desired coil current=1000.
In the body force I added "Equals CoilCurrent i" and the result is:

CoilSolver: Assuming coil that is not closed
ERROR:: CoilSolver: > Coil Start < must be defined on some BC

Elmer seems to ask me the beginning and the end of the coil.....

See my file here:

https://www.transfernow.net/61lc4973j7dx

Where am I wrong?

Maybe coilsolver cannot be used for my specific case and I have to impose current density in my coil?

Trying this, I impose current density in my cylinder (body 3) with these formulas:

Current Density 1=variable coordinate ;Real MATC "2000*10*tx(0)/(sqrt(tx(0)*tx(0)+tx(1)*tx(1)))/(1e-2*10e-2)";

Current Density 2=variable coordinate ;Real MATC "2000*10*tx(1)/(sqrt(tx(0)*tx(0)+tx(1)*tx(1)))/(1e-2*10e-2)";

Current Density 3=0

I believe that with these formulas the module of the current density was constant in the plane x, y .

The result is the field line are concentric....so I suppose that the current is not circular but flow in the heigth of the cylinder....

Hope I'am clear...

Any ideas to get current to be circular?

My file is here:

https://www.transfernow.net/13ags8a5slg0

Thanks for your help.

Cédric.
kevinarden
Posts: 2310
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Closed coil with core simulation

Post by kevinarden »

For the coilsolver the checkbox did not work these lines should have appeared in solver 3

Coil Closed = Logical true
Calculate Coil Current = Logical True
Desired Coil Current = Real 1000

I added them manually to the sif and there is a coil current x,y and z calculated.
Cedric54
Posts: 17
Joined: 13 Jan 2020, 15:14
Antispam: Yes

Re: Closed coil with core simulation

Post by Cedric54 »

Hello Kevin,

I've added the three lines in the .sif and you're right, elmer calculates now the current in the coil but the current in the coil is not continuous,

there is only some points at 3700A, do you see the same problem on your simulation? (also my magnetic field is at zero)

I see also this in the log file:

ComputeChange: NS (ITER=2) (NRM,RELC): ( 0.65804479 0.16585769E-02 ) :: coilsolver
WARNING:: CoilSolver: Positive and negative sums differ too much!
CoilSolver: Initial coil current for coil 1: 2.2286E+06
CoilSolver: Coil potential multiplier: 4.4871E-07

I joined to this mail my .sif and a view of the current...

Thanks.
Attachments
case.sif
(5.38 KiB) Downloaded 242 times
coilcurrent.jpg
coilcurrent.jpg (25.67 KiB) Viewed 4562 times
kevinarden
Posts: 2310
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Closed coil with core simulation

Post by kevinarden »

Yes I have seen the same problems. We now get current and in paraview you can view the x, y, z, and magnitude. However the current density and magnetic field is zero. I have tried several different things but no success. So far turning the current into magnetic force fields has not been successful.

WARNING:: CoilSolver: Positive and negative sums differ too much! I believe this goes away in later iterations. I increased the minimum number of iterations and only output the last one. Did this by: Output Intervals = 0 outputs the last itteration.

Steady State Max Iterations = 10
Steady State Min Iterations = 5
Output Intervals = 0
kevinarden
Posts: 2310
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Closed coil with core simulation

Post by kevinarden »

These parameters made the coil current continuous and seemed to make it go around the coil but the jfix and current density is still zero


Coil Closed = Logical true
Desired Coil Current = Real 100
Normalize Coil Current = Logical True
Coil Normal(3) = 0 0 1
Cedric54
Posts: 17
Joined: 13 Jan 2020, 15:14
Antispam: Yes

Re: Closed coil with core simulation

Post by Cedric54 »

Hello,

Coming back to this post to try to close it....

Finally I decide to have a real coil with wire it's difficult to modelized in 3D but I succeed to do it with GMSH....

So now I have three domains : air, iron and copper of the wire....

Elmer succeed to solver current, magnetic field strength and magnetic flux density all this with linear relative permeability of iron at 2000.

My questions are:

1) Could you please confirm the unity of magnetic field strength (supposed to be A/m?) and magnetic flux density (Tesla/m² ????)

2) Then when I see the solution on paraview the field seems to avoid the iron piece as I can't see any field in iron. Where I made a mistake?

3) I try to put HB curve, I succeed finally that Elmer accept HB curve, after hours to understand parser I added the following line, spaces seems

to be important (I see the posts on parser), hope it would be useful for readers:

Variable coupled iter;real Monotone Cubic Include HB.txt; End

Elmer accept this formula but Mgdynpost doesn't succeed to solve magnetic field strength, there are NaN in solver log and paraview cannot view magnetic field strength...

Whole simulation is here:

https://www.transfernow.net/11c594j6s774

4) Concerning the force, my goal is to calculate whole force on iron in z direction (body 2). To do this a added a equation called "force" that solves magnetic field on body 2 and I add scalar solver to output Nodal force 1, 2 and 3, do I have to understand that Nodal force 1, 2 and 3 represents WHOLE force in x, y and z direction?

5) If not, how can I have the whole force on body 2 that is an integrated force over surface of body 2?

Thanks for help.

Cédric.
Attachments
Solver.log
(37.21 KiB) Downloaded 249 times
field strength with linear relative permeability.jpg
(117.18 KiB) Not downloaded yet
Cedric54
Posts: 17
Joined: 13 Jan 2020, 15:14
Antispam: Yes

Re: Closed coil with core simulation

Post by Cedric54 »

Hello,

Somebody could help me on my last questions ?

Thanks a lot!

Regards.
ftrillaudp
Posts: 42
Joined: 23 May 2012, 05:26
Antispam: Yes

Re: Closed coil with core simulation

Post by ftrillaudp »

Dear all,

I have been trying for a month to solve a similar problem, a coil on an iron core surrounded by air. The log file does not show any warning message or error but it seems that the magnetic field is not computed from th reimposed current into the closed coil. Indeed, changing the current density does not produce any changes in the results.

Here I am joining the mesh and case file as well as the log file in the attached zip folder. I provide the case.sif file below.

Best regards,

Frederic
ClosedCoilWithIron.zip
(776.5 KiB) Downloaded 293 times
Header
CHECK KEYWORDS Warn
Mesh DB "." "assembly"
Results Directory "Results"
End

Simulation
Coordinate System = "Cartesian 3D"
Coordinate Mapping(3) = 1 2 3

Simulation Type = Steady
Steady State Max Iterations = 1

Max Output Level = 6
End

Constants
Gravity(4) = 0 0 -1 9.82
Stefan Boltzmann = 5.67e-08
Permittivity of Vacuum = 8.8542e-12
Boltzmann Constant = 1.3807e-23
Unit Charge = 1.602e-19
End

! -- BODIES --
Body 1
Name = "SOL001"
Target Bodies(1) = 1
Equation = 2
Material = 1
Body Force = 1
End

Body 2
Name = "SOL002"
Target Bodies(1) = 2
Equation = 1
Material = 3
End

Body 3
Name = "SOL003"
Target Bodies(1) = 3
Equation = 1
Material = 2
End

! -- MATERIAL PROPERTIES --
Material 1
Name = "Conductor"
Relative Permeability = 1.0
Relative Permittivity = 1.0
Electric Conductivity = 1.0
End

Material 2
Name = "Air"
Relative Permeability = 1.0
Relative Permittivity = 1.0
End

Material 3
Name = "Iron"
Relative Permeability = 1000.0
Relative Permittivity = 1.0
End

! -- COMPONENTS --
Component 1
Name = String "Coil1"
Coil Type = String "test"
Master Bodies(1) = Integer 1
Desired Current Density = Real 1e7
End

! -- BODY FORCE --
Body Force 1
Name = "Source"
Current Density 1 = Equals "CoilCurrent e 1"
Current Density 2 = Equals "CoilCurrent e 2"
Current Density 3 = Equals "CoilCurrent e 3"
End

!-- BOUNDARY CONDITIONS --
Boundary Condition 1
Name = "FAC003"
Target Boundaries(1) = 6
AV {e} = real 0
AV = real 0
Jfix = real 0.0
End

!-- EQUATIONS --
Equation 1
Name = "MGDyn for air"
Active Solvers(2) = 2 3
End

Equation 2
Name = "MGDyn for coils"
Active Solvers(3) = 1 2 3
End

!-- SOLVERS --
Solver 1
Equation = "CoilSolver"

Procedure = "CoilSolver" "CoilSolver"

Linear System Solver = "Iterative"
Linear System Preconditioning = ILU1
Linear System Max Iterations = 1000
Linear System Convergence Tolerance = 1e-10
Linear System Iterative Method = BiCGStab
Linear System Residual Output = 10
Steady State Convergence Tolerance = 1e-06

Normalize Coil Current = Logical True
Nonlinear System Consistent Norm = Logical True
Coil Closed = Logical True
Narrow Interface = Logical True
Save Coil Set = Logical True
Save Coil Index = Logical True
Calculate Elemental Fields = Logical True

!Coil Center(3) = Real ...
Coil Normal(3) = Real 0. 0. 1.
End

Solver 2
Equation = MGDynamics
Procedure = "MagnetoDynamics" "WhitneyAVSolver"
Variable = AV

Fix Input Current density = True

Steady State Convergence Tolerance = 1.0e-5
Nonlinear System Max Iterations = 1

Linear System Solver = iterative
Linear System Iterative Method = BiCGStabl

Linear System GCR Restart = 100
BiCGStabl Polynomial Degree = 6
Idrs Parameter = Integer 6

Linear System Robust = Logical True

Linear System Max Iterations = 1000
Linear System Convergence Tolerance = 1.0e-8
Linear System Preconditioning = none
Linear System Residual Output = 1
Linear System Abort Not Converged = False

Linear System Row Equilibration = Logical True
Nonlinear System Consistent Norm = Logical True
End

Solver 3
Equation = MGDynamicsCalc
Procedure = "MagnetoDynamics" "MagnetoDynamicsCalcFields"
Potential Variable = String "AV"

Steady State Convergence Tolerance = 1.0e-5
Nonlinear System Convergence Tolerance = 1.0e-8
Nonlinear System Max Iterations = 20
Nonlinear System Newton After Iterations = 3
Nonlinear System Newton After Tolerance = 1.0e-3
Nonlinear System Relaxation Factor = 1

Linear System Solver = Iterative
Linear System Symmetric = True
Linear System Iterative Method = CG
Linear System Max Iterations = 5000
Linear System Convergence Tolerance = 1.0e-8
Linear System Preconditioning = ILU0
Linear System ILUT Tolerance = 1.0e-3
Linear System Abort Not Converged = False
Linear System Residual Output = 1
Linear System Precondition Recompute = 1

Nonlinear System Consistent Norm = Logical True
Discontinuous Bodies = True

Calculate Current Density = True
Calculate Magnetic Field Strength = True
Calculate Maxwell Stress = True
Calculate Elemental Fields = True
End

Solver 4
Exec Solver = after all
Equation = "ResultOutput"
Procedure = "ResultOutputSolve" "ResultOutputSolver"
Output File Name = case
Vtu format = Logical True
Binary Output = True
Discontinuous Bodies = Logical True
Save Geometry Ids = True
End
kevinarden
Posts: 2310
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Closed coil with core simulation

Post by kevinarden »

I downloaded it and ran it as is, seems to work fine.
magnetic field.png
(179.11 KiB) Not downloaded yet
Post Reply