![]() I’ve recorded the whole mesh generation process which can be viewed on peertube or here as a gif. * mshr is the FEniCS built-in mesh generating package. One big advantage of this is that the subdomains and boundary conditions can be automatically identified by FEniCS, and also that it allows complex geometries to be used. Rather than doing this the geometry will be made and then subsequently meshed using Gmsh. Finite Element Solution with FEniCSįEniCS can also be used to solve this problem, however unlike with the previous example specifying the mesh and boundary conditions with mshr* could be time consuming. ![]() The electric field is then found from the gradient of this function giving Which is the final solution for the potential. Which can be re-arranged for the constants c1 and c2 and re-substituted into the general solution giving ![]() Inserting the relevant values into the general solution gives the equations Where c1 and c2 are constants determined by the boundary conditions.Īt the outer boundary s = b the value of the electric potential is set by the boundary conditions. Following the procedures in the solution can be found, which has a general form Which is a Cauchy-Euler equation for which solutions are published in numerous sources. In this case it will be assume that there is no θ dependence which gives Which can be looked up from a number of references (it’s the cylindrical one but without any z-variation which can be found in ) (s is the radial coordinate). The Laplacian operator in polar coordinates is If this is unfamiliar then the previous post gives a brief background, but more thorough backgrounds are available. The problem that has to be solved is the Laplace equation in the annular region We would like to find the electric potential and field distribution within the free-space annulus. The free space region is bounded by a conducting ring of radius b held at the electric potential Vb. A central conducting disc of radius a is held at electric potential Va and surrounded by an annular region of free space. The geometry that will be solved in this example is indicated in Figure 1. In this case the tool that will be used is called GMsh, although it is also possible to use more general CAD software to define the geometry which will be demonstrated in future posts specifically for 3D problems. The finite-element method allows the solution of these problems for more complex geometries too, and this will be the focus of this post.įEniCS has the ability to import a mesh, this means that it is possible to define the geometry of a problem and generate a mesh using external tools. That particular geometry was chosen for two reasons first was because it is a simple problem for which there is a well known analytical formula and second because it allowed the mesh to be generated from within FEniCS as it was just a rectangle. The solution is to take advantage of the GMSH scripting language.PIn the previous post the Laplace equation was solved between two infinite parallel plates subject to certain boundary conditions using FEniCS. We may also need to adjust the global mesh size before meshing the volume ( Tools -> Options -> Mesh -> General -> Element size factor).īut, there will be a big problem here if the surface mesh has a complex morphology, leading to a long waiting time for each of the above steps to complete on the GUI. We can simply open a mesh in it ( File -> Open), define a volume ( Physical groups -> Add -> Volume), and then generate a mesh on it ( Mesh -> 3D). GMSH is a powerful software to make such volume mesh. The surface mesh is suitable for printing or demonstration purposes, but if one wants to go for a computational analysis, like a finite element analysis (FEA) for structural and heat transfer simulations or a computational fluid dynamics (CFD) simulation, then a volume mesh is required. Generate volume mesh from a surface mesh using GMSH Ĭreating a volume mesh out of a surface mesh is a quite common task in computational sciences, especially when you deal with a sort of image segmentation resulting in a surface mesh (usually in STL format).
0 Comments
Leave a Reply. |