## Coupled system convergence tolerance

Numerical methods and mathematical models of Elmer

### Coupled system convergence tolerance

Hi,

I have a convergence problem with a transient coupled thermal-electric simulation with phase change. The after doing some timesteps with apparently good results, the solver starts to accept poor convergence for the current timestep and continues with the next one, even though the max. coupled iterations are by far not reached. The temperature distribution starts to look spotted
for those poorly converged timesteps.
Here are the relevant parts of the sif file:

Code: Select all
`Simulation  (...)  Simulation Type = Transient  Steady State Max Iterations = 100  Output Intervals = 1  Timestepping Method = BDF  BDF Order = 1  Timestep intervals = 50  Timestep Sizes = 0.02  (...)EndSolver 1  Equation = Static Current Conduction  Calculate Volume Current = True  Procedure = "StatCurrentSolve" "StatCurrentSolver"  Variable = -dofs 1 Potential  Calculate Joule Heating = True  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-8  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 = BiCGStabl  Linear System Max Iterations = 500  Linear System Convergence Tolerance = 1.0e-12  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 = 1EndSolver 2  Equation = Result Output  (...)EndSolver 3  Equation = Heat Equation  Variable = -dofs 1 Temperature  Procedure = "HeatSolve" "HeatSolver"  Exec Solver = Always  Stabilize = True  Bubbles = False  Lumped Mass Matrix = False  Optimize Bandwidth = True  Steady State Convergence Tolerance = 1.0e-8  Nonlinear System Convergence Tolerance = 1.0e-8  Nonlinear System Max Iterations = 2  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  Linear System Max Iterations = 500  Linear System Convergence Tolerance = 1.0e-8  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 = 1EndEquation 1  Name = "Current + Heat"  Phase Change Model = Spatial 2  Active Solvers(3) = 1 2 3End`

And here is an extract of the solver log for a timestep with poor convergence:

