Homogeneous Poisson equation - solve for potential

Numerical methods and mathematical models of Elmer
Post Reply
AndrejR
Posts: 8
Joined: 04 Dec 2020, 17:36
Antispam: Yes

Homogeneous Poisson equation - solve for potential

Post by AndrejR »

Hi everyone,

I am trying to use Elmer for finding electric potential from homogeneous Poisson equation via StatElecSolver. I generated 2D mesh (it is annulus with different potentials on the inner and outer edge) in SALOME and created a .sif file for ElmerSolver, but it executes very quickly and the result is potential = 0 everywhere.

If anyone could tell me what I am doing wrong I would be very grateful.

This is my .sif file:

Code: Select all

Check Keywords Warn
 
 Header
   Mesh DB "." "poisson"
 End
 
 Simulation
   Coordinate System = Cartesian 2D
   Coordinate Mapping(3) = 1 2 3
   Simulation Type = Steady State
   Steady State Max Iterations = 1
 !  Output File = "elstatics.result"
   Post File = "poisson.vtu"
 End
 
 Constants
   Permittivity Of Vacuum = 8.8542e-12
 End
 
 Body 1
   Equation = 1
   Material = 1
   Body Force = 1
 End
 
 Equation 1
   Active Solvers(1) = 1
   Calculate Electric Energy = True
 End
 
 Material 1
   Relative Permittivity = 1.0
 End

 Body Force 1
   Charge Density = 0.0
 End
 
 Solver 1
   Equation = Stat Elec Solver
   Variable = Potential
   Variable DOFs = 1
   Procedure = "StatElecSolve" "StatElecSolver"
 
   Calculate Electric Energy = True
   Calculate Electric Field = False
   Calculate Electric Flux = False
 
   Linear System Solver = Iterative
   Linear System Iterative Method = BiCGStab
   Linear System Max Iterations = 500
   Linear System Convergence Tolerance = 1.0e-10
   Linear System Preconditioning = ILU1
   Linear System ILUT Tolerance = 1.0e-03
   Linear System Residual Output = 10
   Nonlinear System Max Iterations = 1
   Nonlinear System Convergence Tolerance = 1.0e-4
   Nonlinear System Newton After Tolerance = 1.0e-3
   Nonlinear System Newton After Iterations = 10
   Nonlinear System Relaxation Factor = 1
   Steady State Convergence Tolerance = 1.0e-4
 End
 
 Boundary Condition 1
   Target Boundaries = 1
   Potential = -40.0

 Boundary Condition 2
   Target Boundaries = 2
   Potential = 0.0
 End


And this is my entities.sif file generated by ElmerGrid from mesh (from .unv file from SALOME):

Code: Select all

 !------ Skeleton for body section -----
 Body 1
   Name = Annulus
 End
 
 !------ Skeleton for boundary section -----
 Boundary Condition 1
   Name = Inner_boundary
 End
 
 Boundary Condition 2
   Name = Outer_boundary
 End
kevinarden
Posts: 2312
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Homogeneous Poisson equation - solve for potential

Post by kevinarden »

There is no end statement at the end of boundary condition 1, when I change that it works well.
potential.png
(112.56 KiB) Not downloaded yet
AndrejR
Posts: 8
Joined: 04 Dec 2020, 17:36
Antispam: Yes

Re: Homogeneous Poisson equation - solve for potential

Post by AndrejR »

Oh, sorry about that, it's just copying mistake. Even with the 'End' statement I have the same problem.

So if this works for you, does that mean that problem is probably with mesh?
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Homogeneous Poisson equation - solve for potential

Post by raback »

Hi,

Your transferred mesh uses names. You can continue using them. No need to apply "Target Boundaries" then. How do you know that your numbering is correct? That would explain.

-Peter
kevinarden
Posts: 2312
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Homogeneous Poisson equation - solve for potential

Post by kevinarden »

Boundary Condition 1
Target Boundaries(1) = 1
Potential = -40.0
End

Boundary Condition 2
Target Boundaries(1) = 2
Potential = 0.0
End

is what I used.
AndrejR
Posts: 8
Joined: 04 Dec 2020, 17:36
Antispam: Yes

Re: Homogeneous Poisson equation - solve for potential

Post by AndrejR »

I found the solution!

I was using ElmerGrid on my .unv mesh, but I omitted -autoclean parameter. Now that I am using

Code: Select all

ElmerGrid 8 2 poisson.unv -autoclean
it works.

Thank you all for your help!
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Homogeneous Poisson equation - solve for potential

Post by raback »

Hi

So the BC numbering was not 1,2,... originally. Autoclean enforces continuous numbering from one.

For SALOME you could use the names as in:
viewtopic.php?f=4&t=4106

If you look at the original mesh.names file in the mesh directory you can see how what was your initial numbering.

-Peter
AndrejR
Posts: 8
Joined: 04 Dec 2020, 17:36
Antispam: Yes

Re: Homogeneous Poisson equation - solve for potential

Post by AndrejR »

Thanks! That's helpful :)
Post Reply