Advice on solver settings for MagDyn

Numerical methods and mathematical models of Elmer
Nick_99
Posts: 49
Joined: 12 Jul 2023, 10:07
Antispam: Yes

Advice on solver settings for MagDyn

Post by Nick_99 »

Hi all,

I have simple cube where a rotational transformation has been applied to the X,Y, and Z axes. The rotation about each axis is Pi/4 radians.

I then have boundary conditions on the surfaces of the cube to create an H-field. If I don't apply the rotational transformation to the cube, Elmer solves it perfectly. However, when I try to run the sim with the rotation applied, I cannot get the solution to converge well. I have had some limited success using the TFQMR iterative method but the convergence is extremely poor. Does this inability to solve the system have to do with the rotational transformation invalidating the boundary conditions?

poor convergence log:

Code: Select all

ELMER SOLVER (v 9.0) STARTED AT: 2024/05/09 08:56:14
ParCommInit:  Initialize #PEs:            1
MAIN: 
MAIN: =============================================================
MAIN: ElmerSolver finite element software, Welcome!
MAIN: This program is free software licensed under (L)GPL
MAIN: Copyright 1st April 1995 - , CSC - IT Center for Science Ltd.
MAIN: Webpage http://www.csc.fi/elmer, Email elmeradm@csc.fi
MAIN: Version: 9.0 (Rev: unknown, Compiled: 2024-05-06)
MAIN:  Running one task without MPI parallelization.
MAIN:  Running with just one thread per task.
MAIN:  MUMPS library linked in.
MAIN:  Lua interpreter linked in.
MAIN: =============================================================
MAIN: 
MAIN: 
MAIN: -------------------------------------
MAIN: Reading Model: case.sif
LoadInputFile: Scanning input file: case.sif
LoadInputFile: Scanning only size info
LoadInputFile: First time visiting
LoadInputFile: Reading base load of sif file
LoadInputFile: Loading input file: case.sif
LoadInputFile: Reading base load of sif file
LoadInputFile: Number of BCs: 5
LoadInputFile: Number of Body Forces: 0
LoadInputFile: Number of Initial Conditions: 0
LoadInputFile: Number of Materials: 1
LoadInputFile: Number of Equations: 1
LoadInputFile: Number of Solvers: 2
LoadInputFile: Number of Bodies: 1
ListTagKeywords: Setting weight for keywords!
ListTagKeywords: No parameters width suffix: normalize by area
ListTagKeywords: Setting weight for keywords!
ListTagKeywords: No parameters width suffix: normalize by volume
ElmerAsciiMesh: Base mesh name: ./.
MapCoordinates: Scaling coordinates: 1.000E+00 1.000E+00 1.000E+00
LoadMesh: Elapsed REAL time:     0.0063 (s)
MAIN: -------------------------------------
AddVtuOutputSolverHack: Adding ResultOutputSolver to write VTU output in file: case
OptimizeBandwidth: Initial bandwidth for mgdyn: 637
OptimizeBandwidth: Optimized bandwidth for mgdyn: 203
OptimizeBandwidth: Initial bandwidth for mgdynpost: 105
OptimizeBandwidth: Optimized bandwidth for mgdynpost: 64
MAIN: Number of timesteps to be saved: 1
MAIN: 
MAIN: -------------------------------------
MAIN:  Steady state iteration:            1
MAIN: -------------------------------------
MAIN: 
WhitneyAVSolver: Solving steady-state AV equations with edge elements
MGDynAssembly: Elapsed REAL time:     0.0097 (s)
      10    0.6541695E+00
      20    0.6543732E+00
      30    0.6544450E+00
      40    0.6544450E+00
      50    0.6544450E+00
      60    0.6544450E+00
      70    0.6544450E+00
      80    0.6544450E+00
      90    0.6544450E+00
     100    0.6544453E+00
     101    0.6544453E+00
