I'm working on the following problem:

I have a system which is represented by two adjacent coils (the surface they enclose lay on the same plane and the coils don't touch each other, see picture below) in free space.

Each coil carries a known constant current and the currents in the coils are not equal.

I need to calculate the total magnetic energy of the system.

To do so I have used in the following strategy:

I have created two stat current solvers (one for each coil, each solver impose the desired current). The current so calculated is then fed to the magdyn and magdycalc solver via body force.

The sif file can be seen below. In theory this should work (at least in my mind ), however, when I run ElmerSolver (both on Elmer 8.3 and 8.4) the simulation fails miserably (see attached file).

The mesh file can be found here

https://www.dropbox.com/s/rz82f4brzbum ... .zip?dl=0

Can anyone help me find out what am I doing wrong?

Many thanks,

Marco

Code: Select all

```
!!------ Skeleton for body section -----
!Body 1 = air
!Body 2 = trace 1
!Body 3 = trace 2
!------ Skeleton for boundary section -----
!BC1 = Current in coil 1
!BC2 = Current out coil 1
!BC3 = Current in coil 2
!BC4 = Current out coil 2
!BC5 = Air_BC (external air, where vector potential is assumed to be 0)
! All coils excited
Header
Check Keywords "Warn"
Mesh DB "." "adjacent_open_coil_V01"
Include Path ""
Results Directory ""
End
Simulation
Coordinate System = Cartesian
Coordinate Mapping(3) = 1 2 3
! Coordinate Scaling=0.001
Simulation Type = Steady
Steady State Max Iterations = 1
End
Constants
Gravity(4) = 0 -1 0 9.82
Stefan Boltzmann = 5.67e-08
Permittivity of Vacuum = 8.8542e-12
Boltzmann Constant = 1.3807e-23
Unit Charge = 1.602e-19
End
Body 1
Target Bodies(1) = 1
Name = "Air"
Equation = 1
Material = 1
End
Body 2
Target Bodies(1) = 2
Name = "Coil 1"
Equation = 2
Material = 2
Body Force = 1
End
Body 3
Target Bodies(1) = 3
Name = "Coil 2"
Equation = 3
Material = 2
Body Force = 2
End
Material 1
Name = "Air (room temperature)"
Viscosity = 1.983e-5
Heat expansion Coefficient = 3.43e-3
Heat Conductivity = 0.0257
Sound speed = 343.0
Density = 1.205
Heat Capacity = 1005.0
Relative Permittivity = Real 1
Relative Permeability = Real 1
Electric Conductivity = Real 0
End
Material 2
Name = "Copper (generic)"
Heat expansion Coefficient = 16.5e-6
Heat Conductivity = 401.0
Sound speed = 3810.0
Heat Capacity = 385.0
Density = 8960.0
Mesh Poisson ratio = 0.34
Poisson ratio = 0.34
Youngs modulus = 115.0e9
Relative Permittivity = Real 1
Relative Permeability = Real 1
Electric Conductivity = Real 5.96e7
End
Equation 1
Name = "Equation for air"
Active Solvers(2) = 3 4
End
Equation 2
Name = "Equation for coil 1"
Active Solvers(3) = 1 3 4
End
Equation 2
Name = "Equation for coil 2"
Active Solvers(3) = 2 3 4
End
Solver 1
! Exec Solver = before all !Always
Equation = solving coil 1
Calculate Volume Current = True
Procedure = "StatCurrentSolve" "StatCurrentSolver"
Current Control = 40
Variable = Potential_1
Stabilize = True
Bubbles = False
Lumped Mass Matrix = False
Optimize Bandwidth = True
Steady State Convergence Tolerance = 1.0e-5
Nonlinear System Convergence Tolerance = 1.0e-7
Nonlinear System Max Iterations = 1
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 Iterative Method = TFQMR
Linear System Iterative Method = GC
! Linear System Iterative Method = GCR
! Linear System Iterative Method = BiCGStab
! Linear System Iterative Method = BiCGStab2
! Linear System Iterative Method = BiCGStabl
! BicGStabL Polynomial Degree = 4
Linear System Max Iterations = 15000
Linear System Convergence Tolerance = 1.0e-10
! Linear System Preconditioning = Diagonal
! Linear System ILUT Tolerance = 1.0e-3
Linear System Abort Not Converged = False
! Linear System Residual Output = 1
! Linear System Precondition Recompute = 1
End
Solver 2
! Exec Solver = before all !Always
Equation = solving coil 2
Calculate Volume Current = True
Procedure = "StatCurrentSolve" "StatCurrentSolver"
Current Control = 10
Variable = Potential_2
Stabilize = True
Bubbles = False
Lumped Mass Matrix = False
Optimize Bandwidth = True
Steady State Convergence Tolerance = 1.0e-5
Nonlinear System Convergence Tolerance = 1.0e-7
Nonlinear System Max Iterations = 1
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 Iterative Method = TFQMR
Linear System Iterative Method = GC
! Linear System Iterative Method = GCR
! Linear System Iterative Method = BiCGStab
! Linear System Iterative Method = BiCGStab2
! Linear System Iterative Method = BiCGStabl
! BicGStabL Polynomial Degree = 4
Linear System Max Iterations = 15000
Linear System Convergence Tolerance = 1.0e-10
! Linear System Preconditioning = Diagonal
! Linear System ILUT Tolerance = 1.0e-3
Linear System Abort Not Converged = False
! Linear System Residual Output = 1
! Linear System Precondition Recompute = 1
End
!===============================================
!=========== MAGNETIC FIELD SOLVER =============
Solver 3
! Exec Solver = Never
Equation = "MGDynamics"
Variable = P
Procedure = "MagnetoDynamics" "WhitneyAVSolver"
Fix Input Current Density = Logical True
! Linear System Symmetric = True
! Optimize Bandwidth = True
Steady State Convergence Tolerance = 1e-09
Nonlinear System Convergence Tolerance = 1.0e-8
Nonlinear System Max Iterations = 1
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 Iterative Method = TFQMR
! Linear System Iterative Method = GC
! Linear System Iterative Method = GCR
! Linear System Iterative Method = BiCGStab
! Linear System Iterative Method = BiCGStab2
! Linear System Iterative Method = BiCGStabl
! BicGStabL Polynomial Degree = 4
! Linear System Preconditioning = none
! Linear System Preconditioning = ILU2
! Linear System ILUT Tolerance = 1.0e-3
! Linear System Precondition Recompute = 1
! Linear System Residual Output = 20
! Linear System Residual Output = 1
Linear System Max Iterations = 1400 !5000
Linear System Convergence Tolerance = 1.0e-8
Linear System Abort Not Converged = False
! Edge Basis = Logical True
! Apply Mortar BCs = Logical True
! Mortar BCs additive = True
End
Solver 4
! Exec Solver = Never
Equation = "MGDynamicsCalc"
Procedure = "MagnetoDynamics" "MagnetoDynamicsCalcFields"
Potential Variable = P
Calculate Current Density = Logical True
! Calculate Electric Field = Logical True
! Calculate Magnetic Field Strength = Logical True
Calculate Magnetic Field Density = Logical True
Steady State Convergence Tolerance = 1e-09
Linear System Solver = "Iterative"
! Linear System Iterative Method = CG
Linear System Iterative Method = BiCGStab
Linear System Max Iterations = 5000
Linear System Convergence Tolerance = 1.0e-8
End
Solver 5
! Equation = Result Output
! Exec Solver = Never
Procedure = "ResultOutputSolve" "ResultOutputSolver"
Binary Output = True
Output Format = vtu
Output File Name = results
End
Solver 6
! Equation = "scalars"
! Exec Solver = Never
procedure = "SaveData" "SaveScalars"
Filename = "data_scalars.dat"
End
Boundary Condition 1
Target Boundaries(1) = 5
Name = "Outer space"
P {e}= real 0
End
Boundary Condition 2
Target Boundaries(1) = 1
Name = "Coil 1 current in"
Potential_1 = real 0.05
End
Boundary Condition 3
Target Boundaries(1) = 2
Name = "Coil 1 current out"
Potential_1 = real 0
End
Boundary Condition 4
Target Boundaries(1) = 3
Name = "Coil 1 current in"
Potential_2 = real 0.05
End
Boundary Condition 5
Target Boundaries(1) = 4
Name = "Coil 2 current out"
Potential_2 = real 0
End
Body Force 1
Name = "Coil 1 Current Density"
Current Density 1 = Equals Volume current 1
Current Density 2 = Equals Volume current 2
Current Density 3 = Equals Volume current 3
End
Body Force 2
Name = "Coil 2 Current Density"
Current Density 1 = Equals Volume current 1
Current Density 2 = Equals Volume current 2
Current Density 3 = Equals Volume current 3
End
```