Code: Select all
`(...)SolveEquations: -------------------------------------SolveEquations:  Coupled system iteration:            1SolveEquations: -------------------------------------StatCurrentSolve: -------------------------------------StatCurrentSolve: STAT CURRENT SOLVER:StatCurrentSolve: -------------------------------------StatCurrentSolve: Starting Assembly...StatCurrentSolve:  Assembly (s)          :   1.9999999999999236ComputeChange: NS (ITER=1) (NRM,RELC): (  117.00480      0.0000000     ) :: static current conductionStatCurrentSolve:  Solve (s)             : -7.63833440942107700E-014StatCurrentSolve:  Total Heating Power   :   31804.078264161995StatCurrentSolve:  Effective Resistance  :   1.2577003385466281ComputeChange: SS (ITER=1) (NRM,RELC): (  117.00480      0.0000000     ) :: static current conductionHeatSolve: HeatSolve: HeatSolve: -------------------------------------HeatSolve:  TEMPERATURE ITERATION           1HeatSolve: -------------------------------------HeatSolve: HeatSolve: Starting Assembly...HeatSolve: Assembly done       1 0.1762E-01     (...)     112 0.8881E-08ComputeChange: NS (ITER=1) (NRM,RELC): (  83.300085     0.45161252E-01 ) :: heat equationHeatSolve: iter:    1 Assembly: (s)    6.11    6.11HeatSolve: iter:    1 Solve:    (s)    0.23    0.23HeatSolve:  Result Norm   :    83.300085462793945HeatSolve:  Relative Change :   4.51612520398491507E-002HeatSolve: HeatSolve: HeatSolve: -------------------------------------HeatSolve:  TEMPERATURE ITERATION           2HeatSolve: -------------------------------------HeatSolve: HeatSolve: Starting Assembly...HeatSolve: Assembly done       1 0.1396E-02       (...)      54 0.8864E-08ComputeChange: NS (ITER=2) (NRM,RELC): (  81.139800     0.26274471E-01 ) :: heat equationHeatSolve: iter:    2 Assembly: (s)    6.11   12.22HeatSolve: iter:    2 Solve:    (s)    0.09    0.33HeatSolve:  Result Norm   :    81.139799978051713HeatSolve:  Relative Change :   2.62744708067722023E-002ComputeChange: SS (ITER=1) (NRM,RELC): (  81.139800     0.18892386E-01 ) :: heat equationSolveEquations: -------------------------------------SolveEquations:  Coupled system iteration:            2SolveEquations: -------------------------------------StatCurrentSolve: -------------------------------------StatCurrentSolve: STAT CURRENT SOLVER:StatCurrentSolve: -------------------------------------StatCurrentSolve: Starting Assembly...StatCurrentSolve:  Assembly (s)          :   1.9849999999999235       1 0.5787E-09 0.5787E-09    (...)      15 0.9473E-12 0.9473E-12ComputeChange: NS (ITER=1) (NRM,RELC): (  116.98967     0.12931152E-03 ) :: static current conductionStatCurrentSolve:  Solve (s)             :  4.70000000000236895E-002StatCurrentSolve:  Total Heating Power   :   31904.711572778178StatCurrentSolve:  Effective Resistance  :   1.2537333211352051ComputeChange: SS (ITER=2) (NRM,RELC): (  116.98967     0.12931152E-03 ) :: static current conductionHeatSolve: HeatSolve: HeatSolve: -------------------------------------HeatSolve:  TEMPERATURE ITERATION           1HeatSolve: -------------------------------------HeatSolve: HeatSolve: Starting Assembly...HeatSolve: Assembly done       1 0.9249E-02      (...)      64 0.9661E-08ComputeChange: NS (ITER=1) (NRM,RELC): (  83.313707     0.26437953E-01 ) :: heat equationHeatSolve: iter:    1 Assembly: (s)    6.11    6.11HeatSolve: iter:    1 Solve:    (s)    0.11    0.11HeatSolve:  Result Norm   :    83.313706986101451HeatSolve:  Relative Change :   2.64379525639863305E-002HeatSolve: HeatSolve: HeatSolve: -------------------------------------HeatSolve:  TEMPERATURE ITERATION           2HeatSolve: -------------------------------------HeatSolve: HeatSolve: Starting Assembly...HeatSolve: Assembly done       1 0.1405E-02      (...)      54 0.9047E-08ComputeChange: NS (ITER=2) (NRM,RELC): (  81.133379     0.26517074E-01 ) :: heat equationHeatSolve: iter:    2 Assembly: (s)    6.11   12.22HeatSolve: iter:    2 Solve:    (s)    0.08    0.19HeatSolve:  Result Norm   :    81.133379175050379HeatSolve:  Relative Change :   2.65170744213057592E-002ComputeChange: SS (ITER=2) (NRM,RELC): (  81.133379     0.79135727E-04 ) :: heat equationSolveEquations: -------------------------------------SolveEquations:  Coupled system iteration:            3SolveEquations: -------------------------------------StatCurrentSolve: -------------------------------------StatCurrentSolve: STAT CURRENT SOLVER:StatCurrentSolve: -------------------------------------StatCurrentSolve: Starting Assembly...StatCurrentSolve:  Assembly (s)          :   1.9839999999999471       1 0.4685E-11 0.4685E-11      (...)       4 0.9764E-12 0.9764E-12ComputeChange: NS (ITER=1) (NRM,RELC): (  116.98979     0.10205233E-05 ) :: static current conductionStatCurrentSolve:  Solve (s)             :  1.60000000000236620E-002StatCurrentSolve:  Total Heating Power   :   31904.464872124234StatCurrentSolve:  Effective Resistance  :   1.2537430156037204ComputeChange: SS (ITER=3) (NRM,RELC): (  116.98979     0.10205233E-05 ) :: static current conductionHeatSolve: HeatSolve: HeatSolve: -------------------------------------HeatSolve:  TEMPERATURE ITERATION           1HeatSolve: -------------------------------------HeatSolve: HeatSolve: Starting Assembly...HeatSolve: Assembly done       1 0.9249E-02      (...)      62 0.9749E-08ComputeChange: NS (ITER=1) (NRM,RELC): (  83.313655     0.26516446E-01 ) :: heat equationHeatSolve: iter:    1 Assembly: (s)    6.09    6.09HeatSolve: iter:    1 Solve:    (s)    0.09    0.09HeatSolve:  Result Norm   :    83.313654659938592HeatSolve:  Relative Change :   2.65164464696391669E-002HeatSolve: HeatSolve: HeatSolve: -------------------------------------HeatSolve:  TEMPERATURE ITERATION           2HeatSolve: -------------------------------------HeatSolve: HeatSolve: Starting Assembly...HeatSolve: Assembly done       1 0.1405E-02      (...)      54 0.9048E-08ComputeChange: NS (ITER=2) (NRM,RELC): (  81.133398     0.26516210E-01 ) :: heat equationHeatSolve: iter:    2 Assembly: (s)    6.11   12.20HeatSolve: iter:    2 Solve:    (s)    0.09    0.19HeatSolve:  Result Norm   :    81.133398389646985HeatSolve:  Relative Change :   2.65162096840275627E-002ComputeChange: SS (ITER=3) (NRM,RELC): (  81.133398     0.23682724E-06 ) :: heat equationSolveEquations: -------------------------------------SolveEquations:  Coupled system iteration:            4SolveEquations: -------------------------------------StatCurrentSolve: -------------------------------------StatCurrentSolve: STAT CURRENT SOLVER:StatCurrentSolve: -------------------------------------StatCurrentSolve: Starting Assembly...StatCurrentSolve:  Assembly (s)          :   1.9839999999999200       1 0.6384E-12 0.6384E-12       1 0.6384E-12 0.6384E-12ComputeChange: NS (ITER=1) (NRM,RELC): (  116.98980     0.13411593E-06 ) :: static current conductionStatCurrentSolve:  Solve (s)             : -3.66373598126301658E-015StatCurrentSolve:  Total Heating Power   :   31904.465489607817StatCurrentSolve:  Effective Resistance  :   1.2537429913385989ComputeChange: SS (ITER=4) (NRM,RELC): (  116.98980     0.13411593E-06 ) :: static current conductionHeatSolve: HeatSolve: HeatSolve: -------------------------------------HeatSolve:  TEMPERATURE ITERATION           1HeatSolve: -------------------------------------HeatSolve: HeatSolve: Starting Assembly...HeatSolve: Assembly done       1 0.9249E-02       (...)      62 0.9737E-08ComputeChange: NS (ITER=1) (NRM,RELC): (  83.313655     0.26516209E-01 ) :: heat equationHeatSolve: iter:    1 Assembly: (s)    6.12    6.12HeatSolve: iter:    1 Solve:    (s)    0.11    0.11HeatSolve:  Result Norm   :    83.313654600430993HeatSolve:  Relative Change :   2.65162089698932589E-002HeatSolve: HeatSolve: HeatSolve: -------------------------------------HeatSolve:  TEMPERATURE ITERATION           2HeatSolve: -------------------------------------HeatSolve: HeatSolve: Starting Assembly...HeatSolve: Assembly done       1 0.1405E-02      (...)      54 0.9047E-08ComputeChange: NS (ITER=2) (NRM,RELC): (  81.133399     0.26516198E-01 ) :: heat equationHeatSolve: iter:    2 Assembly: (s)    6.11   12.23HeatSolve: iter:    2 Solve:    (s)    0.08    0.19HeatSolve:  Result Norm   :    81.133399245450335HeatSolve:  Relative Change :   2.65161984236455782E-002ComputeChange: SS (ITER=4) (NRM,RELC): (  81.133399     0.10548102E-07 ) :: heat equationSolveEquations: -------------------------------------SolveEquations:  Coupled system iteration:            5SolveEquations: -------------------------------------StatCurrentSolve: -------------------------------------StatCurrentSolve: STAT CURRENT SOLVER:StatCurrentSolve: -------------------------------------StatCurrentSolve: Starting Assembly...StatCurrentSolve:  Assembly (s)          :   1.9840000000000964ComputeChange: NS (ITER=1) (NRM,RELC): (  116.98980      0.0000000     ) :: static current conductionStatCurrentSolve:  Solve (s)             :  1.59999999999453912E-002StatCurrentSolve:  Total Heating Power   :   31904.465516701024StatCurrentSolve:  Effective Resistance  :   1.2537429902739228ComputeChange: SS (ITER=5) (NRM,RELC): (  116.98980      0.0000000     ) :: static current conductionHeatSolve: HeatSolve: HeatSolve: -------------------------------------HeatSolve:  TEMPERATURE ITERATION           1HeatSolve: -------------------------------------HeatSolve: HeatSolve: Starting Assembly...HeatSolve: Assembly done       1 0.9249E-02      (...)      62 0.9732E-08ComputeChange: NS (ITER=1) (NRM,RELC): (  83.313655     0.26516199E-01 ) :: heat equationHeatSolve: iter:    1 Assembly: (s)    6.11    6.11HeatSolve: iter:    1 Solve:    (s)    0.09    0.09HeatSolve:  Result Norm   :    83.313654610791588HeatSolve:  Relative Change :   2.65161985479802145E-002HeatSolve: HeatSolve: HeatSolve: -------------------------------------HeatSolve:  TEMPERATURE ITERATION           2HeatSolve: -------------------------------------HeatSolve: HeatSolve: Starting Assembly...HeatSolve: Assembly done       1 0.1405E-02       (...)      54 0.9047E-08ComputeChange: NS (ITER=2) (NRM,RELC): (  81.133399     0.26516198E-01 ) :: heat equationHeatSolve: iter:    2 Assembly: (s)    6.13   12.23HeatSolve: iter:    2 Solve:    (s)    0.08    0.17HeatSolve:  Result Norm   :    81.133399293935781HeatSolve:  Relative Change :   2.65161979504836900E-002ComputeChange: SS (ITER=5) (NRM,RELC): (  81.133399     0.59760157E-09 ) :: heat equationMAIN: MAIN: -------------------------------------MAIN:  Time: 19/50  0.38000000000000006MAIN:  Estimated time left: 44 minutes.MAIN: -------------------------------------MAIN: ResultOutputSolver: -------------------------------------ResultOutputSolver: Working on mesh: .ResultOutputSolver: Dimension of mesh: 2ResultOutputSolver: Saving in unstructured VTK XML (.vtu) formatVtuOutputSolver: Saving to file: ./myresult0019.vtuResultOutputSolver: -------------------------------------SolveEquations: -------------------------------------SolveEquations:  Coupled system iteration:            1SolveEquations: -------------------------------------(...)`

