1D blood flow simulations in Julia
The cardiovascular system is a complex network of elastic vessels through which blood is pumped by contraction of the heart. This pulsatile regime and vessel elasticity cause pressure to propagate along the arterial circulation as waves. Mechanical discontinuities caused by bifurcation, bends or cardiovascular pathology cause pressure waves to be reflected in all directions.
Pressure waves measured at a specific location can be seen as the result of a superimposition of incident (forward) and reflected (backward) waves. The analysis of this superposition mechanism allows for the study of mechanical properties upstream and downstream of the measurement point and can be a rich source of diagnostic information about the system through which these waves propagate. However, given the vascular system complexity, it is at present difficult to ascribe a particular waveform feature to a specific trait of the arterial circulation
The understanding of the cause-effect mechanisms governing wave propagation in the cardiovascular system was used at INSIGNEO Institute for in silico Medicine at The University of Sheffield to develop a computer model that can reproduce this behaviour in a quantitative way. openBF is a Julia package for the solution of one-dimensional (1D) blood flow in networks of elastic arteries.
The 1D model is derived from the three-dimensional formulation of the viscous fluid motion equations, the Navier-Stokes equations. These are simplified by assuming the arteries to be long, narrow, and elastic tubes and the blood to be incompressible (i.e., its density is constant over time) and behaving as a Newtonian fluid (i.e., its viscosity does not depend on its velocity).
Does it work?
Despite all the above assumptions, the resulting partial differential equation system is complex enough to simulate the physics of pulse wave transmission and reflection. This is at the expense of results accuracy in areas where the flow structure is inherently three-dimensional, e.g., in the proximity of heart valves and bifurcations. Conversely, the computational requirements are small compared to 3D simulations, allowing the simulation of the entire cardiovascular system rather than only circumscribed parts.
The solver has been extensively validated against gold-standard techniques from literature. Further comparison with in vitro and in vivo measurements confirmed the robustness of the numerical scheme and its capability of mimicking the vascular behaviour physics.
Julia is a
“high-level, high-performance dynamic programming language for numerical computing”
Indeed, Julia is extremely user-friendly as its syntax will be familiar to Python/MATLAB developer, and it is lightning fast as the code is compiled on-the-fly producing similar speeds to C. Moreover, Julia was born with the aim of providing the scientific community with a fast language for numerical analysis. In this view, Julia community developed a wide range of packages (1742 at the time of writing) providing most of the numerical methods and algorithms commonly found in MATLAB or as Python modules. In addition, Python (through PyCall.jl) or C code can be included in Julia programs. Eventually, Julia is (and it will remain) open-source under MIT licence.
Virtual populations in the Cloud
The complete description of the arterial vasculature achieved through the 1D models provides a deep insight on the circulation mechanics and represents and ideal choice with great translational opportunities in healthcare.
The 1D computer model can be used as experimental platform to test clinical hypothesis and to better understand the onset and development of cardiovascular conditions. Indeed, given the short simulation time, 1D models can be used to model the cardiovascular system of entire populations of virtual subjects. Because the systemic circulation topology and mechanical properties widely vary along the population, to simulate all the possible combinations of parameter would require years of CPU time on standard workstations. In a recent study (yet to be published) we used a combination of Cloud and traditional HPC facilities to perform 15,000 simulations in about 16 hours while the estimated time on the workstation would add up to 200 days.
The 1D model derivation and numerical implementation was described in
Melis, A. (2017) Gaussian process emulators for 1D vascular models. PhD thesis, University of Sheffield [pdf]
An overview of openBF functionalities and its use on the Cloud system was recently given by SURFSara and Sheffield University in the webinar
Introduction to Cloud Computing for the VPH [video]
The software openBF was developed at INSIGNEO Institute for in silico Medicine at The University of Sheffield (UK) as part of A. Melis’ PhD thesis under the supervision of Dr. A. Marzo. We gratefully acknowledge funding from the UK Engineering and Physical Sciences Research Council (Grant Number EP/K037145/1).
The solver is currently used in several HPC systems within the H2020 CompBioMed Centre of Excellence in Computational Biomedicine (Grant Agreement №675451). In SURFSara’s HPC-Cloud, it is being used for large-scale sensitivity analysis and uncertainty quantification studies, towards clinical application. The simulations reported in the thesis and in this related paper where run in TUoS’s ShARC tier-3 cluster. More information can be found on the official page and in CompBioMed Software Hub.