Applying Current, instead of voltage

Numerical methods and mathematical models of Elmer
Post Reply
Tapegoji
Posts: 28
Joined: 12 May 2024, 00:22
Antispam: Yes

Applying Current, instead of voltage

Post by Tapegoji »

Hello everyone,

I greatly appreciate the power and utility of this tool.

I'm currently engaged with Tutorial 7, which explores the magnetic field induced by a harmonic current in a wire, using ElmerGUI. I've transitioned to working directly with the SIF file.

My current challenge involves altering the excitation type from voltage to current. Despite modifying the settings, I observe no Joule heating or magnetic flux in the results. The simulation completes without errors, but it appears the excitation settings may be incorrect.

Here's what I've attempted so far:

Code: Select all

Header
  CHECK KEYWORDS "Warn"
  Mesh DB "." "."
End

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

Constants
  Gravity(4) = 0 -1 0 9.82
  Stefan Boltzmann = 5.670374419e-08
  Permeability of Vacuum = 1.25663706e-06
  Boltzmann Constant = 1.380649e-23
  Unit Charge = 1.6021766e-19
End

! main
Equation 1
  Active Solvers(2) = 1 2   ! WhitneyAVHarmonicSolver, MagnetoDynamicsCalcFields, 
End


! WhitneyAVHarmonicSolver
Solver 1
  Equation = MgHarm
  Procedure = "MagnetoDynamics" "WhitneyAVHarmonicSolver"
  Exec Solver = Always
  Stabilize = True
  Optimize Bandwidth = True
  Steady State Convergence Tolerance = 1e-05
  Nonlinear System Convergence Tolerance = 1e-07
  Nonlinear System Max Iterations = 20
  Nonlinear System Newton After Iterations = 3
  Nonlinear System Newton After Tolerance = 0.001
  Nonlinear System Relaxation Factor = 1
  Linear System Solver = Iterative
  Linear System Iterative Method = BiCGStabl
  Linear System Max Iterations = 500
  Linear System Convergence Tolerance = 1e-10
  BiCGstabl polynomial degree = 4
  Linear System Preconditioning = none
  Linear System ILUT Tolerance = 0.001
  Linear System Abort Not Converged = False
  Linear System Residual Output = 10
  Linear System Precondition Recompute = 1
End

! MagnetoDynamicsCalcFields
Solver 2
  Equation = MgDynPost
  Calculate Joule Heating = True
  Calculate Magnetic Field Strength = True
  Procedure = "MagnetoDynamics" "MagnetoDynamicsCalcFields"
  Discontinuous Bodies = True
  Exec Solver = Before Saving
  Stabilize = True
  Optimize Bandwidth = True
  Steady State Convergence Tolerance = 1e-05
  Nonlinear System Convergence Tolerance = 1e-07
  Nonlinear System Max Iterations = 20
  Nonlinear System Newton After Iterations = 3
  Nonlinear System Newton After Tolerance = 0.001
  Nonlinear System Relaxation Factor = 1
  Linear System Solver = Iterative
  Linear System Iterative Method = BiCGStab
  Linear System Max Iterations = 500
  Linear System Convergence Tolerance = 1e-10
  BiCGstabl polynomial degree = 2
  Linear System Preconditioning = ILU0
  Linear System ILUT Tolerance = 0.001
  Linear System Abort Not Converged = False
  Linear System Residual Output = 10
  Linear System Precondition Recompute = 1
End


! copper_generic
Material 1
  Name = "Copper (generic)"
  Heat Conductivity = 401.0
  Electric Conductivity = 58e6
  Poisson ratio = 0.34
  Relative Permeability = 1.0
  Relative Permittivity = 1.0
  Youngs modulus = 115.0e9
  Heat expansion Coefficient = 1.65e-05
  Density = 8960.0
  Sound speed = 3810.0
  Heat Capacity = 385.0
End

! air_room
Material 2
  Name = "Air (room temperature)"
  Relative Permeability = 1.00000037
  Viscosity = 1.983e-05
  Heat expansion Coefficient = 0.00343
  Heat Conductivity = 0.0257
  Density = 1.205
  Sound speed = 343.0
  Relative Permittivity = 1.00059
  Heat Capacity = 1005.0
End


! air
Body 1
  Target Bodies(1) = 1
  Equation = 1  ! main
  Material = 2  ! air_room
End

! wire
Body 2
  Target Bodies(1) = 2
  Equation = 1  ! main
  Material = 1  ! copper_generic
End


! pos
Boundary Condition 1
  Target Boundaries(1) = 3
  Name = "Current_in"
  Current Density  = Real "100000.0"
End

! neg
Boundary Condition 2
  Target Boundaries(1) = 4
  Name = "Current_out"
  Current Density  = Real "-135"
End

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

