Charged conductor with floating potential

Numerical methods and mathematical models of Elmer
Post Reply
jeremie
Posts: 30
Joined: 11 Jul 2019, 11:31
Antispam: Yes

Charged conductor with floating potential

Post by jeremie »

Hi all,

I would like to compute the potential of a floating metal (a metal with any electrical connections) under electron flux irradiation.
The potential must increase with time due to the charges accumulating on the surface.

I tried to do that by using the StatCurrentSolver with a transient simulation. I use a simple geometry, a parallelepiped and the top face is irradiated. I tried two cases with iterative solver but they didn't converge:

1) I use a body force to give a current source (e.g. 1e-06 C/m3/s) only to nodes located at the top surface. For the boundary conditions I used Neumann boundaries by setting the current density for all faces to 0 A/m2.

2) I use a Neumann boundary condition to give the current density at the top boundary (e.g. -4.0E-08 A/m2). The current density for the bottom and side boundaries is set to 0 A/m2.

With dielectrics, I have successfully carried out this type of calculation but I gave at least one Dirichlet BC for the potential. Here I want to charge a conductor only by giving Neumann BC.

Any suggestions?

Thank you.

Jeremie
Attachments
case.sif
(2.53 KiB) Downloaded 260 times
raback
Site Admin
Posts: 4823
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Charged conductor with floating potential

Post by raback »

Hi, I suggest that you search the forum for "floating potential". Maybe that's what you need. -Peter
jeremie
Posts: 30
Joined: 11 Jul 2019, 11:31
Antispam: Yes

Re: Charged conductor with floating potential

Post by jeremie »

Hi Peter,

Thanks for the quick answer.

Indeed, I have already looked for floating potential in the forum and I found two intersting information:
- The use of "Potential Constant = Logical True" in boundary conditions for floating potential.
- The convergence tolerance for linear system when the difference in electrical conductivity between two bodies is large.
However this didn't solve my problem.

I tried another test case: I used two bodies (two bricks in contact) one is a metal and the other is a dielectric.
Charges are deposited at the top surface of the metal by using a body force and the potential is set to 0V at the bottom face of the dielectric.
I used a floating potential for metal, i.e. "Potential Constant = Logical True" in the boundary condition section. However, it didn't work also.

After reading in the source code of Elmer, I found that I can set "Potential Constant = Logical True" in the body force section in order to add a BodyForce constraint -> 'SetDirichletBoundaries','Found BodyForce constraint: ' (SolverUtils.f90). And now it works but only for a geometry where the mesh conforms to the interface.

I used this simple geometry where two parallelepipeds are in contact, with a conformal mesh at the shared interface. But most of the time, the geometry comes from a STEP file that I mesh with NetGen and the mesh at the shared surfaces is non-conforming. When I try the same test case with a non-conforming mesh at the interface of the two bodies, it doesn't work...

I found this in DefUtils.f90 but I am not sure if it corresponds to what I am looking for:

! Create contact BCs using mortar conditions.
!---------------------------------------------------------------------
IF( ListGetLogical( PSolver % Values,'Apply Contact BCs',Found) ) THEN
CALL DetermineContact( PSolver )
END IF

Any help would be great.

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

Re: Charged conductor with floating potential

Post by raback »

HI Jeremie,

Is non-conforming mesh something that you need, or do you just want dual set of nodes to enable jumps in the solution?

"Apply Mortar BCs" is what you would use for nonconforming potential. "Apply Contact BCs" is intended for vector fields related to deformation. There are tons of tests with mortar bc's.

-Peter
jeremie
Posts: 30
Joined: 11 Jul 2019, 11:31
Antispam: Yes

Re: Charged conductor with floating potential

Post by jeremie »

Hi Peter,

Thank you very much for your support.

I use geometry models from .STEP files (built by a CAD software) then I mesh them with NetGen. When there are two volumes in contact, the two bodies are meshed but the mesh at the interface is non-conforming. That's why I try to perform a simulation with non-conforming mesh. I tried with "Apply Mortar CSs" but without success... I am going to look in details to see how I can build a conforming mesh from STEP files.

I continued to do some tests with two parallepipeds (one metal and one dielectric) in contact with conforming mesh.
When the difference between the electrical conductivities is large, the calculation does not converge even if I set the convergence tolerance to 1E-22 for linear and non linear system. (e.g. the conductivity is 1E-15 S/m for the dielectric and 1E+06 S/m for the metal).

I try also to do this test case with a metal sphere in air:
viewtopic.php?f=3&t=4362&p=15759&hilit= ... tal#p15758
with a convergence tolerance for linear and non-linear system to 1E-22 but the calculation diverges whatever the preconditionner (from ILU0 to ILU9).
The corresponding SIF is attached.

I use the statcurrentsolver for both metal and dielectric, because I want to add charges at specific position with a UDF and allowing a charge relaxation.

