This repository contains the code to generate elliptic-smoothed meshes for three dimensional geometries. The geometry is user-specified. Stretching functions are implemented to cluster the mesh at appropriate regions in the domain, and a elliptic equation based smoothing algorithm is implemented to smooth the mesh.
mpicxx -std=c++14 EllipticMeshGenerator.cpp -o out
./out
The input geometry is user defined. This example consists of a half-ellipsoid.
- The code outputs a mesh
file_mesh.vtk
which is an ASCII VTK file of the structured mesh - A
bc.dat
file which contains the boundary conditions for the bottom wall - Files
file_bc_wall.vtk
andfile_bc_farfield.vtk
which are vtk files to visualize the wall bc regions for the hump region vicinity
Consider stretching in the x coordinate centered at a position pos
(as a percentage of domain length from xmin).
For the case of the ellipsoid, for eg., the center of the ellipsoid is at a
i
is the index
The elliptic governing equation is solved for the y coordinate to smooth the mesh. In this particular geoemtry, the x and z directions only need appropriate stretching and no smoothing is necessary.
where
where a
s are defined for eg. as
The derivatives are approximated using second-order finite differences, and an iterative Gauss-Siedel approach is used to solve the elliptic pde.