svVascularize

End-to-End Pipeline for 3D CFD Simulations

Generating a watertight, simulation-ready finite element mesh for computational fluid dynamics is a challenging multi-step problem. For typical workflows modeling bloodflow from clinical imaging data, this process involves pathline generation, segmentation, solid surface creation, volume mesh generation, mesh optimization/smoothing, and boundary identification. The pathline and segmentation steps are dependent upon available image data, thus these steps are very different for synthetically generated vascular structures which inheriently lack imaging data. The remaining steps are somewhat the same except that the workflow employed with svVascularize is automated since the number of vessels may quickly exceed practical manual efforts for model and mesh creation. These automated steps are all part of the Simulation class which can be used to wrap around synthetic vascular objects in order to build simulation files. We will demonstrate the basic API below for a simple vascular tree.

 import pyvista as pv
 from svv.domain.domain import Domain
 from svv.tree.tree import Tree
 from svv.simulation.simulation import Simulation

 cube = Domain(pv.Cube())
 cube.create()
 cube.solve()
 cube.build()

 t = Tree()
 t.set_domain(cube)
 t.set_root()
 t.n_add(2)

Now that we have a simple tree we can start building simulations from this object.

 # Create Simulation Container for Synthetic Tree Object
 sim = Simulation(t)

 # Build All Surface/Volume Meshes for 3D CFD Simulation
 sim.build_meshes()

This method will produce unioned surface .vtp meshes and their cooresponding volume meshes .vtu representing the synthetic vascular object. Additionally, the procedure will attempt to append boundary layer meshes along the walls vessels, typical in many hemodynamic studies to account for the steep velocity gradients near vessel walls. If successful, the surfaces meshes will be stored within the simulation container list simulation.fluid_domain_surface_meshes, volume meshes will be stored within the container simulation.fluid_domain_volume_meshes, and boundary layers will be stored within the container simulation.fluid_domain_boundary_layers. Storing the meshes as python objects allows for more custom modification procedures that users may want to implement prior to creating the simulation files.

Mesh building: This step is potentially memory and compute intensive depending on the size of the synthetic vascular object being discretized. Under the hood, svVascularize is using a combination of tetgen and mmg meshing utilities via python subprocess calls. These, as well as surface mesh unioning operations, are non-trivial and may take minutes-hours to complete. Users can supply custom meshing parameters for their applications to override default values this may result in more efficient meshing, but it is recommended that default parameters are attemped first.