Capacitance matrix at each iteration in steady state

Numerical methods and mathematical models of Elmer
Post Reply
Koji
Posts: 1
Joined: 13 Jul 2020, 10:06
Antispam: Yes

Capacitance matrix at each iteration in steady state

Post by Koji »

Dear all

I calculated a capacitance matrix in electrostatic simulation.
But the value of the capacitance seems wrong because the resulting value is different by several orders comparing with value calculated by hand.
Then I added "Steady State Min Iterations = 5" to check if the problem comes from convergence.
The output on the command line was below.

Code: Select all

ELMER SOLVER (v 8.4) STARTED AT: 2020/07/14 11:32:56
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: 8.4 (Rev: Release, Compiled: 2020-04-08)
MAIN:  Running one task without MPI parallelization.
MAIN:  Running with just one thread per task.
MAIN:  Lua interpreted linked in.
MAIN: =============================================================
MAIN:
MAIN:
MAIN: -------------------------------------
MAIN: Reading Model: ./Tests/20200707_Electrostatic.sif
LoadInputFile: Scanning input file: ./Tests/20200707_Electrostatic.sif
LoadInputFile: Loading input file: ./Tests/20200707_Electrostatic.sif
LoadInputFile: Number of BCs: 3
LoadInputFile: Number of Body Forces: 0
LoadInputFile: Number of Initial Conditions: 0
LoadInputFile: Number of Materials: 2
LoadInputFile: Number of Equations: 1
LoadInputFile: Number of Solvers: 3
LoadInputFile: Number of Bodies: 3
Loading user function library: [StatElecSolve]...[Statelecsolver_Init0]
Loading user function library: [FluxSolver]...[FluxSolver_Init0]
Loading user function library: [ResultOutputSolve]...[ResultOutputSolver_Init0]
LoadMesh: Base mesh name: ./tests/20200707_Electrostatic
MAIN: -------------------------------------
Loading user function library: [StatElecSolve]...[Statelecsolver_Init]
Loading user function library: [StatElecSolve]...[Statelecsolver_bulk]
Loading user function library: [StatElecSolve]...[Statelecsolver]
OptimizeBandwidth: ---------------------------------------------------------
OptimizeBandwidth: Computing matrix structure for: stat elec solver...done.
OptimizeBandwidth: Half bandwidth without optimization: 5999
OptimizeBandwidth:
OptimizeBandwidth: Bandwidth Optimization ...done.
OptimizeBandwidth: Half bandwidth after optimization: 935
OptimizeBandwidth: ---------------------------------------------------------
Loading user function library: [FluxSolver]...[FluxSolver_Init]
FluxSolver_init: Saving gradient to: potential Grad
Loading user function library: [FluxSolver]...[FluxSolver_bulk]
Loading user function library: [FluxSolver]...[FluxSolver]
OptimizeBandwidth: ---------------------------------------------------------
OptimizeBandwidth: Computing matrix structure for: flux solver...done.
OptimizeBandwidth: Half bandwidth without optimization: 5999
OptimizeBandwidth:
OptimizeBandwidth: Bandwidth Optimization ...done.
OptimizeBandwidth: Half bandwidth after optimization: 935
OptimizeBandwidth: ---------------------------------------------------------
Loading user function library: [ResultOutputSolve]...[ResultOutputSolver_Init]
Loading user function library: [ResultOutputSolve]...[ResultOutputSolver_bulk]
Loading user function library: [ResultOutputSolve]...[ResultOutputSolver]
ElmerSolver: Number of timesteps to be saved: 1000
MAIN:
MAIN: -------------------------------------
MAIN:  Steady state iteration:            1
MAIN: -------------------------------------
MAIN:
StatElecSolve: -------------------------------------
StatElecSolve: STATELEC SOLVER:
StatElecSolve: -------------------------------------
StatElecSolve:
StatElecSolve: Electrostatic iteration: 1
StatElecSolve: Starting Assembly...
 Number of permutation BCs
 Capacitance body:           1 no         737
 Capacitance body:           2 no         734
 Capacitance body:           3 no         730
StatElecSolve:  Assembly (s)          :  0.15899999999999997
      10 0.9406E-02
      20 0.7051E-03
      30 0.2807E-04
      40 0.3112E-06
      50 0.5099E-09
      60 0.2195E-11
      63 0.1876E-12