So the relative change is still 2.65e-3 (it is below 1e-8 for the timesteps where the convergence was OK), but the solver contiunes with the next timestep after only 5 coupled interations.
I have already tried if setting the steady state convergence tolerance to 1e-8 (was 1e-5 before) in HeatSolver changes anything - it doesn't.
What did I do wrong here?

Thank you for a helpful hint,

Matthias
mzenker

Posts: 665
Joined: 07 Dec 2009, 11:49

### Re: Coupled system convergence tolerance

Hi again,

I am stuck with this convergence issue at the moment - could someone from the Elmer team enlighten me on the subject? I have read the corresponding sections in the Elmersolver manual, but didn't find the answer there...

Thank you,

Matthias
mzenker

Posts: 665
Joined: 07 Dec 2009, 11:49

### Re: Coupled system convergence tolerance

Hi,

after digging into the Elmersolver code and studying the solver log again, I think I have found the answer myself:

The convergence measure for the coupled simulation is found by comparing the norm of the heat equation between the last two iterations. The important point is that the norm is taken at the end of the coupled interations.
The convergence measure for the heat equation alone is found by comparing the norms of two successive iterations of the heat equation.
Now the problem is that the heat equation may not have converged, but the relative change to the norm at the end of the last coupled iteration may be so small that the coupled iteration thinks that convergence is reached altogether.

Solution: Set Nonlinear System Max Iterations = 1 in heat solver.

Now I still have convergence problems, but at least the iterations are not aborted before convergence is reached...

Matthias
mzenker

Posts: 665
Joined: 07 Dec 2009, 11:49