Unwrapping Cylindrical Meshes to Structured GridsΒΆ

to handle meshes we have the following libraries, pyvista and CGALMethods. At the moment bot libraries are not interoperable however they can both read directly from vtk files.

import pymethods as pma
import pyvista as pv
import pathlib as pt
import time

openfoam_vtk_folder = pt.Path("../../Datasets/openfoam_vtk")
surface_vtk_path = openfoam_vtk_folder/"WALL/WALL_400.vtk"
# vtk mesh read via pyvista
vtk_mesh = pv.read(surface_vtk)
# vtk mesh read via CGAL Methods
cgal_mesh = pma.CGALMethods.SurfaceMesh(surface_vtk.as_posix())

two methods have been explored for the parameterization of a 3D unstructed cylindrical mesh to 3D structured grids. In the first method the cylindrical mesh is parameterized by a border constructed from the inlet and outlet vertices combined with a seam connnecting the two. The method is performed via the CGALMethods library.

# with the following method we unwrap the artery using CGAL and then map the solution to a grid
unwrapped_cgalmesh = pma.CGALMethods.SurfaceMesh(cgal_mesh)
gridded = CM.map_parameterized_mesh_to_grid(unwrapped)

points can be supplied to specify the location of the inlet such thatthe unwrapping is correctly oriented

# with the following method we unwrap the artery using CGAL and then map the solution to a grid
unwrapped_cgalmesh = pma.CGALMethods.SurfaceMesh(cgal_mesh, *point) # where the point e.g. [1,2,,3]
gridded = CM.map_parameterized_mesh_to_grid(unwrapped)

in the second method if the centerline is known the mesh is unwrapped via slicing the mesh along the centerline using planes whose normals are specified by the tangents of the centerline. This has been performed using pyvista.

NOTE: the centerline finding algorithm currently employed requires a cgal mesh.