ComputeChange: NS (ITER=1) (NRM,RELC): ( 0.55720619      2.0000000     ) :: stat elec solver
StatElecSolve:  Solve (s)             :   3.2000000000000028E-002
StatElecSolve:  Tot. Electric Energy  :   2.3980052580684331E-012
StatElecSolve:
StatElecSolve: Electrostatic iteration: 2
StatElecSolve: Starting Assembly...
StatElecSolve:  Assembly (s)          :   7.0000000000000062E-003
      10 0.6199E-01
      20 0.8504E-02
      30 0.2607E-05
      40 0.6887E-07
      50 0.3689E-10
      58 0.4533E-12
ComputeChange: NS (ITER=2) (NRM,RELC): ( 0.50627909     0.95773953E-01 ) :: stat elec solver
StatElecSolve:  Solve (s)             :   3.1000000000000028E-002
StatElecSolve:  Tot. Electric Energy  :   2.1384833679360193E-012
StatElecSolve:
StatElecSolve: Electrostatic iteration: 3
StatElecSolve: Starting Assembly...
StatElecSolve:  Assembly (s)          :   7.0000000000000062E-003
      10 0.4756E-02
      20 0.3425E-04
      30 0.2544E-05
      40 0.6630E-08
      50 0.1122E-08
      57 0.6282E-12
ComputeChange: NS (ITER=3) (NRM,RELC): ( 0.50588142     0.78579456E-03 ) :: stat elec solver
StatElecSolve:  Solve (s)             :   3.0999999999999917E-002
StatElecSolve:  Tot. Electric Energy  :   2.1311631169550823E-012
StatElecSolve: Capacitance matrix computation performed (i,j,C_ij)
StatElecSolve:   1  1    1.76105E-22
StatElecSolve:   1  2    2.40533E-12
StatElecSolve:   1  3    2.39069E-12
StatElecSolve:   2  2   -1.67322E-23
StatElecSolve:   2  3    1.87164E-12
StatElecSolve:   3  3   -7.20318E-23
StatElecSolve: Capacitance matrix was saved to file cmatrix.dat
Loading user function library: [StatElecSolve]...[Statelecsolver_post]
ComputeChange: SS (ITER=1) (NRM,RELC): ( 0.50588142      2.0000000     ) :: stat elec solver
FluxSolver: -------------------------------------
FluxSolver: Computing the flux and/or gradient
FluxSolver: -------------------------------------
      10 0.3548E-08
      15 0.4156E-12
      10 0.1339E-07
      16 0.6462E-12
      10 0.1551E-07
      16 0.9364E-12
FluxSolver:  Result Norm:    0.0000000000000000
Loading user function library: [FluxSolver]...[FluxSolver_post]
SaveResult: -----------------------------------------
SaveResult: Saving results to file: ./tests/20200707_Electrostatic/20200707_electrostatic.result
SaveResult: -----------------------------------------
MAIN:
MAIN: -------------------------------------
MAIN:  Steady state iteration:            2
MAIN: -------------------------------------
MAIN:
StatElecSolve: -------------------------------------
StatElecSolve: STATELEC SOLVER:
StatElecSolve: -------------------------------------
StatElecSolve:
StatElecSolve: Electrostatic iteration: 1
StatElecSolve: Starting Assembly...
 Number of permutation BCs
 Capacitance body:           1 no         737
 Capacitance body:           2 no         734
 Capacitance body:           3 no         730
StatElecSolve:  Assembly (s)          :   8.0000000000000071E-003
      10 0.3414E+00
      20 0.3163E-03
      30 0.2456E-05
      40 0.4516E-07
      50 0.6458E-10
      59 0.7154E-13
ComputeChange: NS (ITER=1) (NRM,RELC): ( 0.55720619     0.96557931E-01 ) :: stat elec solver
StatElecSolve:  Solve (s)             :   2.9999999999999805E-002
StatElecSolve:  Tot. Electric Energy  :   2.3980052580684121E-012
StatElecSolve:
StatElecSolve: Electrostatic iteration: 2
StatElecSolve: Starting Assembly...
StatElecSolve:  Assembly (s)          :   6.0000000000000053E-003
      10 0.1833E-01
      20 0.1221E-02
      30 0.8304E-05
      40 0.4502E-07
      50 0.6239E-10
      59 0.4629E-12
ComputeChange: NS (ITER=2) (NRM,RELC): ( 0.50627909     0.95773953E-01 ) :: stat elec solver
StatElecSolve:  Solve (s)             :   3.0000000000000027E-002
StatElecSolve:  Tot. Electric Energy  :   2.1384833679360568E-012
StatElecSolve:
StatElecSolve: Electrostatic iteration: 3
StatElecSolve: Starting Assembly...
StatElecSolve:  Assembly (s)          :   8.0000000000000071E-003
      10 0.2768E-02
      20 0.1484E-03
      30 0.3943E-06
      40 0.2576E-07
      50 0.1272E-10
      57 0.2650E-12