Any idea on how I can manage the high difference electrical conductivties?

Thanks
Attachments
case.sif
(3.05 KiB) Downloaded 229 times
raback
Site Admin
Posts: 4823
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Charged conductor with floating potential

Post by raback »

Hi

Convergence is almost impossible to reach with tolerance 1e-22. Typically we use 1e-8 or so. Krylov methods are not usually monotonic in convergence so if you ask too strict tolerance the solution may after many iteration get polluted. It is not just about precondtioner, there are tons of Krylov methods too: Idrs, BiCGSTabl, GCR,...

It is known that extreme variation in conductivity is an issue for standard nodal FEM. I would recommend mixed solution where fluxes are described via Hdiv conforming elements. Unfortunately we just have some toy example for that. Higher order elements, finer mesh etc. may help but not maybe enough.

-Peter
Wil
Posts: 72
Joined: 10 Jan 2014, 13:26
Antispam: Yes
Location: Austria

Re: Charged conductor with floating potential

Post by Wil »

Dear Peter,

I get the following 'Warning' in the Solver output if I use 'Potential constant = Logical True'.
The computation is done and is also correct as can be seen with the simple benchmark model below, but it is misleading that something is wrong.
I think the check for the 'listed keywords' has to be adopted.

Below you find the output of the solver (it is the same for the non-development version):

Code: Select all