Could anyone provide guidance on the correct modifications to achieve the desired output? Any assistance would be greatly appreciated.

Thank you in advance for your help.
Tapegoji
Posts: 28
Joined: 12 May 2024, 00:22
Antispam: Yes

Re: Applying Current, instead of voltage

Post by Tapegoji »

Here is what I found that seems to be working.

Code: Select all

Header
  CHECK KEYWORDS "Warn"
  Mesh DB "." "."
End

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

Constants
  Gravity(4) = 0 -1 0 9.82
  Stefan Boltzmann = 5.670374419e-08
  Permeability of Vacuum = 1.25663706e-06
  Boltzmann Constant = 1.380649e-23
  Unit Charge = 1.6021766e-19
End

! main
Equation 1
  Active Solvers(2) = 1 2   ! WhitneyAVHarmonicSolver, MagnetoDynamicsCalcFields, 
End


! WhitneyAVHarmonicSolver
Solver 1
  Equation = MgHarm
  Procedure = "MagnetoDynamics" "WhitneyAVHarmonicSolver"
  Exec Solver = Always
  Stabilize = True
  Optimize Bandwidth = True
  Steady State Convergence Tolerance = 1e-05
  Nonlinear System Convergence Tolerance = 1e-07
  Nonlinear System Max Iterations = 20
  Nonlinear System Newton After Iterations = 3
  Nonlinear System Newton After Tolerance = 0.001
  Nonlinear System Relaxation Factor = 1
  Linear System Solver = Iterative
  Linear System Iterative Method = BiCGStabl
  Linear System Max Iterations = 500
  Linear System Convergence Tolerance = 1e-10
  BiCGstabl polynomial degree = 4
  Linear System Preconditioning = none
  Linear System ILUT Tolerance = 0.001
  Linear System Abort Not Converged = False
  Linear System Residual Output = 10
  Linear System Precondition Recompute = 1
End

! MagnetoDynamicsCalcFields
Solver 2
  Equation = MgDynPost
  Calculate Joule Heating = True
  Calculate Magnetic Field Strength = True
  Procedure = "MagnetoDynamics" "MagnetoDynamicsCalcFields"
  Discontinuous Bodies = True
  Exec Solver = Before Saving
  Stabilize = True
  Optimize Bandwidth = True
  Steady State Convergence Tolerance = 1e-05
  Nonlinear System Convergence Tolerance = 1e-07
  Nonlinear System Max Iterations = 20
  Nonlinear System Newton After Iterations = 3
  Nonlinear System Newton After Tolerance = 0.001
  Nonlinear System Relaxation Factor = 1
  Linear System Solver = Iterative
  Linear System Iterative Method = BiCGStab
  Linear System Max Iterations = 500
  Linear System Convergence Tolerance = 1e-10
  BiCGstabl polynomial degree = 2
  Linear System Preconditioning = ILU0
  Linear System ILUT Tolerance = 0.001
  Linear System Abort Not Converged = False
  Linear System Residual Output = 10
  Linear System Precondition Recompute = 1
End


! copper
Material 1
  Density = 8960.0
  Electric Conductivity = 32300000
  Emissivity = 0.012
  Heat Capacity = 415.0
  Heat Conductivity = 401.0
  Relative Permeability = 1
  Relative Permittivity = 1
End

! air
Material 2
  Density = 1.1885
  Electric Conductivity = 0.0
  Heat Capacity = 1006.4
  Heat Conductivity = 0.025873
  Relative Permeability = 1
  Relative Permittivity = 1
End


! air
Body 1
  Target Bodies(1) = 1
  Equation = 1  ! main
  Material = 2  ! air
End

! wire
Body 2
  Target Bodies(1) = 2
  Equation = 1  ! main
  Material = 1  ! copper
End


! pos
Boundary Condition 1
  Target Boundaries(1) = 3
  Name = "Current_in"
  AV im {e} = Real 0.0
  AV re {e} = Real 0.0
  Electric Current Density = -distribute 1
End

! neg
Boundary Condition 2
  Target Boundaries(1) = 4
  Name = "Current_out"
  AV im {e} = Real 0.0
  AV re {e} = Real 0.0
  AV im = Real 0.0
  AV re = Real 0.0
End

! air_boundary
Boundary Condition 3
  Target Boundaries(1) = 5
  Name = "AxialField"
  AV re {e} = 0
  AV im {e} = 0
End
However, I still see that the joule heating from the current in and out surfaces is different
Attachments
mixed.png
mixed.png (33.7 KiB) Viewed 279 times
Tapegoji
Posts: 28
Joined: 12 May 2024, 00:22
Antispam: Yes

Re: Applying Current, instead of voltage

Post by Tapegoji »

I was able to figure this out.

This is due to the fact that the current is being applied to surface, evenly. This is expected.
Post Reply