ComputeChange: NS (ITER=3) (NRM,RELC): ( 0.50588142     0.78579456E-03 ) :: stat elec solver
StatElecSolve:  Solve (s)             :   2.8000000000000025E-002
StatElecSolve:  Tot. Electric Energy  :   2.1311631169551057E-012
StatElecSolve: Capacitance matrix computation performed (i,j,C_ij)
StatElecSolve:   1  1    4.79601E-12
StatElecSolve:   1  2    1.90428E-23
StatElecSolve:   1  3   -9.75550E-24
StatElecSolve:   2  2    4.27697E-12
StatElecSolve:   2  3    5.51464E-24
StatElecSolve:   3  3    4.26233E-12
StatElecSolve: Capacitance matrix was saved to file cmatrix.dat
Loading user function library: [StatElecSolve]...[Statelecsolver_post]
ComputeChange: SS (ITER=2) (NRM,RELC): ( 0.50588142     0.12731054E-11 ) :: stat elec solver
FluxSolver: -------------------------------------
FluxSolver: Computing the flux and/or gradient
FluxSolver: -------------------------------------
      10 0.1075E-07
      16 0.6262E-12
      10 0.1339E-07
      16 0.6462E-12
      10 0.1551E-07
      16 0.9364E-12
FluxSolver:  Result Norm:    0.0000000000000000
Loading user function library: [FluxSolver]...[FluxSolver_post]
MAIN:
MAIN: -------------------------------------
MAIN:  Steady state iteration:            3
MAIN: -------------------------------------
MAIN:
StatElecSolve: -------------------------------------
StatElecSolve: STATELEC SOLVER:
StatElecSolve: -------------------------------------
StatElecSolve:
StatElecSolve: Electrostatic iteration: 1
StatElecSolve: Starting Assembly...
 Number of permutation BCs
 Capacitance body:           1 no         737
 Capacitance body:           2 no         734
 Capacitance body:           3 no         730
StatElecSolve:  Assembly (s)          :   8.0000000000000071E-003
      10 0.5485E-02
      20 0.1525E-03
      30 0.3372E-05
      40 0.1394E-07
      50 0.1595E-09
      60 0.6929E-11
      62 0.7607E-12
ComputeChange: NS (ITER=1) (NRM,RELC): ( 0.55720619     0.96557931E-01 ) :: stat elec solver
StatElecSolve:  Solve (s)             :   3.1000000000000139E-002
StatElecSolve:  Tot. Electric Energy  :   2.3980052580684246E-012
StatElecSolve:
StatElecSolve: Electrostatic iteration: 2
StatElecSolve: Starting Assembly...
StatElecSolve:  Assembly (s)          :   6.9999999999996732E-003
      10 0.5852E-01
      20 0.6390E-03
      30 0.3408E-05
      40 0.5992E-07
      50 0.1946E-09
      60 0.6736E-11
      61 0.4149E-12
ComputeChange: NS (ITER=2) (NRM,RELC): ( 0.50627909     0.95773953E-01 ) :: stat elec solver
StatElecSolve:  Solve (s)             :   3.1000000000000139E-002
StatElecSolve:  Tot. Electric Energy  :   2.1384833679360601E-012
StatElecSolve:
StatElecSolve: Electrostatic iteration: 3
StatElecSolve: Starting Assembly...
StatElecSolve:  Assembly (s)          :   6.9999999999996732E-003
      10 0.4356E-01
      20 0.2404E-04
      30 0.8077E-06
      40 0.1382E-06
      50 0.6940E-10
      60 0.1119E-11
      61 0.8215E-12
ComputeChange: NS (ITER=3) (NRM,RELC): ( 0.50588142     0.78579456E-03 ) :: stat elec solver
StatElecSolve:  Solve (s)             :   3.1000000000000139E-002
StatElecSolve:  Tot. Electric Energy  :   2.1311631169551473E-012
StatElecSolve: Capacitance matrix computation performed (i,j,C_ij)
StatElecSolve:   1  1    4.79601E-12
StatElecSolve:   1  2    2.40533E-12
StatElecSolve:   1  3    2.39069E-12
StatElecSolve:   2  2    4.27697E-12
StatElecSolve:   2  3    1.87164E-12
StatElecSolve:   3  3    4.26233E-12
StatElecSolve: Capacitance matrix was saved to file cmatrix.dat
Loading user function library: [StatElecSolve]...[Statelecsolver_post]
ComputeChange: SS (ITER=3) (NRM,RELC): ( 0.50588142     0.64522150E-13 ) :: stat elec solver
FluxSolver: -------------------------------------
FluxSolver: Computing the flux and/or gradient
FluxSolver: -------------------------------------
      10 0.1075E-07
      16 0.6262E-12
      10 0.1339E-07
      16 0.6462E-12
      10 0.1551E-07
      16 0.9364E-12
