current density and field lines are not as expected

Numerical methods and mathematical models of Elmer
Post Reply
scheele_lara
Posts: 4
Joined: 21 May 2024, 11:24
Antispam: Yes

current density and field lines are not as expected

Post by scheele_lara »

We are currently working on a project to simulate joule heating. We are using Elmer for the Simulation and ParaView for displaying.

The problem we are facing right now is that our simulation generates the right current density with incorrect field lines.

This was due to the potential for the ElmerSolver wasn’t set to zero. In the next simulation we set the potential to zero. Now the field lines are as expected but the current flows only in one direction.

We can’t figure out where the error is. The Solver we are using is using the Equations “MagnetoDynamics” and “MagnetoDynamicsClacFields” of Solver 3. If you have any advice on how to solve the problem, please let us know.

Code: Select all

!!!!!!!!!Parameters!!!!!!!!!!
$ B_PM = 0 !1.20456					!Remanenzflussdichte Permanentmagneten
$ mu_PM = 1.09919					!Permeabilität Permanentmagneten
$ H_PM = B_PM/(mu_PM*pi*4e-7)		!Koerzitivfeldstärke Permanentmagneten
$ Stromdichte=500000;				! Stromdichte bezogen auf die Spulenfläche
$ sigma_PM = 7.14286e-7				!elektrischer Widerstand Permanentmagneten
$ leitfehigkeit= 8.6e6       			        !1.0/sigma_PM          ! Leitfähigkeit
$ frequenz=100
$ w_m=frequenz*2*pi

Header
  Mesh DB "geometrie"
  Results Directory "resultsMagneto"
End

!!!!!!!Magnetische Simulation!!!!!!!

Simulation
  Coordinate System = "Cartesian"
  Coordinate Scaling = 0.001
 ! Simulation Type = Steady State
  Solver Input File = magneto_laeuft.sif
  Post File = case.vtu
  Simulation Type = Transient
  BDF Order = 2     !Diskretisierungsordnung des Backward Differentiation Formula (BDF) Verfahrens
  Timestep Sizes = 0.0001
  Timestep Intervals = 100
  Output Intervals = 1
End

!!!!!!!!!!Constants!!!!!!!!!!
Constants
  Gravity = 9.81
  Stefan Boltzmann = 5.67e-8
  Permittivity of Vacuum = 8.854e-12
  Boltzmann Constant = 1.3807e-23
  Unit Charge = 1.602e-19
End

!!!!!!!!!Solvers!!!!!!!!!!
Solver 1
  Exec Solver = Before Timestep
  Equation = MeshDeform
  Procedure = "RigidMeshMapper" "RigidMeshMapper"
End

Solver 2
  Equation = "MGDynamics"
  Exec Solver = Always
  Procedure = "MagnetoDynamics2D" "MagnetoDynamics2D"
  Variable = "A"
  Steady State Condition = 1.0
  
  Stabilize = True
  Optimize Bandwidth = True
  Steady State Convergence Tolerance = 1.0e-5
  Nonlinear System Convergence Tolerance = 1.0e-6
  Nonlinear System Max Iterations = 200
  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 =  GCR !BiCGStab
  Linear System Max Iterations = 1000
  Linear System Convergence Tolerance = 1.0e-6
  BiCGstabl polynomial degree = 2
  Linear System Preconditioning = ILU0
  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 = MgDynPost
  Exec Solver = After Timestep ! After Saving
  Procedure = "MagnetoDynamics" "MagnetoDynamicsCalcFields"
  Discontinuous Bodies = Logical True
  Discontinuous Galerkin = True
  Average Within Materials = True
  Potential Variable = "A"
  
    Calculate Magnetic Field Strength = Logical True
    Calculate Magnetic Vector Potential = Logical True
    Calculate Electric Field = Logical True
    Calculate JxB = Logical True
    Calculate Magnetic Flux Density = Logical True
    Calculate Current Density = Logical True
    Calculate Nodal Forces = Logical True
    Calculate Elemental Fields  = Logical True
    Calculate Nodal Fields = Logical True
   ! Calculate Maxwell Stress= Logical True
    Calculate Current Density= Logical True
    Calculate Joule Heating= Logical True
    Calculate Nodal Heating= Logical True
    Calculate eddy current power= Logical True

  Stabilize = True
  Optimize Bandwidth = True
  Steady State Convergence Tolerance = 1.0e-5
  Linear System Solver = Direct
  Linear System Direct Method = Umfpack
  
