Why B vector output all are 0 for horse-shoe magnet example

Numerical methods and mathematical models of Elmer
Post Reply
yuncheng
Posts: 5
Joined: 15 Apr 2015, 15:27
Antispam: Yes

Why B vector output all are 0 for horse-shoe magnet example

Post by yuncheng »

Hello,
This is Yuncheng.

I want to use elmer to calculate magnectic field and start from the tutorial of horseshoe.
I follow the userguide but the B vector output all are 0.

The OS is ubuntu 12.04 LTS and the elmer Library is version: 7.0 (Rev: 6506).

I use gmsh to do the meshing by
$gmsh horseshoe.geo -3 -order 2 > loggmsh_hs

then use ElmerGrid to proceed the meshing file
$ElmerGrid 14 2 horseshoe.msh -autoclean > loggrid_hs

and at last do the calculation by ElmerSolver
$ElmerSolver horseshoe.sif > logsolver_hs

All the processes go on well without error.
However, the output of B vector all are 0 as list in the file of horseshoe.ep.

I think some setting in horseshoe.sif
horseshoe.sif
full sif file
(3.6 KiB) Downloaded 286 times
might be not right, as partly shown below:

Code: Select all

! horseshoe.sif
!
! ElmerSolver input file for horseshoe permerment magnet
!
!
Check Keywords Warn

Header
  Mesh DB "." "horseshoe"
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
  Timestepping Method = BDF
  BDF Order = 1
  Solver Input File = horseshoe.sif
  Post File = horseshoe.ep
  Output File = "horseshoe.result"
End

... (skip)

Solver 1
  Equation = MgDyn2D
  Procedure = "MagnetoDynamics2D" "MagnetoDynamics2D"
  Variable = -dofs 1 Az
  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 = 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 = BiCGStab
  Linear System Max Iterations = 500
  Linear System Convergence Tolerance = 1.0e-10
  Linear System Preconditioning = ILU0
  Linear System ILUT Tolerance = 1.0e-3
  Linear System Abort Not Converged = False
  Linear System Residual Output = 1
  Linear System Precondition Recompute = 1
End

Solver 2
  Equation = MgDyn2DPost
  Procedure = "MagnetoDynamics2D" "BSolver"
  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 = 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 = BiCGStab
  Linear System Max Iterations = 500
  Linear System Convergence Tolerance = 1.0e-10
  Linear System Preconditioning = ILU0
  Linear System ILUT Tolerance = 1.0e-3
  Linear System Abort Not Converged = False
  Linear System Residual Output = 1
  Linear System Precondition Recompute = 1
End

please also check the attached files:
horseshoe.geo,
horseshoe.geo
horseshoe.geo
(1.53 KiB) Downloaded 274 times
horseshoe.sif
horseshoe.sif
full sif file
(3.6 KiB) Downloaded 286 times
and part of the horseshoe.ep (full file exceed 1M )
horseshoe-part.ep
part of output file horseshoe.ep
(4.69 KiB) Downloaded 260 times
for more detailed information.

I'd much appriciate of your hlep.

Best regards,

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

Re: Why B vector output all are 0 for horse-shoe magnet example

Post by raback »

Hi

It may be that the b-field is save elementwise and ElmerPost cannot handle that. Use paraview instead. For that aim change the suffix .ep to .vtu.

-Peter
yuncheng
Posts: 5
Joined: 15 Apr 2015, 15:27
Antispam: Yes

Re: Why B vector output all are 0 for horse-shoe magnet example

Post by yuncheng »

raback wrote:Hi

It may be that the b-field is save elementwise and ElmerPost cannot handle that. Use paraview instead. For that aim change the suffix .ep to .vtu.

-Peter
Thanks Peter for your suggestion.

However, I do not follow you quite well.
How should I modify correspondingly in the horseshoe.sif ?

I would like to have the B vector output in a plain text file.
Do you have suggestions?

Besides, I checked the calculation results (in Linux ubuntu) in ElmerGUI at Windows 8.
The postprocesser show the magnet flux Az as the attached graph
Az shown in postprocesser of ElmerGUI at Windows 8
Az shown in postprocesser of ElmerGUI at Windows 8
horseshoe.jpg (13.52 KiB) Viewed 5202 times
,
which seems good.



Yuncheng
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Why B vector output all are 0 for horse-shoe magnet example

Post by mzenker »