FluxSolver:  Result Norm:    0.0000000000000000
Loading user function library: [FluxSolver]...[FluxSolver_post]
MAIN:
MAIN: -------------------------------------
MAIN:  Steady state iteration:            4
MAIN: -------------------------------------
MAIN:
StatElecSolve: -------------------------------------
StatElecSolve: STATELEC SOLVER:
StatElecSolve: -------------------------------------
StatElecSolve:
StatElecSolve: Electrostatic iteration: 1
StatElecSolve: Starting Assembly...
 Number of permutation BCs
 Capacitance body:           1 no         737
 Capacitance body:           2 no         734
 Capacitance body:           3 no         730
StatElecSolve:  Assembly (s)          :   8.0000000000000071E-003
      10 0.6154E-02
      20 0.1483E-03
      30 0.1308E-05
      40 0.8567E-08
      50 0.6080E-10
      56 0.8775E-12
ComputeChange: NS (ITER=1) (NRM,RELC): ( 0.55720619     0.96557931E-01 ) :: stat elec solver
StatElecSolve:  Solve (s)             :   3.0000000000000249E-002
StatElecSolve:  Tot. Electric Energy  :   2.3980052580683870E-012
StatElecSolve:
StatElecSolve: Electrostatic iteration: 2
StatElecSolve: Starting Assembly...
StatElecSolve:  Assembly (s)          :   7.0000000000001172E-003
      10 0.2367E-01
      20 0.4903E-03
      30 0.4110E-05
      40 0.2398E-07
      50 0.1275E-08
      60 0.9530E-12
      60 0.9530E-12
ComputeChange: NS (ITER=2) (NRM,RELC): ( 0.50627909     0.95773953E-01 ) :: stat elec solver
StatElecSolve:  Solve (s)             :   2.9999999999999805E-002
StatElecSolve:  Tot. Electric Energy  :   2.1384833679360104E-012
StatElecSolve:
StatElecSolve: Electrostatic iteration: 3
StatElecSolve: Starting Assembly...
StatElecSolve:  Assembly (s)          :   5.9999999999997833E-003
      10 0.8517E-02
      20 0.5396E-04
      30 0.8367E-06
      40 0.9136E-08
      50 0.1084E-09
      60 0.6020E-12
      60 0.6020E-12
ComputeChange: NS (ITER=3) (NRM,RELC): ( 0.50588142     0.78579456E-03 ) :: stat elec solver
StatElecSolve:  Solve (s)             :   3.0000000000000249E-002
StatElecSolve:  Tot. Electric Energy  :   2.1311631169551109E-012
StatElecSolve: Capacitance matrix computation performed (i,j,C_ij)
StatElecSolve:   1  1    9.59202E-12
StatElecSolve:   1  2   -5.15975E-23
StatElecSolve:   1  3    8.75288E-24
StatElecSolve:   2  2    8.55393E-12
StatElecSolve:   2  3    8.02322E-24
StatElecSolve:   3  3    8.52465E-12
StatElecSolve: Capacitance matrix was saved to file cmatrix.dat
Loading user function library: [StatElecSolve]...[Statelecsolver_post]
ComputeChange: SS (ITER=4) (NRM,RELC): ( 0.50588142     0.20717316E-12 ) :: stat elec solver
FluxSolver: -------------------------------------
FluxSolver: Computing the flux and/or gradient
FluxSolver: -------------------------------------
      10 0.1075E-07
      16 0.6262E-12
      10 0.1339E-07
      16 0.6462E-12
      10 0.1551E-07
      16 0.9364E-12
FluxSolver:  Result Norm:    0.0000000000000000
Loading user function library: [FluxSolver]...[FluxSolver_post]
MAIN:
MAIN: -------------------------------------
MAIN:  Steady state iteration:            5
MAIN: -------------------------------------
MAIN:
StatElecSolve: -------------------------------------
StatElecSolve: STATELEC SOLVER:
StatElecSolve: -------------------------------------
StatElecSolve:
StatElecSolve: Electrostatic iteration: 1
StatElecSolve: Starting Assembly...
 Number of permutation BCs
 Capacitance body:           1 no         737
 Capacitance body:           2 no         734
 Capacitance body:           3 no         730
