3D Electrostatic Simulation

Numerical methods and mathematical models of Elmer
thiennz
Posts: 6
Joined: 27 Sep 2022, 21:42
Antispam: Yes

3D Electrostatic Simulation

Post by thiennz »

Hi,

I've been attempting to replicate the simulation done in viewtopic.php?t=4287. I want to be able to simulate the electric field and potential in the air around the capacitor in the fringe field.

I have created my geometry and created the mesh using gmsh. Then in elmer I've defined the necessary equations, materials, and boundary conditions. After running the solver and viewing it in Paraview, I notice that the potentials in the air don't show up as a gradient like in the previous post I was following.

I've attached the files I used to get these results and a reference image of the example I'm basing my learning from. Any help would be appreciated!
Attachments
elmer.zip
(101.99 KiB) Downloaded 45 times
example.png
example.png (93.56 KiB) Viewed 940 times
potential.png
potential.png (13.79 KiB) Viewed 940 times
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: 3D Electrostatic Simulation

Post by kevinarden »

This took a while to solve, keep running both your case and the other case getting different results and not finding any differences. Then I used your sif with the other case mesh at it worked, but not vice versa. Problem must be in the mesh, but at first look everything seemed OK, however your mesh was coarse, I refined it but that did not fix the problem.

I realized that the two plate volumes in your step file were not used to cut out the air volume. This means the air volume is not around the plates it is through the plates, and they do not share nodes at the boundary. This doesn't work. The plate volumes have to be used to cut the air volume while retaining the plate volumes. They then share boundaries and nodes.

I fixed this in gmsh, and retained the mesh refinement steps, and the results look good. I also used physical groups to name the volumes and combine the boundary surfaces. The steps are captured in the geo file. You possibly could have done this in the tool you used to create the step file.
platecap.geo
(721 Bytes) Downloaded 33 times
potential.png
potential.png (21.88 KiB) Viewed 809 times
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: 3D Electrostatic Simulation

Post by kevinarden »

This document has good tutorials Chapter 9 about making bodies in Salome or gmsh
https://www.nic.funet.fi/pub/sci/physic ... dElmer.pdf
Rich_B
Posts: 421
Joined: 24 Aug 2009, 20:18

Re: 3D Electrostatic Simulation

Post by Rich_B »

Hello Kevin,

Good detective work!

Issues from a non-conforming mesh due to lack of proper boolean difference/fragment commands seems to come up on a regular basis.

Is there some method or algorithm to detect non-conforming meshes? Maybe create a solver that would highlight non-conformance?

Rich.
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: 3D Electrostatic Simulation

Post by kevinarden »

I know that ABAQUS reports the number of free bodies in a model. Not sure what algorithm it uses. I suppose you can check all of the nodes on the boundary of a body, if none of those nodes are used in another body, than that body is free.
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: 3D Electrostatic Simulation

Post by raback »

You can try

Code: Select all

Simulation :: Calculate Mesh Pieces = Logical True
It has not been parallelized. The intended use is exactly this - to check that the mesh is in one piece.

-Peter
Rich_B
Posts: 421
Joined: 24 Aug 2009, 20:18

Re: 3D Electrostatic Simulation

Post by Rich_B »

Hello Peter,

The attached archives demonstrates the use of 'Calculate Mesh Pieces', using the gmsh example from GetStartedElmer.pdf.

The good example lists:
CalculateMeshPieces: Number of non-body nodes in mesh is 0
CalculateMeshPieces: Mesh consists of single body!
The bad example lists
CalculateMeshPieces: Number of non-body nodes in mesh is 0
CalculateMeshPieces: Number of separate pieces in mesh is 2
Rich.
Attachments
mesh-pieces.zip
(131.81 KiB) Downloaded 28 times
Rich_B
Posts: 421
Joined: 24 Aug 2009, 20:18

Re: 3D Electrostatic Simulation

Post by Rich_B »

Hello,

As a follow up to the archive with two examples, it helps to increase Max Output Level from 5 to 10 or 15.

With Max Output Level = 15, this is the output in the solver log:
CalculateMeshPieces: Number of non-body nodes in mesh is 0
CalculateMeshPieces: Mesh coloring loops: 3
CalculateMeshPieces: Number of separate pieces in mesh is 2
VariableAddVector: Adding variable > Mesh Piece < with 1 components
VariableAddVector: Allocating field of size: 644
VariableAdd: Adding variable > Mesh Piece < of size 644

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.
The seg fault only happens with an example with more than one mesh, so it turns a meshing error into a fatal error, which is convenient.

Rich.
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: 3D Electrostatic Simulation

Post by raback »

Hi Rich

Thanx for the "convenient" thumbs up and extremely elegant test cases! I rather see controlled stop so I fixed this. This allows one to visualize the blocks.

For those interested: the algo is such that you 1st label each node with their own node index. Then you start going through the elements and always label every node in the element with the minimum label index. When you continue until no changes take place you end up with either one or few different indeces. Visually this would be like a crawling cellular automate where the smallest index would travel though elements. If elements are not connected the crawling stops. In the end you count separate values and renumber them from 1.

-Peter

PS. For electrostatic simulation there is some work on curved problems and capacitance computation. You can have a look at test cases CurvedBoundaryCylH and *P that demostrate how to accurately compute capacitance between two cocentric cylinders.
Rich_B
Posts: 421
Joined: 24 Aug 2009, 20:18

Re: 3D Electrostatic Simulation

Post by Rich_B »

Hello Peter,

Thanks for fixing the seg fault. Here is the solver log for the case previously called 'bad' or Overlapping Volumes:
CalculateMeshPieces: Number of non-body nodes in mesh is 0
CalculateMeshPieces: Mesh coloring loops: 3
CalculateMeshPieces: Number of separate pieces in mesh is 2
CalculateMeshPieces: Creating variable showing the non-connected domains: mesh piece
The solver then continued to a solution.

Also thanks for describing the method used to check for separate mesh pieces.

Rich.
Post Reply