Wire Harmonic Current Derived Values Accuracy

Numerical methods and mathematical models of Elmer
Post Reply
tylerm
Posts: 5
Joined: 09 Jan 2023, 19:00
Antispam: Yes

Wire Harmonic Current Derived Values Accuracy

Post by tylerm »

Hi everyone,

I'm working with the mgdyn_harmonic_wire(https://github.com/ElmerCSC/elmerfem/tr ... monic_wire) test case (updated to use DG and disregard nodal fields) and I'm running into some difficulties extracting accurate properties from the model, specifically inductance. The current I get is spot on (1.86e2), but when I try to calculate the magnetic energy using E=1/2*L*I^2 from the analytically derived inductance (4.686nH), the error between the value derived from the analytic solution ( 81.1uJ) and the output value from MagnetoDynamicsCalcFields (63.88uJ) is >20%, which is much larger than I'd expect. I fear I'm missing something terribly obvious, but I can't figure out the issue for the life of me. Any assistance would be immensely appreciated.

Code: Select all

Header
  CHECK KEYWORDS Warn
  Mesh DB "." "."
  Include Path ""
  Results Directory ""
End

Simulation
  Max Output Level = 5
  Coordinate System = Cartesian
  Coordinate Mapping(3) = 1 2 3
  Simulation Type = Steady state
  Steady State Max Iterations = 1
  Output Intervals(1) = 1
  Coordinate Scaling = 1.0e-3
  Angular Frequency = 1
  Solver Input File = case.sif
  Post File = case.vtu
End

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

Body 1
  Target Bodies(1) = 1
  Name = "Body Property 1"
  Equation = 1
  Material = 1
End

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

Solver 1
  Equation = MgHarm
  Procedure = "MagnetoDynamics" "WhitneyAVHarmonicSolver"
  Exec Solver = Always
  Stabilize = True
  Optimize Bandwidth = True
  Steady State Convergence Tolerance = 1.0e-8
  Nonlinear System Convergence Tolerance = 1.0e-7
  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 Iterative Method = BiCGStabl
  Linear System Max Iterations = 5000
  Linear System Convergence Tolerance = 1.0e-10
  BiCGstabl polynomial degree = 4
  Linear System Preconditioning = Diagonal
  Linear System ILUT Tolerance = 1.0e-3
  Linear System Abort Not Converged = False
  Linear System Residual Output = 10
  Linear System Precondition Recompute = 1
End

Solver 2
  Equation = MgDynPost
  Calculate Current Density = True
  Calculate Joule Heating = True
  Procedure = "MagnetoDynamics" "MagnetoDynamicsCalcFields"
  Calculate Electric Field = True
  Calculate Magnetic Field Strength = True
  Discontinuous Galerkin = True
  Exec Solver = Always
  Stabilize = True
  Optimize Bandwidth = True
  Steady State Convergence Tolerance = 1.0e-5
  Nonlinear System Convergence Tolerance = 1.0e-7
  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 Iterative Method = BiCGStabl
  Linear System Max Iterations = 5000
  Linear System Convergence Tolerance = 1.0e-12
  BiCGstabl polynomial degree = 2
  Linear System Preconditioning = none
  Linear System ILUT Tolerance = 1.0e-3
  Linear System Abort Not Converged = False
  Linear System Residual Output = 10
  Linear System Precondition Recompute = 1
End

Solver 3
  Equation = SaveScalars
  Operator 3 = boundary int
  Operator 1 = boundary int
  Variable 5 = av im
  Variable 1 = current density
  Operator 5 = boundary mean
  Variable 2 = current density re 3
  Operator 4 = boundary mean
  Operator 2 = boundary int
  Variable 3 = current density im 3
  Filename = scalars.dat
  Variable 4 = av re
  Procedure = "SaveData" "SaveScalars"
  Exec Solver = Always
End

Equation 1
  Name = "MgHarm"
  Active Solvers(3) = 1 2 3
End

Material 1
  Name = "Copper (generic)"
  Electric Conductivity = 59.59e6
  Heat expansion Coefficient = 16.5e-6
  Density = 8960.0
  Heat Conductivity = 401.0
  Relative Permeability = 1
  Relative Permittivity = 1
  Electric Conductivity = 59.59e6
  Relative Permeability = 0.999994
  Sound speed = 3810.0
  Electric Conductivity = 59.59e6
  Poisson ratio = 0.34
  Youngs modulus = 115.0e9
  Heat Capacity = 385.0
End

Material 2
  Name = "Air (room temperature)"
  Density = 1.205
  Electric Conductivity = 1e-12
  Viscosity = 1.983e-5
  Relative Permittivity = 1.00059
  Relative Permittivity = 1.00059
  Heat expansion Coefficient = 3.43e-3
  Electric Conductivity = 1e-12
  Relative Permeability = 1
  Heat Conductivity = 0.0257
  Heat Capacity = 1005.0
  Sound speed = 343.0
  Relative Permeability = 1.00000037
End

Boundary Condition 1
  Target Boundaries(1) = 1 
  Name = "Ground"
  Save Scalars = True
  AV im = 0
  AV re {e} = 0
  AV im {e} = 0
  AV re = 0
  AV {e} = 0
End

Boundary Condition 2
  Target Boundaries(1) = 3 
  Name = "Voltage"
  AV re {e} = 0
  AV re = 0.01
  Save Scalars = True
  AV im {e} = 0
  AV im = 0
  AV {e} = 0
End

Boundary Condition 3
  Target Boundaries(3) = 4 5 6 
  Name = "Axial Field"
  AV re {e} = 0
  AV im {e} = 0
  AV {e} = 0
End
tylerm
Posts: 5
Joined: 09 Jan 2023, 19:00
Antispam: Yes

Re: Wire Harmonic Current Derived Values Accuracy

Post by tylerm »

To be consistent rather than mixing analytical values and results, the analytical inductance should be 4.686nH whereas the derived inductance is only 3.693nH.

I also had the thought that perhaps the model is too short axially to produce accurate values, so I updated the .grd file to lengthen it to 50mm (increasing the element divisions along that axis proportionally). It seems that made the discrepancies even worse with an analytic inductance of 38.751nH and a derived inductance of 18.470nH (boundary int of current density re 3 = 3.720E+001, E = 1.278E-005). The significand of the imaginary current is pretty close at 2.583 (vs 2.568), however it's off by 4 orders of magnitude...
tylerm
Posts: 5
Joined: 09 Jan 2023, 19:00
Antispam: Yes

Re: Wire Harmonic Current Derived Values Accuracy

Post by tylerm »

I've since found this post: viewtopic.php?t=5216. Is it just that the E&M solvers available in Elmer are not suitable for this type of analysis?
Post Reply