ELMER SOLVER (v 8.4) STARTED AT: 2020/06/29 10:06:08

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: 8fa89876, Compiled: 2020-06-25)
MAIN:  Running one task without MPI parallelization.
MAIN:  Running with just one thread per task.
MAIN: =============================================================
LoadInputFile: Reading only "Run Control" section
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
Model Input:  Unlisted keyword: [potential constant] in section: [boundary condition 3]
Model Input:  Unlisted keyword: [potential constant] in section: [boundary condition 4]
Model Input:  Unlisted keyword: [potential constant] in section: [boundary condition 5]
Model Input:  Unlisted keyword: [potential constant] in section: [boundary condition 6]
Model Input:  Unlisted keyword: [potential constant] in section: [boundary condition 7]
LoadInputFile: Number of BCs: 7
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
Loading user function library: [StatElecSolve]...[StatElecSolver_Init0]
Loading user function library: [ResultOutputSolve]...[ResultOutputSolver_Init0]
LoadMesh: Starting
ElmerAsciiMesh: Performing step: 1
LoadMesh: Base mesh name: .
LoadMesh: Reading header info from file: ./mesh.header
InitializeMesh: Number of nodes in mesh: 2801
InitializeMesh: Number of bulk elements in mesh: 1520
InitializeMesh: Number of boundary elements in mesh: 860
InitializeMesh: Initial number of max element nodes: 10
ElmerAsciiMesh: Performing step: 2
LoadMesh: Reading nodes from file: ./mesh.nodes
LoadMesh: Performing coordinate mapping
SetMeshDimension: Dimension of mesh is: 3
SetMeshDimension: Max dimension of mesh is: 3
LoadMesh: Scaling coordinates: 1.000E-03 1.000E-03 1.000E-03
ElmerAsciiMesh: Performing step: 3
LoadMesh: Reading bulk elements from file: ./mesh.elements
ElmerAsciiMesh: Performing step: 4
LoadMesh: Reading boundary elements from file: ./mesh.boundary
LoadMesh: Performing node mapping
ReadTargetNames: Reading names info from file: ./mesh.names
WARNING:: ReadTargetNames: Could not map name to Body nor BC: bnry9
LoadMesh: Remapping bodies
LoadMesh: Minimum initial body index: 8
LoadMesh: Maximum initial body index: 8
LoadMesh: Remapping boundaries
LoadMesh: Minimum initial boundary index: 1
LoadMesh: Maximum initial boundary index: 9
ElmerAsciiMesh: Performing step: 5
ElmerAsciiMesh: Performing step: 6
LoadMesh: Loading mesh done
LoadMesh: Preparing mesh done
LoadMesh: Elapsed REAL time:     0.0331 (s)
MeshStabParams: Computing stabilization parameters
MeshStabParams: Elapsed REAL time:     1.1898 (s)
MAIN: -------------------------------------
AddSolvers: Setting up 2 solvers
AddSolvers: Setting up solver 1: stat elec solver
AddEquationBasics: Using procedure: StatElecSolve StatElecSolver
AddEquationBasics: Setting up solver: stat elec solver
Loading user function library: [StatElecSolve]...[StatElecSolver_Init]
Loading user function library: [StatElecSolve]...[StatElecSolver_bulk]
Loading user function library: [StatElecSolve]...[StatElecSolver]
AddEquationBasics: Creating standard variable: potential
OptimizeBandwidth: ---------------------------------------------------------
OptimizeBandwidth: Computing matrix structure for: stat elec solver...done.
OptimizeBandwidth: Half bandwidth without optimization: 2786
OptimizeBandwidth:
OptimizeBandwidth: Bandwidth Optimization ...done.
OptimizeBandwidth: Half bandwidth after optimization: 722
OptimizeBandwidth: ---------------------------------------------------------
AddSolvers: Setting up solver 2: resultoutput
AddEquationBasics: Using procedure: ResultOutputSolve ResultOutputSolver
AddEquationBasics: Setting up solver: resultoutput
Loading user function library: [ResultOutputSolve]...[ResultOutputSolver_Init]
Loading user function library: [ResultOutputSolve]...[ResultOutputSolver_bulk]
Loading user function library: [ResultOutputSolve]...[ResultOutputSolver]
AddMeshCoordinatesAndTime: Setting mesh coordinates and time
SetInitialConditions: Setting up initial conditions (if any)
ElmerSolver: Number of timesteps to be saved: 1
MAIN:
MAIN: -------------------------------------
MAIN:  Steady state iteration:            1
MAIN: -------------------------------------
MAIN:
SingleSolver: Attempting to call solver
SingleSolver: Solver Equation string is: stat elec solver
StatElecSolve: -------------------------------------
StatElecSolve: STATELEC SOLVER:
StatElecSolve: -------------------------------------
DefaultStart: Starting solver: stat elec solver
StatElecSolve: Starting Assembly...
DefUtils::DefaultDirichletBCs: Setting Dirichlet boundary conditions
SetDirichletBoundaries: Found BC constraint: potential Constant
SetDirichletBoundaries: Using List maxtrix to set constant constraints
SetDircihletBoundaries: Original matrix non-zeros: 67001
ListToCRSMatrix: Matrix format changed from CRS to List
SetDirichletBoundaries: Number of lumped nodes set: 69
SetDirichletBoundaries: Number of lumped nodes set: 69
SetDirichletBoundaries: Number of lumped nodes set: 69
SetDirichletBoundaries: Number of lumped nodes set: 69
SetDirichletBoundaries: Number of lumped nodes set: 69
List_ToCRSMatrix: Number of entries in CRS matrix: 69107
List_ToCRSMatrix: Matrix format changed from List to CRS
SetDircihletBoundaries: Modified matrix non-zeros: 69107
EnforceDirichletConditions: Applying Dirichlet conditions using scaled diagonal
ScaleLinearSystem: Scaling diagonal entries to unity
DefUtils::DefaultDirichletBCs: Dirichlet boundary conditions set
StatElecSolve:  Assembly (s)          :  0.34908499999999987
DefaultSolve: Solving linear system with default routines
SolveSystem: Solving linear system
SolveLinearSystem: Assuming real valued linear system
ScaleLinearSystem: Scaling diagonal entries to unity
SolveSystem: Linear System Solver: iterative
SolveSystem: Linear System Preconditioning: ilu0
SolveSystem: Serial linear System Solver: iterative
IterSolver: Using iterative method: bicgstab
CRS_IncompleteLU: ILU(0) (Real), Starting Factorization:
CRS_IncompleteLU: Allocated LU matrix of size: 69107
CRS_IncompleteLU: ILU(0) (Real), NOF nonzeros:     69108
CRS_IncompleteLU: ILU(0) (Real), filling (%) :       100
CRS_IncompleteLU: ILU(0) (Real), Factorization ready at (s):     0.00
       1 0.3263E+00
       2 0.2058E+01
       3 0.1788E+01
       4 0.1654E+01
       5 0.1612E+01
       6 0.3707E+01
       7 0.5071E+01
       8 0.2405E+02
       9 0.2190E+02
      10 0.2177E+02
      11 0.1040E+03
      12 0.2745E+02
      13 0.2765E+02
      14 0.2476E+02
      15 0.1053E+02
      16 0.1051E+02
      17 0.1346E+02
      18 0.8900E+00
      19 0.7643E+00
      20 0.3500E+00
      21 0.3532E+00
      22 0.4680E+01
      23 0.9841E-01
      24 0.8288E-01
      25 0.6372E-01
      26 0.6737E-01
      27 0.2083E+00
      28 0.1540E+00
      29 0.1129E+00
      30 0.2498E-01
      31 0.2968E-01
      32 0.8439E-02
      33 0.4129E-02
      34 0.3917E-03
      35 0.1146E-03
      36 0.1120E-03
      37 0.1559E-03
      38 0.1715E-03
      39 0.1320E-03
      40 0.1201E-03
      41 0.6758E-04
      42 0.9608E-05
      43 0.9443E-05
      44 0.3691E-05
      45 0.5596E-05
      46 0.1187E-05
      47 0.2967E-05
      48 0.2963E-05
      49 0.2839E-06
      50 0.3089E-06
      51 0.1645E-06
      52 0.3059E-06
      53 0.2022E-07
      54 0.4803E-06
      55 0.4663E-06
      56 0.1912E-05
      57 0.8518E-08
      57 0.8518E-08