StatElecSolve:  Assembly (s)          :   8.0000000000000071E-003
      10 0.4756E-02
      20 0.3228E-03
      30 0.9287E-06
      40 0.4547E-08
      50 0.8385E-10
      57 0.9049E-12
ComputeChange: NS (ITER=1) (NRM,RELC): ( 0.55720619     0.96557931E-01 ) :: stat elec solver
StatElecSolve:  Solve (s)             :   2.8000000000000025E-002
StatElecSolve:  Tot. Electric Energy  :   2.3980052580684751E-012
StatElecSolve:
StatElecSolve: Electrostatic iteration: 2
StatElecSolve: Starting Assembly...
StatElecSolve:  Assembly (s)          :   7.0000000000005613E-003
      10 0.2106E-01
      20 0.8984E-03
      30 0.2136E-04
      40 0.3037E-06
      50 0.1858E-08
      60 0.8774E-11
      63 0.8563E-12
ComputeChange: NS (ITER=2) (NRM,RELC): ( 0.50627909     0.95773953E-01 ) :: stat elec solver
StatElecSolve:  Solve (s)             :   3.0999999999999694E-002
StatElecSolve:  Tot. Electric Energy  :   2.1384833679360992E-012
StatElecSolve:
StatElecSolve: Electrostatic iteration: 3
StatElecSolve: Starting Assembly...
StatElecSolve:  Assembly (s)          :   1.3999999999999346E-002
      10 0.9603E-02
      20 0.4347E-04
      30 0.1268E-05
      40 0.2079E-08
      50 0.4436E-10
      58 0.5338E-12
ComputeChange: NS (ITER=3) (NRM,RELC): ( 0.50588142     0.78579456E-03 ) :: stat elec solver
StatElecSolve:  Solve (s)             :   4.1000000000000369E-002
StatElecSolve:  Tot. Electric Energy  :   2.1311631169550625E-012
StatElecSolve: Capacitance matrix computation performed (i,j,C_ij)
StatElecSolve:   1  1    9.59202E-12
StatElecSolve:   1  2    2.40533E-12
StatElecSolve:   1  3    2.39069E-12
StatElecSolve:   2  2    8.55393E-12
StatElecSolve:   2  3    1.87164E-12
StatElecSolve:   3  3    8.52465E-12
StatElecSolve: Capacitance matrix was saved to file cmatrix.dat
Loading user function library: [StatElecSolve]...[Statelecsolver_post]
ComputeChange: SS (ITER=5) (NRM,RELC): ( 0.50588142     0.53175908E-12 ) :: stat elec solver
FluxSolver: -------------------------------------
FluxSolver: Computing the flux and/or gradient
FluxSolver: -------------------------------------
      10 0.1075E-07
      16 0.6262E-12
      10 0.1339E-07
      16 0.6462E-12
      10 0.1551E-07
      16 0.9364E-12
FluxSolver:  Result Norm:    0.0000000000000000
Loading user function library: [FluxSolver]...[FluxSolver_post]
ResultOutputSolver: -------------------------------------
ResultOutputSolver: Saving with prefix: 20200711_Electrostatic
ResultOutputSolver: Creating list for saving - if not present
ResultOutputSolver: Saving in unstructured VTK XML (.vtu) format
VtuOutputSolver: Saving results in VTK XML format with prefix: 20200711_Electrostatic
VtuOutputSolver: Saving number of partitions: 1
WARNING:: WriteVtuXMLFile: Nonexistent variable: electric force density
WARNING:: WriteVtuXMLFile: Nonexistent variable: electric force density
ResultOutputSolver: -------------------------------------
Loading user function library: [ResultOutputSolve]...[ResultOutputSolver_post]
ElmerSolver: *** Elmer Solver: ALL DONE ***
ElmerSolver: The end
SOLVER TOTAL TIME(CPU,REAL):         4.77        4.77
ELMER SOLVER FINISHED AT: 2020/07/14 11:33:01
The capacitance matrix is calculated per iteration, but every time it is different and some times the value goes to negative.
What I would like to know is
1. Why the solver outputs the different capacitance matrix at each iteration.
2. Which capacitance matrix can be reliable.

Attached you can find the mesh files and a sif file.

Thank you for reading and kind your help.
Best regards
Attachments
20200714_Forum_CapacitanceMatrix.7z
(404.56 KiB) Downloaded 182 times
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Capacitance matrix at each iteration in steady state

Post by raback »

Hi

1. There were at least some problem with initialization. Just committed a tentative fix.
2. The 1st one.

-Peter
Post Reply