ComputeChange: NS (ITER=1) (NRM,RELC): (  6309888.2      2.0000000     ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0105 (s)
      10    0.5637958E+00
      20    0.5651800E+00
      30    0.5651828E+00
      40    0.5651828E+00
      50    0.5651828E+00
      60    0.5651828E+00
      70    0.5651828E+00
      80    0.5651828E+00
      90    0.5651828E+00
     100    0.5651828E+00
     101    0.5651828E+00
ComputeChange: NS (ITER=2) (NRM,RELC): (  6309319.7     0.90102290E-04 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0109 (s)
      10    0.5647845E+00
      20    0.5671275E+00
      30    0.5671290E+00
      40    0.5671290E+00
      50    0.5671290E+00
      60    0.5671290E+00
      70    0.5671290E+00
      80    0.5671290E+00
      90    0.5671290E+00
     100    0.5671291E+00
     101    0.5671291E+00
ComputeChange: NS (ITER=3) (NRM,RELC): (  6546381.1     0.36880353E-01 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0090 (s)
      10    0.5470638E+00
      20    0.5509925E+00
      30    0.5509963E+00
      40    0.5509963E+00
      50    0.5509963E+00
      60    0.5509963E+00
      70    0.5509963E+00
      80    0.5509963E+00
      90    0.5509963E+00
     100    0.5509963E+00
     101    0.5509963E+00
ComputeChange: NS (ITER=4) (NRM,RELC): (  6570951.9     0.37463079E-02 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0094 (s)
      10    0.4977512E+00
      20    0.4980049E+00
      30    0.4980052E+00
      40    0.4980052E+00
      50    0.4980052E+00
      60    0.4980052E+00
      70    0.4980052E+00
      80    0.4980052E+00
      90    0.4980052E+00
     100    0.4980052E+00
     101    0.4980052E+00
ComputeChange: NS (ITER=5) (NRM,RELC): (  6580520.3     0.14551159E-02 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0093 (s)
      10    0.4731455E+00
      20    0.4737351E+00
      30    0.4737355E+00
      40    0.4737355E+00
      50    0.4737355E+00
      60    0.4737355E+00
      70    0.4737355E+00
      80    0.4737355E+00
      90    0.4737355E+00
     100    0.4737355E+00
     101    0.4737355E+00
ComputeChange: NS (ITER=6) (NRM,RELC): (  6580522.1     0.27103911E-06 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0091 (s)
      10    0.4438464E+00
      20    0.4439628E+00
      30    0.4439628E+00
      40    0.4439628E+00
      50    0.4439628E+00
      60    0.4439628E+00
      70    0.4439628E+00
      80    0.4439628E+00
      90    0.4439628E+00
     100    0.4439629E+00
     101    0.4439629E+00
ComputeChange: NS (ITER=7) (NRM,RELC): (  46099511.      1.5003403     ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0085 (s)
      10    0.4214962E+00
      20    0.4215032E+00
      30    0.4215032E+00
      40    0.4215032E+00
      50    0.4215032E+00
      60    0.4215032E+00
      70    0.4215032E+00
      80    0.4215032E+00
      90    0.4215032E+00
     100    0.4215032E+00
     101    0.4215032E+00
ComputeChange: NS (ITER=8) (NRM,RELC): (  46099511.     0.38011659E-08 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0079 (s)
      10    0.4061306E+00
      20    0.4061316E+00
      30    0.4061316E+00
      40    0.4061316E+00
      50    0.4061316E+00
      60    0.4061316E+00
      70    0.4061316E+00
      80    0.4061316E+00
      90    0.4061316E+00
     100    0.4061316E+00
     101    0.4061316E+00
ComputeChange: NS (ITER=9) (NRM,RELC): (  46099510.     0.57870601E-08 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0077 (s)
      10    0.3945748E+00
      20    0.3945752E+00
      30    0.3945752E+00
      40    0.3945752E+00
      50    0.3945752E+00
      60    0.3945752E+00
      70    0.3945752E+00
      80    0.3945752E+00
      90    0.3945752E+00
     100    0.3945752E+00
     101    0.3945752E+00
ComputeChange: NS (ITER=10) (NRM,RELC): (  46099510.     0.60116616E-08 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0080 (s)
      10    0.3856525E+00
      20    0.3856527E+00
      30    0.3856527E+00
      40    0.3856527E+00
      50    0.3856527E+00
      60    0.3856527E+00
      70    0.3856527E+00
      80    0.3856527E+00
      90    0.3856527E+00
     100    0.3856527E+00
     101    0.3856527E+00
ComputeChange: NS (ITER=11) (NRM,RELC): (  46099511.     0.82677872E-08 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0087 (s)
      10    0.3756872E+00
      20    0.3756873E+00
      30    0.3756873E+00
      40    0.3756873E+00
      50    0.3756873E+00
      60    0.3756873E+00
      70    0.3756873E+00
      80    0.3756873E+00
      90    0.3756873E+00
     100    0.3756873E+00
     101    0.3756873E+00
ComputeChange: NS (ITER=12) (NRM,RELC): (  46099511.     0.12057519E-07 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0087 (s)
      10    0.3668893E+00
      20    0.3668893E+00
      30    0.3668893E+00
      40    0.3668893E+00
      50    0.3668893E+00
      60    0.3668893E+00
      70    0.3668893E+00
      80    0.3668893E+00
      90    0.3668893E+00
     100    0.3668893E+00
     101    0.3668893E+00
ComputeChange: NS (ITER=13) (NRM,RELC): (  46099511.     0.36030228E-08 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0089 (s)
      10    0.3576908E+00
      20    0.3576908E+00
      30    0.3576908E+00
      40    0.3576908E+00
      50    0.3576908E+00
      60    0.3576908E+00
      70    0.3576908E+00
      80    0.3576908E+00
      90    0.3576908E+00
     100    0.3576908E+00
     101    0.3576908E+00
ComputeChange: NS (ITER=14) (NRM,RELC): (  46099511.     0.37642161E-08 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0088 (s)
      10    0.3500774E+00
      20    0.3500775E+00
      30    0.3500775E+00
      40    0.3500775E+00
      50    0.3500775E+00
      60    0.3500775E+00
      70    0.3500775E+00
      80    0.3500775E+00
      90    0.3500775E+00
     100    0.3500775E+00
     101    0.3500775E+00
ComputeChange: NS (ITER=15) (NRM,RELC): (  46099511.     0.31213285E-08 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0088 (s)
      10    0.3426134E+00
      20    0.3426134E+00
      30    0.3426134E+00
      40    0.3426134E+00
      50    0.3426134E+00
      60    0.3426134E+00
      70    0.3426134E+00
      80    0.3426134E+00
      90    0.3426134E+00
     100    0.3426134E+00
     101    0.3426134E+00
ComputeChange: NS (ITER=16) (NRM,RELC): (  46099510.     0.31613404E-08 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0088 (s)
      10    0.3361862E+00
      20    0.3361862E+00
      30    0.3361862E+00
      40    0.3361862E+00
      50    0.3361862E+00
      60    0.3361862E+00
      70    0.3361862E+00
      80    0.3361862E+00
      90    0.3361862E+00
     100    0.3361862E+00
     101    0.3361862E+00
ComputeChange: NS (ITER=17) (NRM,RELC): (  46099510.     0.26872057E-08 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0087 (s)
      10    0.3302374E+00
      20    0.3302374E+00
      30    0.3302374E+00
      40    0.3302374E+00
      50    0.3302374E+00
      60    0.3302374E+00
      70    0.3302374E+00
      80    0.3302374E+00
      90    0.3302374E+00
     100    0.3302374E+00
     101    0.3302374E+00
ComputeChange: NS (ITER=18) (NRM,RELC): (  46099510.     0.26803912E-08 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0088 (s)
      10    0.3251581E+00
      20    0.3251581E+00
      30    0.3251581E+00
      40    0.3251581E+00
      50    0.3251581E+00
      60    0.3251581E+00
      70    0.3251581E+00
      80    0.3251581E+00
      90    0.3251581E+00
     100    0.3251581E+00
     101    0.3251581E+00
ComputeChange: NS (ITER=19) (NRM,RELC): (  46099510.     0.23697219E-08 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0088 (s)
      10    0.3206370E+00
      20    0.3206370E+00
      30    0.3206370E+00
      40    0.3206370E+00
      50    0.3206370E+00
      60    0.3206370E+00
      70    0.3206370E+00
      80    0.3206370E+00
      90    0.3206370E+00
     100    0.3206370E+00
     101    0.3206370E+00
ComputeChange: NS (ITER=20) (NRM,RELC): (  46099510.     0.23588302E-08 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0090 (s)
      10    0.3168322E+00
      20    0.3168322E+00
      30    0.3168322E+00
      40    0.3168322E+00
      50    0.3168322E+00
      60    0.3168322E+00
      70    0.3168322E+00
      80    0.3168322E+00
      90    0.3168322E+00
     100    0.3168322E+00
     101    0.3168322E+00
ComputeChange: NS (ITER=21) (NRM,RELC): (  46099510.     0.21960779E-08 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0088 (s)
      10    0.3135251E+00
      20    0.3135251E+00
      30    0.3135251E+00
      40    0.3135251E+00
      50    0.3135251E+00
      60    0.3135251E+00
      70    0.3135251E+00
      80    0.3135251E+00
      90    0.3135251E+00
     100    0.3135251E+00
     101    0.3135251E+00
ComputeChange: NS (ITER=22) (NRM,RELC): (  46099510.     0.22120746E-08 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0088 (s)
      10    0.3107116E+00
      20    0.3107116E+00
      30    0.3107116E+00
      40    0.3107116E+00
      50    0.3107116E+00
      60    0.3107116E+00
      70    0.3107116E+00
      80    0.3107116E+00
      90    0.3107116E+00
     100    0.3107116E+00
     101    0.3107116E+00
ComputeChange: NS (ITER=23) (NRM,RELC): (  46099510.     0.20967274E-08 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0089 (s)
      10    0.3082621E+00
      20    0.3082621E+00
      30    0.3082621E+00
      40    0.3082621E+00
      50    0.3082621E+00
      60    0.3082621E+00
      70    0.3082621E+00
      80    0.3082621E+00
      90    0.3082621E+00
     100    0.3082621E+00
     101    0.3082621E+00
ComputeChange: NS (ITER=24) (NRM,RELC): (  46099510.     0.21574368E-08 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0089 (s)
      10    0.3061543E+00
      20    0.3061543E+00
      30    0.3061543E+00
      40    0.3061543E+00
      50    0.3061543E+00
      60    0.3061543E+00
      70    0.3061543E+00
      80    0.3061543E+00
      90    0.3061543E+00
     100    0.3061543E+00
     101    0.3061543E+00
ComputeChange: NS (ITER=25) (NRM,RELC): (  46099509.     0.20565772E-08 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0088 (s)
      10    0.3042840E+00
      20    0.3042840E+00
      30    0.3042840E+00
      40    0.3042840E+00
      50    0.3042840E+00
      60    0.3042840E+00
      70    0.3042840E+00
      80    0.3042840E+00
      90    0.3042840E+00
     100    0.3042840E+00
     101    0.3042840E+00
ComputeChange: NS (ITER=26) (NRM,RELC): (  46099509.     0.21088802E-08 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0090 (s)
      10    0.3026301E+00
      20    0.3026301E+00
      30    0.3026301E+00
      40    0.3026301E+00
      50    0.3026301E+00
      60    0.3026301E+00
      70    0.3026301E+00
      80    0.3026301E+00
      90    0.3026301E+00
     100    0.3026301E+00
     101    0.3026301E+00
ComputeChange: NS (ITER=27) (NRM,RELC): (  46099509.     0.20500964E-08 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0088 (s)
      10    0.3011330E+00
      20    0.3011330E+00
      30    0.3011330E+00
      40    0.3011330E+00
      50    0.3011330E+00
      60    0.3011330E+00
      70    0.3011330E+00
      80    0.3011330E+00
      90    0.3011330E+00
     100    0.3011330E+00
     101    0.3011330E+00
ComputeChange: NS (ITER=28) (NRM,RELC): (  46099509.     0.20899552E-08 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0088 (s)
      10    0.2997784E+00
      20    0.2997784E+00
      30    0.2997784E+00
      40    0.2997784E+00
      50    0.2997784E+00
      60    0.2997784E+00
      70    0.2997784E+00
      80    0.2997784E+00
      90    0.2997784E+00
     100    0.2997784E+00
     101    0.2997784E+00
ComputeChange: NS (ITER=29) (NRM,RELC): (  46099509.     0.20494685E-08 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0090 (s)
      10    0.2985307E+00
      20    0.2985307E+00
      30    0.2985307E+00
      40    0.2985307E+00
      50    0.2985307E+00
      60    0.2985307E+00
      70    0.2985307E+00
      80    0.2985307E+00
      90    0.2985307E+00
     100    0.2985307E+00
     101    0.2985307E+00
ComputeChange: NS (ITER=30) (NRM,RELC): (  46099509.     0.20779912E-08 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0089 (s)
      10    0.2973816E+00
      20    0.2973816E+00
      30    0.2973816E+00
      40    0.2973816E+00
      50    0.2973816E+00
      60    0.2973816E+00
      70    0.2973816E+00
      80    0.2973816E+00
      90    0.2973816E+00
     100    0.2973816E+00
     101    0.2973816E+00
ComputeChange: NS (ITER=31) (NRM,RELC): (  46099509.     0.20498744E-08 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0079 (s)
      10    0.2963093E+00
      20    0.2963093E+00
      30    0.2963093E+00
      40    0.2963093E+00
      50    0.2963093E+00
      60    0.2963093E+00
      70    0.2963093E+00
      80    0.2963093E+00
      90    0.2963093E+00
     100    0.2963093E+00
     101    0.2963093E+00
ComputeChange: NS (ITER=32) (NRM,RELC): (  46099509.     0.20688296E-08 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0079 (s)
      10    0.2953089E+00
      20    0.2953089E+00
      30    0.2953089E+00
      40    0.2953089E+00
      50    0.2953089E+00
      60    0.2953089E+00
      70    0.2953089E+00
      80    0.2953089E+00
      90    0.2953089E+00
     100    0.2953089E+00
     101    0.2953089E+00
ComputeChange: NS (ITER=33) (NRM,RELC): (  46099509.     0.20493879E-08 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0091 (s)
      10    0.2943670E+00
      20    0.2943670E+00
      30    0.2943670E+00
      40    0.2943670E+00
      50    0.2943670E+00
      60    0.2943670E+00
      70    0.2943670E+00
      80    0.2943670E+00
      90    0.2943670E+00
     100    0.2943670E+00
     101    0.2943670E+00
ComputeChange: NS (ITER=34) (NRM,RELC): (  46099509.     0.20611711E-08 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0092 (s)
      10    0.2934803E+00
      20    0.2934803E+00
      30    0.2934803E+00
      40    0.2934803E+00
      50    0.2934803E+00
      60    0.2934803E+00
      70    0.2934803E+00
      80    0.2934803E+00
      90    0.2934803E+00
     100    0.2934803E+00
     101    0.2934803E+00
ComputeChange: NS (ITER=35) (NRM,RELC): (  46099509.     0.20477987E-08 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0093 (s)
      10    0.2926407E+00
      20    0.2926407E+00
      30    0.2926407E+00
      40    0.2926407E+00
      50    0.2926407E+00
      60    0.2926407E+00
      70    0.2926407E+00
      80    0.2926407E+00
      90    0.2926407E+00
     100    0.2926407E+00
     101    0.2926407E+00
ComputeChange: NS (ITER=36) (NRM,RELC): (  46099508.     0.20547794E-08 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0093 (s)
      10    0.2918455E+00
      20    0.2918455E+00
      30    0.2918455E+00
      40    0.2918455E+00
      50    0.2918455E+00
      60    0.2918455E+00
      70    0.2918455E+00
      80    0.2918455E+00
      90    0.2918455E+00
     100    0.2918455E+00
     101    0.2918455E+00
ComputeChange: NS (ITER=37) (NRM,RELC): (  46099508.     0.20454601E-08 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0080 (s)
      10    0.2910899E+00
      20    0.2910899E+00
      30    0.2910899E+00
      40    0.2910899E+00
      50    0.2910899E+00
      60    0.2910899E+00
      70    0.2910899E+00
      80    0.2910899E+00
      90    0.2910899E+00
     100    0.2910899E+00
     101    0.2910899E+00
ComputeChange: NS (ITER=38) (NRM,RELC): (  46099508.     0.20496399E-08 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0078 (s)
      10    0.2903716E+00
      20    0.2903716E+00
      30    0.2903716E+00
      40    0.2903716E+00
      50    0.2903716E+00
      60    0.2903716E+00
      70    0.2903716E+00
      80    0.2903716E+00
      90    0.2903716E+00
     100    0.2903716E+00
     101    0.2903716E+00
ComputeChange: NS (ITER=39) (NRM,RELC): (  46099508.     0.20430082E-08 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0077 (s)
      10    0.2896874E+00
      20    0.2896874E+00
      30    0.2896874E+00
      40    0.2896874E+00
      50    0.2896874E+00
      60    0.2896874E+00
      70    0.2896874E+00
      80    0.2896874E+00
      90    0.2896874E+00
     100    0.2896874E+00
     101    0.2896874E+00
ComputeChange: NS (ITER=40) (NRM,RELC): (  46099508.     0.20460406E-08 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0088 (s)
      10    0.2890360E+00
      20    0.2890360E+00
      30    0.2890360E+00
      40    0.2890360E+00
      50    0.2890360E+00
      60    0.2890360E+00
      70    0.2890360E+00
      80    0.2890360E+00
      90    0.2890360E+00
     100    0.2890360E+00
     101    0.2890360E+00
ComputeChange: NS (ITER=41) (NRM,RELC): (  46099508.     0.20411133E-08 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0088 (s)
      10    0.2884157E+00
      20    0.2884157E+00
      30    0.2884157E+00
      40    0.2884157E+00
      50    0.2884157E+00
      60    0.2884157E+00
      70    0.2884157E+00
      80    0.2884157E+00
      90    0.2884157E+00
     100    0.2884157E+00
     101    0.2884157E+00
ComputeChange: NS (ITER=42) (NRM,RELC): (  46099508.     0.20435097E-08 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0088 (s)
      10    0.2878250E+00
      20    0.2878250E+00
      30    0.2878250E+00
      40    0.2878250E+00
      50    0.2878250E+00
      60    0.2878250E+00
      70    0.2878250E+00
      80    0.2878250E+00
      90    0.2878250E+00
     100    0.2878250E+00
     101    0.2878250E+00
ComputeChange: NS (ITER=43) (NRM,RELC): (  46099508.     0.20397776E-08 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0087 (s)
      10    0.2872639E+00
      20    0.2872639E+00
      30    0.2872639E+00
      40    0.2872639E+00
      50    0.2872639E+00
      60    0.2872639E+00
      70    0.2872639E+00
      80    0.2872639E+00
      90    0.2872639E+00
     100    0.2872639E+00
     101    0.2872639E+00
ComputeChange: NS (ITER=44) (NRM,RELC): (  46099508.     0.20421786E-08 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0089 (s)
      10    0.2867229E+00
      20    0.2867229E+00
      30    0.2867229E+00
      40    0.2867229E+00
      50    0.2867229E+00
      60    0.2867229E+00
      70    0.2867229E+00
      80    0.2867229E+00
      90    0.2867229E+00
     100    0.2867229E+00
     101    0.2867229E+00
ComputeChange: NS (ITER=45) (NRM,RELC): (  46099508.     0.20369681E-08 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0088 (s)
      10    0.2862062E+00
      20    0.2862062E+00
      30    0.2862062E+00
      40    0.2862062E+00
      50    0.2862062E+00
      60    0.2862062E+00
      70    0.2862062E+00
      80    0.2862062E+00
      90    0.2862062E+00
     100    0.2862062E+00
     101    0.2862062E+00
ComputeChange: NS (ITER=46) (NRM,RELC): (  46099507.     0.20384468E-08 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0089 (s)
      10    0.2857084E+00
      20    0.2857084E+00
      30    0.2857084E+00
      40    0.2857084E+00
      50    0.2857084E+00
      60    0.2857084E+00
      70    0.2857084E+00
      80    0.2857084E+00
      90    0.2857084E+00
     100    0.2857084E+00
     101    0.2857084E+00
ComputeChange: NS (ITER=47) (NRM,RELC): (  46099507.     0.20342612E-08 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0089 (s)
      10    0.2852313E+00
      20    0.2852313E+00
      30    0.2852313E+00
      40    0.2852313E+00
      50    0.2852313E+00
      60    0.2852313E+00
      70    0.2852313E+00
      80    0.2852313E+00
      90    0.2852313E+00
     100    0.2852313E+00
     101    0.2852313E+00
ComputeChange: NS (ITER=48) (NRM,RELC): (  46099507.     0.20353544E-08 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0090 (s)
      10    0.2847728E+00
      20    0.2847728E+00
      30    0.2847728E+00
      40    0.2847728E+00
      50    0.2847728E+00
      60    0.2847728E+00
      70    0.2847728E+00
      80    0.2847728E+00
      90    0.2847728E+00
     100    0.2847728E+00
     101    0.2847728E+00
ComputeChange: NS (ITER=49) (NRM,RELC): (  46099507.     0.20321414E-08 ) :: mgdyn
MGDynAssembly: Elapsed REAL time:     0.0089 (s)
      10    0.2843327E+00
      20    0.2843327E+00
      30    0.2843327E+00
      40    0.2843327E+00
      50    0.2843327E+00
      60    0.2843327E+00
      70    0.2843327E+00
      80    0.2843327E+00
      90    0.2843327E+00
     100    0.2843327E+00
     101    0.2843327E+00
ComputeChange: NS (ITER=50) (NRM,RELC): (  46099507.     0.20332761E-08 ) :: mgdyn
ComputeChange: SS (ITER=1) (NRM,RELC): (  46099507.      2.0000000     ) :: mgdyn
MagnetoDynamicsCalcFields: Computing postprocessed fields
MagnetoDynamicsCalcFields: Eddy current power:    0.000000E+00
MagnetoDynamicsCalcFields: ElectroMagnetic Field Energy:    9.095542E+08
ComputeChange: SS (ITER=1) (NRM,RELC): (  0.0000000      0.0000000     ) :: mgdynpost
ResultOutputSolver: -------------------------------------
ResultOutputSolver: Saving with prefix: case
ResultOutputSolver: Creating list for saving - if not present
CreateListForSaving: Field Variables for Saving
ResultOutputSolver: Saving in unstructured VTK XML (.vtu) format
VtuOutputSolver: Saving results in VTK XML format with prefix: case
VtuOutputSolver: Saving number of partitions: 1
ResultOutputSolver: -------------------------------------
MAIN: *** Elmer Solver: ALL DONE ***
ReleaseMeshFaceTables: Releasing number of faces: 894
MAIN: The end
SOLVER TOTAL TIME(CPU,REAL):         1.26        2.70
ELMER SOLVER FINISHED AT: 2024/05/09 08:56:17

Does anyone have some advice on getting the sim to converge properly or is this a case where Elmer won't be happy simulating this sort of scenario?

model.geo

Code: Select all

SetFactory("OpenCASCADE");
Box(1) = {-50, -50, -50, 100, 100, 100};
Rotate {{1, 1, 1}, {0, 0, 0}, Pi/4} { Volume{1}; }
case.sif (this is the one that works for the cube without the rotational transformation)

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
  Solver Input File = case.sif
  Post File = case.vtu
End

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

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

Solver 1
  Equation = MgDyn
  Procedure = "MagnetoDynamics" "WhitneyAVSolver"
  Exec Solver = Always
  Optimize Bandwidth = True
  Steady State Convergence Tolerance = 1.0e-8
  Nonlinear System Convergence Tolerance = 1.0e-10
  Nonlinear System Max Iterations = 500
  Nonlinear System Newton After Iterations = 5
  Nonlinear System Newton After Tolerance = 1.0e-4
  Nonlinear System Relaxation Factor = 1
  Linear System Solver = Iterative
! Bicgstabl is usually performing well for AV solver
  Linear System Iterative Method = BiCGStabl
  Linear System Max Iterations = 500
  Linear System Convergence Tolerance = 1.0e-10
  BiCGstabl polynomial degree = 4
! We cannot use ILU since vector potential is not uniquely defined
  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 2
  Equation = MgDynPost
  Calculate Magnetic Field Strength = True
  Procedure = "MagnetoDynamics" "MagnetoDynamicsCalcFields"
  Exec Solver = Always
  Optimize Bandwidth = True
  Steady State Convergence Tolerance = 1.0e-5
  Linear System Solver = Iterative
  Linear System Iterative Method = BiCGStab
  Linear System Max Iterations = 500
  Linear System Convergence Tolerance = 1.0e-10
  Linear System Preconditioning = ILU0
  Linear System Abort Not Converged = False
  Linear System Residual Output = 10
  Linear System Precondition Recompute = 1

  Calculate Nodal Fields = False
  Calculate Elemental Fields = True

! Perform the averaging within this solver
  Average Within Materials = Logical True
End

Solver 3
  Exec Solver = after timestep
  Equation = "ResultOutput"
  Procedure = "ResultOutputSolve" "ResultOutputSolver"
  Output File Name = f
  Vtu format = True
  Discontinuous Bodies = True
  ! bloated alternative for the above maintaining all discontinuities
  ! Discontinuous Galerkin = True 
  Save Geometry Ids = True
  ! use this only in conjunction with quadratic mesh   
  Save Linear Elements = True  
  Save Bulk Only = True 
  ! Save Boundaries Only = True 

  ! Enable saving of different parts to different files
  Vtu Part Collection = False
End

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

Material 1
  Name = "Air"
  Relative Permeability = 1.00000037
  Relative Permittivity = 1.00059
End

! We create an H-field (with a magnitude of 50 kA/m) that flows from the front face to the back face.
! We do this by generating H-fields at the front, back, left, and right faces.
! Note the sign of the field strength for the back face.
! The left and right faces generate an H-field in the direction of the *global* z-component.
! The front and back faces generate an H-field in the direction of the *global* y-component.
 
Boundary Condition 1
  Target Boundaries(1) = 1
  Name = "Front"
  Magnetic Field Strength 2 = Real 50000
End

Boundary Condition 2
  Target Boundaries(1) = 2
  Name = "Back"
  Magnetic Field Strength 2 = Real -50000
End

Boundary Condition 3
  Target Boundaries(1) = 5
  Name = "Left"
  Magnetic Field Strength 3 = Real 50000
End

Boundary Condition 4
  Target Boundaries(1) = 6
  Name = "Right"
  Magnetic Field Strength 3 = Real 50000
End

! Set the tangential components of the vector potential field to zero.
Boundary Condition 5
  Target Boundaries(2) = 3 4 
  Name = "Top_and_Bottom"
  AV {e} = Real 0
End

Cheers,
Nick
kevinarden
Posts: 2366
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Advice on solver settings for MagDyn

Post by kevinarden »

The far field boundaries specify the tangential components of the magnetic field H = (1/μ)B and the normal
component of current density J = σE′.

Your model is in cartesian so the farfield is rotated to the coordinate system. Because of this often you will see the far field as a sphere not a cube.

There is a normal-tangential displacement =true, and a normal-tangential velocity=true that makes these BC variables 1 to be normal and 2 to be tangential, but I don't think that would work in MAGDyn

You could try to set the normal components and not the resultant

Boundary Condition 5
Target Boundaries(2) = 3 4
Name = "Top_and_Bottom"
AV 1 {e} = Real 0
AV 2 {e} = Real 0
AV 3 {e} = Real 0
End
Nick_99
Posts: 49
Joined: 12 Jul 2023, 10:07
Antispam: Yes

Re: Advice on solver settings for MagDyn

Post by Nick_99 »

Hi Kevin,

Thanks so much for your help!

I did try your modification to Boundary Condition 5 but have not had any luck. I'll give your other suggestion a try too.

I'm trying to create an H-field at an arbitrary angle which is why I wanted to use the cube. I'll give a sphere a try.

Cheers,
Nick
kevinarden
Posts: 2366
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Advice on solver settings for MagDyn

Post by kevinarden »

You could try and specify the components of the field and leave the block un-rotated

Boundary Condition 2
Target Boundaries(1) = 2
Name = "Back"
Magnetic Field Strength 1 = Real -2500
Magnetic Field Strength 2 = Real -2500
End

where the values depend on the rotation of the field in the cube.
Nick_99
Posts: 49
Joined: 12 Jul 2023, 10:07
Antispam: Yes

Re: Advice on solver settings for MagDyn

Post by Nick_99 »

Hmm I'll give that a try again.Towards the end of last year, I made a post about specifying the components of the H-field through the boundary conditions so that the field could be created in an arbitrary direction, but Peter (raback) had this to say:
raback wrote: 01 Nov 2023, 19:49 Hi

The coordinate system is standard cartesian one.

The field cannot be directly imposed but instead a small system is solved and the magnetic field strength is transformed to a BC for the vector potential. Here is a caveat since the BCs can only be set in the direction of the edges of the boundary. Tangential vector potential relates to normal component of magnetic field strength.

-Peter
Peter's remark is why I've tried to rotate the cube, with the H-field, so that I can get an arbitrary field direction for objects placed inside of it.

Do you think I'd have more success with this endeavor if I used a sphere and the BCs you suggest?

Thanks again for the help. It is very much appreciated.

Cheers,
Nick
kevinarden
Posts: 2366
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Advice on solver settings for MagDyn

Post by kevinarden »

I believe that is why a sphere is commonly used.
Nick_99
Posts: 49
Joined: 12 Jul 2023, 10:07
Antispam: Yes

Re: Advice on solver settings for MagDyn

Post by Nick_99 »

Ah ok.

I'll give that a shot.

Thanks so much for your help!!

Cheers,
Nick
Nick_99
Posts: 49
Joined: 12 Jul 2023, 10:07
Antispam: Yes

Re: Advice on solver settings for MagDyn

Post by Nick_99 »

Ok so I tried with a sphere but cannot get any convergence.

Here's the boundary condition:

Code: Select all

Boundary Condition 1
  Target Boundaries(1) = $ surf
  Name = surface
  Magnetic Field Strength 1 = Real 1.0
  Magnetic Field Strength 2 = Real 1.0
  Magnetic Field Strength 3 = Real 1.0
End
And this is the geometry I used:

Code: Select all

SetFactory("OpenCASCADE");
Sphere(1) = {0, 0, 0, 0.5, -Pi/2, Pi/2, 2*Pi};
Physical Volume("reg", 4) = {1};
Physical Surface("surf", 5) = {1};

I was thinking of just keep the cube and having the H-field perpendicular to the cube's faces. I would then just rotate the geometry inside of the cube to get the arbitrary field direction. Do you think that would work?
kevinarden
Posts: 2366
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Advice on solver settings for MagDyn

Post by kevinarden »

If you are putting an object in the cube, then I think it would work.
kevinarden
Posts: 2366
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Advice on solver settings for MagDyn

Post by kevinarden »

You may want to read through this thread, it has some similarities.

viewtopic.php?t=8014&start=10
Post Reply