End

Solver 4
  Exec Solver = after saving
  Equation = SaveScalars
  Procedure = "SaveData" "SaveScalars"
  Filename = "forces.csv"

   
      
      
     Save Component Results = logical true
    
End



!!!!!!!!!Equations!!!!!!!!!!
Equation 1
  Name = Equation 1
  Active Solvers(3) = 2 3 4
End

!!!!!!!!!Materials!!!!!!!!!!
Material 1
  Name = "Air"
  Relative Permeability = 1
End

Material 2
  Name = "Dynamo"
  H-B Curve = Variable coupled iter
    Real Monotone Cubic
      Include BH
    End
  Electric Conductivity =$ leitfehigkeit
End

Material 3
  Name = "Iron"
   H-B Curve = Variable coupled iter
    Real Monotone Cubic
      Include BH
    End
End


Material 4
  Name = "PM1"
  Relative Permeability = $ mu_PM
  Magnetization 1 =  Variable time, timestep size
    Real MATC "0"
  Magnetization 2 =  Variable time, timestep size
    Real MATC "-H_PM"
  Electric Conductivity = $ sigma_PM
End

Material 5
  Name = "PM2"
  Relative Permeability = $ mu_PM
  Magnetization 1 =  Variable time, timestep size
    Real MATC "0"
  Magnetization 2 =  Variable time, timestep size
    Real MATC "H_PM"
  Electric Conductivity = $ sigma_PM
End




!!!!!!!!!Body Forces!!!!!!!!!!


Body Force 1
  Name = "Current_plus"
  Current Density = Variable time, timestep size
    Real MATC "Stromdichte*cos(w_m*(tx(0)-tx(1)))"
End

Body Force 2
  Name = "Current_minus"
  Current Density = Variable time, timestep size
    Real MATC "-Stromdichte*cos(w_m*(tx(0)-tx(1)))"
End


!!!!!!!!!Boundary Conditions!!!!!!!!!!
Boundary Condition 1
  Target Boundaries(1) = 1
  Name = "Randlinie"
  A=real 0
End


!!!!!!!!!Bodies!!!!!!!!!!
Body 1  
 ! Name ="Stahl"
  Equation = 1
  Material = 3
End

Body 2 
 ! Name ="Magnet1"
  Equation = 1
  Material = 2
End

Body 3  
 ! Name ="Magnet2"
  Equation = 1
  Material = 3
End

Body 4   
 ! Name ="Kern"
  Equation = 1
  Material = 3
 
End

Body 5   
!  Name ="Strom_plus"
  Equation = 1
  Material = 1
  Body Force = 1
End

Body 6    
 ! Name ="Strom_minus"
  Equation = 1
  Material = 1
  Body Force = 2
End

Body 7    
 ! Name ="Luftspalt"
  Equation = 1
  Material = 1
End

Body 8     
 ! Name ="Innenraum"
  Equation = 1
  Material = 1
End

Body 9     
 ! Aussen Luft  Name ="Aussen"
  Equation = 1
  Material = 1
End
Tapegoji
Posts: 28
Joined: 12 May 2024, 00:22
Antispam: Yes

Re: current density and field lines are not as expected

Post by Tapegoji »

Hey,

can you post your files so I can try to run it? Also, can you post a screenshot of what you think is wrong
scheele_lara
Posts: 4
Joined: 21 May 2024, 11:24
Antispam: Yes

Re: current density and field lines are not as expected

Post by scheele_lara »

Here are the first screenshots
Attachments
Matching field lines.PNG
(359.06 KiB) Not downloaded yet
Suitable current density.PNG
(56.3 KiB) Not downloaded yet
Faulty field lines.PNG
(123.58 KiB) Not downloaded yet
scheele_lara
Posts: 4
Joined: 21 May 2024, 11:24
Antispam: Yes

Re: current density and field lines are not as expected

Post by scheele_lara »

Here is the last Screenshot.
Attachments
Incorrect current density.PNG
(52.04 KiB) Not downloaded yet
scheele_lara
Posts: 4
Joined: 21 May 2024, 11:24
Antispam: Yes

Re: current density and field lines are not as expected

Post by scheele_lara »

Here are our files.
Attachments
BH.csv
this file originally has no file format. To upload the file, the file ending was changed to csv
(287 Bytes) Downloaded 16 times
magneto_laeuft.sif
(5.64 KiB) Downloaded 31 times
geometrie.geo
(5.33 KiB) Downloaded 33 times
Post Reply