ComputeNorm: Computing norm of solution
ComputeChange: NS (ITER=1) (NRM,RELC): ( 0.58547603      2.0000000     ) :: stat elec solver
StatElecSolve:  Solve (s)             :  0.10986399999999996
StatElecSolve:  Result Norm   :   0.58547603175203078
StatElecSolve:  Relative Change :    2.0000000000000000
StatElecSolve:
DefaultFinish: Finished solver: stat elec solver
Loading user function library: [StatElecSolve]...[StatElecSolver_post]
ComputeNorm: Computing norm of solution
ComputeChange: SS (ITER=1) (NRM,RELC): ( 0.58547603      2.0000000     ) :: stat elec solver
SingleSolver: Attempting to call solver
SingleSolver: Solver Equation string is: resultoutput
ResultOutputSolver: -------------------------------------
ResultOutputSolver: Saving with prefix: case
ResultOutputSolver: Working on mesh: .
ResultOutputSolver: Dimension of mesh is: 3
ResultOutputSolver: Creating list for saving - if not present
CreateListForSaving: Field Variables for Saving
CreateListForSaving: Scalar Field 1: potential
CreateListForSaving: Vector Field 1: electric field
ResultOutputSolver: Saving in unstructured VTK XML (.vtu) format
VtuOutputSolver: Saving results in VTK XML format with prefix: case
VtuOutputSolver: Saving number of partitions: 1
SolverOutputDirectory: Creating directory: .
VtuOutputSolver: Full filename base is: ./case
VtuOutputSolver: Number of active elements 2380 out of 2380
VtuOutputSolver: Number of geometry nodes 2801 out of 2801
VtuOutputSolver: Total number of geometry nodes to save:    2801
VtuOutputSolver: Total number of dof nodes to save:    2801
VtuOutputSolver: Total number of elements to save:    2380
VtuOutputSolver: Writing the vtu file: ./case_t0001.vtu
AscBinWriteInit: Initializing buffered ascii/binary writing
AscBinWriteInit: Writing in binary
AscBinWriteInit: Writing in double precision
AscBinWriteInit: Writing to unit number: 58
AscBinWriteInit: Size of buffer is: 2801
VtuOutputSolver: Writing nodal fields
VtuOutputSolver: Saving variable: potential
VtuOutputSolver: Saving variable: electric field
VtuOutputSolver: Number of nodal fields written: 2
VtuOutputSolver: Writing elemental fields
VtuOutputSolver: Number of elemental fields written: 0
VtuOutputSolver: Writing coordinates for each used node
VtuOutputSolver: Writing the elemental connectivity data
VtuOutputSolver: Writing nodal fields
VtuOutputSolver: Saving variable: potential
VtuOutputSolver: Saving variable: electric field
VtuOutputSolver: Writing elemental fields
AscBinWriteFree: Terminating buffered ascii/binary writing
VtuOutputSolver: All done for now
ResultOutputSolver: -------------------------------------
Loading user function library: [ResultOutputSolve]...[ResultOutputSolver_post]
ReloadInputFile: Realoading input file
LoadInputFile: Loading input file:
ElmerSolver: *** Elmer Solver: ALL DONE ***
ElmerSolver: The end
SOLVER TOTAL TIME(CPU,REAL):         2.44        2.51
ELMER SOLVER FINISHED AT: 2020/06/29 10:06:10
Image
Image
Attachments
minimal example for Potential Floating in Elmer.zip
The .sif, mesh and result files.
(349.96 KiB) Downloaded 251 times
Screenshot from 2020-06-29 10-05-46.png
with floating potential switched off.
(580.98 KiB) Not downloaded yet
Screenshot from 2020-06-29 10-03-22.png
with floating potential switched on.
(617.67 KiB) Not downloaded yet
Wil
Posts: 72
Joined: 10 Jan 2014, 13:26
Antispam: Yes
Location: Austria

Re: Charged conductor with floating potential

Post by Wil »

And the original FreeCAD file which was used to create the solver output above. 8-)
Attachments
minimal example for Potential Floating in Elmer - FreeCAD file.zip
(321.79 KiB) Downloaded 250 times
raback
Site Admin
Posts: 4823
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Charged conductor with floating potential

Post by raback »

Hi

The problem is that there are tens of adopted names for fields, say "VarName". We also have several derived keyword, like "Varname Constant". The unfortunate thing is that the combination of these is, well a huge number. We currently have ~2000 keywords. Listing all possible combinations would be a huge task or we should write detection for these combined keywords.

If you don't like the Warnings just set

Code: Select all

Check Keywords "Ignore"
-Peter
Post Reply