Hi,
yuncheng wrote:
raback wrote:
It may be that the b-field is save elementwise and ElmerPost cannot handle that. Use paraview instead. For that aim change the suffix .ep to .vtu.

-Peter
Thanks Peter for your suggestion.

However, I do not follow you quite well.
How should I modify correspondingly in the horseshoe.sif ?
in the Simulation section, there is a line

Post File = horseshoe.ep

which you should change to

Post File = horseshoe.vtu

HTH,

Matthias
yuncheng
Posts: 5
Joined: 15 Apr 2015, 15:27
Antispam: Yes

Re: Why B vector output all are 0 for horse-shoe magnet example

Post by yuncheng »

mzenker wrote: in the Simulation section, there is a line

Post File = horseshoe.ep

which you should change to

Post File = horseshoe.vtu

HTH,

Matthias
Thanks Matthias,
I modify the sif file as your suggestion
for " Post File "
from the original "horseshoe.ep" to "horseshoe.vtu".

The ElmerSolver works well for the new setting and
the output file is saved as horseshoe0001.vtu

It turns out that the same issue remains there:
The magnet flux Az seems fine, but
all the output for B vector are 0.
Check the attached screenshot
horseshoe-paraview.png
paraview screenshot of horsesho.vtu
(130.88 KiB) Not downloaded yet

for more detail, where the range of vector-B in the middle left are
"b double [0,0] [0,0] [0,0]".




I found that
whether set the "Post File" as "horseshoe.ep" (log_hs
log_hs.txt
log for "Post File = horseshoe.ep"
(5.64 KiB) Downloaded 256 times
)or
"horseshoe.vtu" (log_hs2
log_hs2.txt
log for "Post File = horseshoe.vtu"
(6.61 KiB) Downloaded 251 times
),
the log shows the same for the "BSolver" as
"BSolver: -------------------------------------
ComputeChange: SS (ITER=1) (NRM,RELC): ( 0.0000000 0.0000000 )"

Does this means that the "BSolver" not work at first hand?

Any other ideas?

Best regards,
Yuncheng
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Why B vector output all are 0 for horse-shoe magnet example

Post by raback »

Hi Yuncheng

Unfortunately your version of Elmer is so old that these tests are not relevant any more. Please use a fresh version.

-Peter
yuncheng
Posts: 5
Joined: 15 Apr 2015, 15:27
Antispam: Yes

Re: Why B vector output all are 0 for horse-shoe magnet example

Post by yuncheng »

raback wrote:Hi Yuncheng

Unfortunately your version of Elmer is so old that these tests are not relevant any more. Please use a fresh version.

-Peter
En...
I think It is a good time to update my good old ubuntu 12.04 and also Elmer.
Will update the status later.

Best regards,
Yuncheng
yuncheng
Posts: 5
Joined: 15 Apr 2015, 15:27
Antispam: Yes

Re: Why B vector output all are 0 for horse-shoe magnet example

Post by yuncheng »

raback wrote:Hi Yuncheng

Unfortunately your version of Elmer is so old that these tests are not relevant any more. Please use a fresh version.

-Peter
I update OS to Ubuntu 14.04 LTS and
the fresh Elmer version is the binaries one for Ubuntu
https://www.csc.fi/web/elmer/binaries

I checked for the log of ElmerSolver and found the Elmer Library is version: 7.0.
While the previous Library was also version 7.0 but with the detail information (Rev: 6506).

I redone the processes as same as my first post.
The issue is still there:
the vector B are 0
whether the post file is horseshoe.vtu
log_hs3.txt
log for ElmerSolver with post file output as vtu format
(6.79 KiB) Downloaded 269 times
or horseshoe.ep
log_hs4.txt
log for ElmerSolver with post file output as ep format
(5.82 KiB) Downloaded 248 times
.

I attached screen shot of the horseshoe.vtu opened by paraview
horseshoe_paraview2.png
new post file opened by paraview
(136.33 KiB) Not downloaded yet
.
Check the left middle of the graph, one can find that the B-vector always zero,
While the az is differ slightly for the last digit If compare with previous one.


Waiting for you comments.

Best regards,
Yuncheng
lsouza
Posts: 4
Joined: 02 Jun 2020, 01:48
Antispam: Yes

Re: Why B vector output all are 0 for horse-shoe magnet example

Post by lsouza »

After so much time, you may have found a solution to the zero field issue.
Just in case, here is the solution thanks to raback: viewtopic.php?f=4&t=6420
Post Reply