problems with MGDynamicsCalc

Numerical methods and mathematical models of Elmer
Post Reply
lazyTom
Posts: 56
Joined: 05 Jun 2013, 01:32
Antispam: Yes

problems with MGDynamicsCalc

Post by lazyTom »

Hi all,

I'm having a problem MGDynamicsCalc solver, given a specific current injected in a simple 3D coil (1 turn surrounded by air) I'm trying to calculate its magnetic energy. The current solver seems to work (I have only checked the statCurrent solver output, btw is there a different way to check if the requested current matches the calculated?) but the MGDynamicsCalc solver seems to give problems (unexpected termination of Elmer, see the output file in the link below).

If anyone want to have a look at it, all files (mesh + sif + output) can be found here: https://www.dropbox.com/s/3jzewamh34ez ... .zip?dl=0



My elmer version is: 8.3-f90766a4

Also, below is an overview of the sif file

Code: Select all


!!------ Skeleton for body section -----
!Body 1 = coil
!Body 2 = air top
!Body 3 = air bot

!BC 01 = current out
!BC 02 = current in
!BC 03 = BC B_normal = 0
!BC 04 = BC B = 0


Header
   Check Keywords "Warn"

Mesh DB "." "open_loop_std_1_turn"    

  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(2) = 2 3
  Name = "Air"
  Equation = 2
  Material = 1
End

Body 2
  Target Bodies(1) = 1
  Name = "3D Coil 1"
  Equation = 1
  Material = 2
  Body Force = 1
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

Material 3
  Name = "Iron (generic)"

  Poisson ratio = 0.29
  Heat expansion Coefficient = 11.8e-6
  Youngs modulus = 193.053e9
  Heat Conductivity = 80.2
  Sound speed = 5000.0
  Heat Capacity = 449.0
  Mesh Poisson ratio = 0.29
  Density = 7870.0
  relative Permittivity = 1.0
  Relative Permeability = 1000
  Electric Conductivity = 10.30e6  
End

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

Equation 2
  Name = "Equation magnetic field"
  Active Solvers(2) = 2 3
End

Solver 1

  Equation = Static Current Conduction
  Calculate Joule Heating = True
  Calculate Volume Current = True
  Procedure = "StatCurrentSolve" "StatCurrentSolver"

  Current Control = 40

  Variable = Potential

  Exec Solver = Always
  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 = BiCGStabl

  Linear System Max Iterations = 5000
  Linear System Convergence Tolerance = 1.0e-10

!  BiCGstabl polynomial degree = 2
!  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 2
!  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 = 15000 !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 3
!  Exec Solver = Never
  Equation = "MGDynamicsCalc"
  Procedure = "MagnetoDynamics" "MagnetoDynamicsCalcFields"
  
!  Linear System Symmetric = True

  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 Solver = "Direct"
  
!  Linear System Iterative Method = CG
!  Linear System Iterative Method = BiCGStab
!  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-8
End



Solver 4
!  Equation = Result Output
!  Exec Solver = Never
  Procedure = "ResultOutputSolve" "ResultOutputSolver"
  Binary Output = True
  Output Format = vtu
  Output File Name = results
End

Solver 5
!  Equation = "scalars"
!  Exec Solver = Never  
  procedure = "SaveData" "SaveScalars"
  Filename = "data_scalars.dat"  
End

Boundary Condition 1
  Target Boundaries(1) = 2
  Name = "Current IN"
  Potential = real 0.05
  Magnetic Flux Density {n} = real 0
End

Boundary Condition 2
  Target Boundaries(1) = 1
  Name = "Current OUT"
  Potential = real 0
  Magnetic Flux Density {n} = real 0
End

Boundary Condition 3
  Target Boundaries(1) = 3
  Name = "BC normal Flux zero"
  Magnetic Flux Density {n} = real 0
End

Boundary Condition 4
  Target Boundaries(1) = 4
  Name = "Outer space"
  P {e}= real 0
End

Body Force 1
  Name = "Current Density"

  Current Density 1 = Equals Volume current 1
  Current Density 2 = Equals Volume current 2
  Current Density 3 = Equals Volume current 3

!  Current Density 1 = Equals CoilCurrent 1
!  Current Density 2 = Equals CoilCurrent 2
!  Current Density 3 = Equals CoilCurrent 3


End


Any help is much appreciated!

Marco
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: problems with MGDynamicsCalc

Post by raback »

Hi Marco

Had a quick look. I think the problem is that you StatCurrentSolver tries to compute the "Joule heating" field. The CalcFields solver can in principle solve the same field. In fact if the solver is present it tries to do so. Now unfortunately it here fails because the "Joule heating" that exists is defined only at the conductor but the CalcFields solver thinks it is everywhere as the other fields. Hence the core dump.

As a quick remedy just remove the joule heating request from StatCurrentSolver.

-Peter
lazyTom
Posts: 56
Joined: 05 Jun 2013, 01:32
Antispam: Yes

Re: problems with MGDynamicsCalc

Post by lazyTom »

Hi Peter,

indeed, commenting "Calculate Joule heating = True" removes the problem.

Thanks for your help!

Marco
davegerber
Posts: 1
Joined: 25 Nov 2018, 23:17
Antispam: Yes

Re: problems with MGDynamicsCalc

Post by davegerber »

Sorry if this is an inept inquiry: Do you endeavor to peruse the sif record with ElmerGUI? This isn't planned to work, you require the egproject.xml where the GUI settings are put away. The sif record is composed by the GUI and perused by the solver.

[Advertising URL deleted by mzenker]
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: problems with MGDynamicsCalc

Post by mzenker »

Hi,

indeed the sif file is not read back by ElmerGUI. However, the Elmer plugin for Salomé viewtopic.php?f=9&t=4482 can do that.

Matthias

P.S.: Please don't post advertising URLs. Users posting messages considered as SPAM will be deleted without further notice.
Post Reply