Hello everyone,
We’re working on a simulation of an electrostatic confinement setup for an electron cloud in 3D. The attachment here is a working example of the code, which loads a Gmsh-generated mesh with a cylindrical geometry containing multiple surface patches and two dielectric regions. The domain is essentially a vertical cylinder where electrons are trapped between inner disks and biased electrode segments.
(We are finding the Total ext. potential V(x,y,z) here only, which satisfies the BCs):
Geometry Overview:
The mesh (Ecloud_geometry_SmoothB.msh2) contains:
Top and bottom inner disks (radius 7 mm),
Segmented ring Top and Bottom (between 7 to 10 mm radius),
Middle and outer ring electrodes (up to 14 mm),
Side cylindrical walls,
Two volume regions:
region == 24: Dielectric with ε = 1.055,
region == 25: vacuum region with ε = 1.0.
Exporting the mesh (.msh2 extension) from this geo file:
While exporting, we gotta be careful about choosing the format, which should be “Version 2 ASCII” as it is compatible with working on FreeFem. Also, should not click on the " save all elements and save parametric coordinates options, as it’ll lead to loss of the physical elements’ details.
For the mesh file not to be large, we have to optimize the min and max characteristic length along with the min and max mesh size, keeping in mind that it should give us a close result of the potential calculation with the symmetric version while solving it on FreeFEM.
What the code does:
Loads the 3D mesh using gmshload3.
Assigns different permittivities to the two volume regions via a P03d field (dielectric).
Solves the Laplace equation:
with the appropriate dielectric-weighted weak form. We used an iterative GMRES solver for this problem.
Applies Dirichlet boundary conditions:
V = 1 on the top inner disk and phi-segmented patches,
V = 0 on all other electrode surfaces and walls.
Exports:
Full 3D potential data,
Potential and gradient as a function of radius r along z = 1.3 plane (the center).
We’ve another attachment here which is 2D version of the geometry defined earlier which arises because of symmetry along phi-direction.
To check if our 3D code is working or not, We’ve applied the same BCs (symmetric along phi direction in 3D) and compared it with our 2D result.
What we see in our new 3D geometry case, the size of matrix got increased as the number of surface nodes are now more in 3D case. We also compared (BC imposed here are V=1 at top inner disk and elsewhere V=0) the matrix size we need to change for our result (by optimizing mesh length) to match the 2D symmetric case exactly. So, the plot here compares the V(r, zfixed) for different matrix sizes.
This was the Potential and Field calculation we did here, and will be exporting this data for further analysis. Also, a special thanks to @Alexei for guiding me through this project:)
FF.zip (5.8 KB)