Skip to content

Commit

Permalink
paper clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
menon-karthik committed Jun 26, 2024
1 parent 0f3e72a commit 2dfdf20
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 33 deletions.
13 changes: 12 additions & 1 deletion paper.bib
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ @article{Lee2024
year = {2024}
}

@article{ZANONI2024,
@article{zanoni2024,
author = {Zanoni, Andrea and Geraci, Gianluca and Salvador, Matteo and Menon, Karthik and Marsden, Alison L and Schiavazzi, Daniele E},
doi = {https://doi.org/10.1016/j.cma.2024.117119},
issn = {0045-7825},
Expand All @@ -224,3 +224,14 @@ @article{ZANONI2024
year = {2024}
}

@article{Zhu2022,
doi = {10.21105/joss.04118},
url = {https://doi.org/10.21105/joss.04118},
year = {2022},
publisher = {The Open Journal},
volume = {7},
number = {78},
pages = {4118},
author = {Chi Zhu and Vijay Vedula and Dave Parker and Nathan Wilson and Shawn Shadden and Alison Marsden},
title = {svFSI: A Multiphysics Package for Integrated Cardiac Modeling}, journal = {Journal of Open Source Software}
}
78 changes: 46 additions & 32 deletions paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ authors:
equal-contrib: true
- name: Jonathan Pham
affiliation: 1
- name: Kaitlin Harold
- name: Kaitlin E. Harold
affiliation: 1
- name: Dave Parker
affiliation: 1
Expand All @@ -34,11 +34,16 @@ bibliography: paper.bib

# Summary

Computational modeling of cardiovascular blood flow has emerged as a valuable tool in the diagnosis and treatment of cardiovascular disease [@menon2024cardiovascular].

Computational modeling of cardiovascular blood flow has emerged as a valuable tool in the diagnosis and treatment of cardiovascular disease [@menon2024cardiovascular].
While simulations of blood flow can be performed using various high and low-fidelity techniques, lumped-parameter or zero-dimensional modeling is a low-order technique that is widely used in various applications that require quick estimation of bulk flow quantities, such as flow and pressure at specific anatomical locations.

We introduce `svZeroDSolver`, an efficient and modular package for performing lumped-parameter (zero-dimensional) simulations of cardiovascular blood flow. `svZeroDSolver` is written in C++ using an object-oriented framework. It designed so that a user can simply specify a `.json` dictionary of "blocks", such as blood vessels, valves, heart chambers, junctions between blood vessels, and boundary conditions (along with their associated parameters), and the code automatically assembles and solves the governing equations corresponding to the user-specified vascular model. The package also includes Python and C++ APIs to facilitate its use with other Python packages, for example in optimization and uncertainty quantification applications, as well as allows interfacing with other high-performance C++/Fortran software, which is useful when using lumped-parameter boundary conditions for high-fidelity simulations. Finally, it includes an application, `svZeroDCalibrator`, to calibrate parameters of a given zero-dimensional model based on independent measurements of hemodynamics at specific anatomical locations.
We introduce `svZeroDSolver`, an efficient and modular package for performing lumped-parameter (zero-dimensional) simulations of cardiovascular blood flow.
`svZeroDSolver` is written in C++ using an object-oriented framework.
It designed so that a user can simply specify a `.json` dictionary of lumped-parameter "blocks" -- such as blood vessels, valves, heart chambers, junctions between blood vessels, and boundary conditions (along with their associated parameters) -- which the code uses to automatically assemble and solve the governing equations corresponding to the user-specified vascular model.
In addition, the package includes Python and C++ APIs to facilitate its use with other software packages.
For example, it can be integrated into Python-based optimization and uncertainty quantification applications.
It can also be interfaced with high-performance C++/Fortran software for high-fidelity cardiovascular flow simulations, where `svZeroDSolver` can conveniently provide lumped-parameter boundary conditions.
`svZeroDSolver` also includes an application, called `svZeroDCalibrator`, to automatically calibrate parameters of a given zero-dimensional model to recapitulate independent measurements of hemodynamics at specific anatomical locations from high-fidelity simulations -- thus improving the accuracy of zero-dimensional simulations.


# Statement of need
Expand All @@ -47,44 +52,53 @@ The ability to non-invasively quantify patient-specific hemodynamics via computa
Computational modeling is also a promising tool for non-invasive and personalized optimization of clinical treatments and surgery [@Marsden2014].

Previous work has used a variety of techniques to model cardiovascular blood flow, all of which can be broadly categorized based on their level of fidelity.
High-fidelity models generally involve simulations of the full three-dimensional flow-field within anatomical regions of interest [@Updegrove2017].
While these are the most accurate and informative, they are computationally expensive (each simulation can take several hours or days on hundreds of CPU cores) and therefore not feasible for use within typical clinical settings or for applications such as optimization that typically require thousands of evaluations.
On the other end of the spectrum, lumped-parameter or zero-dimensional models provide information about bulk hemodynamics, such as flow rate and pressure, at specific anatomical regions of interest.
While these models are not spatially-resolved, they are very valuable in applications that require near real-time quantification of bulk hemodynamics, as well as applications that rely on thousands of repeated evaluations, such as optimization and uncertainty quantification.
They are also used in conjunction with high-fidelity simulations where lumped-parameter models are used as boundary conditions [@menon2024personalized;@ZANONI2024;@richter2024bayesian].

`svZeroDSolver` is a new open-source software package that enables fast evaluation of zero-dimensional hemodynamics.
One specific challenge in zero-dimensional modeling that `svZeroDSolver` addresses is that different clinical applications (and individual clinical cases within the same application) often require unique anatomical arrangements of blood vessels, heart valves, etc., and each of these anatomical configurations is governed by a distinct set of differential equations.
High-fidelity models generally involve simulations of the full three-dimensional flow-field within anatomical regions of interest [@menon2024cardiovascular;@Updegrove2017].
While these are the most accurate and informative, they are computationally expensive (each simulation can take several hours or days on hundreds of CPU cores) and therefore not feasible for use within typical clinical settings or for applications, such as optimization, which often require thousands of evaluations.
On the other end of the spectrum, lumped-parameter or zero-dimensional models provide information about bulk hemodynamics, such as flow rate and pressure, at specific anatomical regions of interest.
While these models are not spatially-resolved, they are very valuable in applications that require near real-time quantification of bulk hemodynamics, as well as applications that rely on thousands of repeated model evaluations, such as optimization and uncertainty quantification [@zanoni2024;@richter2024bayesian].
They are also used in conjunction with high-fidelity simulations where lumped-parameter models are used as boundary conditions [@menon2023predictors;@menon2024personalized].

`svZeroDSolver`, which is a part of the `Simvascular` open-source project, is a new open-source software package that enables fast evaluation of zero-dimensional hemodynamics.
One major challenge in zero-dimensional modeling that `svZeroDSolver` addresses is that different clinical applications (and individual clinical cases within the same application) often require unique anatomical arrangements of blood vessels, heart valves, etc., and each of these anatomical configurations is governed by a distinct set of governing equations.
It is therefore common for users to implement application-specific solvers, which simulate the equations governing a specific application or anatomical configuration.
In contrast, the modularity of `svZeroDSolver` allows users to easily create arbitrary anatomical configurations by arranging a library of available "blocks", following which the software automatically assembles the equations governing the specified confguration.
Another unique feature of `svZeroDSolver` is its ability to easily interface with other C++ and Python packages.
This has been used in previous work on uncertainty quantification [@richter2024bayesian;@Lee2024;ZANONI2024] as well as in multi-scale simulations coupling three-dimensional hemodynamics with zero-dimensional representations of downstream circulation [@menon2023predictors;@menon2024personalized].
In particular, the C++ interface has been succesfully coupled with high-fidelity multi-physics solvers `svSolver` and `svFSI`, which are part of the widely used `Simvascular` open-source software [@Updegrove2017].
The simple API, as well as accompanying examples in `svZeroDSolver/tests/test_interface`, makes interfacing with other C++ and Fortran codes seamless.
In addition, the `svZeroDCalibrator` application within `svZeroDSolver` includes functionality to improve the accuracy of zero-dimensional models by optimizing the parameters of blood vessels to recapitulate observed hemodynamics from measurements or high-fidelity simulations.
This allows users to build more accurate zero-dimensional models than those typically based on purely the anatomy of the vascular region of interest [@richter2024bayesian].
The accuracy of `svZeroDSolver` is assessed using continuous integration tests and has also been verified by comparing with high-fidelity three dimensional simulations [@pfaller2022].
This combination of features makes `svZeroDSolver` uniquely applicable to a wide range of applications in cardiovascular biomechanics.
In contrast, the modularity of `svZeroDSolver` allows users to easily create arbitrary anatomical configurations by arranging a library of available "blocks", following which the software automatically assembles the equations governing the user-specified confguration.

Another unique feature of `svZeroDSolver` is its ability to easily interface with other C++ and Python packages.
This has been used in previous work on uncertainty quantification [@richter2024bayesian;@Lee2024;@zanoni2024] as well as in multi-scale simulations coupling three-dimensional hemodynamics with zero-dimensional representations of downstream circulation [@menon2023predictors;@menon2024personalized].
In particular, the C++ interface has been succesfully coupled with high-fidelity multi-physics solvers `svSolver` and `svFSI`, which are part of the widely used `Simvascular` open-source software project for cardiovascular biomechanics simulations [@Updegrove2017;@Zhu2022].
`svZeroDSolver` has also been integrated into the graphical user interface of the `Simvascular` project.
This allows users to leverage the functionality in `Simvascular` to generate three-dimensional patient-specific anatomical models from medical images, and subsequently perform patient-specific zero-dimensional simulations of blood flow by automatically converting the three-dimensional anatomy into a zero-dimensional model [@pfaller22].

# Software implementation
In addition, the `svZeroDCalibrator` application within `svZeroDSolver` includes functionality to improve the accuracy of zero-dimensional models by optimizing the parameters of blood vessels to recapitulate observed hemodynamics from measurements or high-fidelity simulations.
This allows users to build more accurate zero-dimensional models than those typically based on purely the anatomy of the vascular region of interest [@richter2024bayesian].
The accuracy of `svZeroDSolver` is assessed using continuous integration tests and has also been verified by comparing with high-fidelity three dimensional simulations [@pfaller22].
This combination of features makes `svZeroDSolver` uniquely applicable to a wide range of applications in cardiovascular biomechanics.

![Various zero-dimensional "blocks" included in the package at the time of writing.\label{fig:blocks}](blocks.png){ width=80% }

`svZeroDSolver` relies on a collection of "blocks" to set up the governing equations for a given anatomical configuration.
Each block is inherited from a `block` class, as illustrated in \autoref{fig:blocks}, and is governed by a "local" set of equations with associated degrees-of-freedom.
# Software details

`svZeroDSolver` relies on a collection of "blocks" to set up the governing equations for a given anatomical configuration.
Each block is inherited from a `block` class, as illustrated in \autoref{fig:blocks}, and is governed by a "local" set of equations with associated degrees-of-freedom.
The solver parses through an input configuration `.json` file, which lists the blocks, their parameters, and how they are connected to each other, and then automatically assembles the local equations and degrees-of-freedom for each block into a global system of equations.
The governing equations and circuit representation for each block are available in the documentation. For example, see the [documentation for a blood vessel block](https://simvascular.github.io/svZeroDSolver/class_blood_vessel.html#details).
The governing equations and circuit representation for each block are available in the documentation. For example, see the [documentation for a blood vessel block](https://simvascular.github.io/svZeroDSolver/class_blood_vessel.html#details).

The zero-dimensional simulations performed by `svZeroDSolver` are governed by non-linear differential-algebraic equations.
We integrate these equations in time using the implicit generalized-alpha scheme [@JANSEN2000305], with Newton-Raphson iterations to solve the linearized system.
The zero-dimensional simulations performed by `svZeroDSolver` are governed by non-linear differential-algebraic equations.
We integrate these equations in time using the implicit generalized-alpha scheme [@JANSEN2000305], with Newton-Raphson iterations to solve the linearized system.
Under the hood, these linearized governing equations for each block are implemented as local contributions to a system of linear (matrix) equations, which are then assembled into a global linear system based on the user-specified configuration.
We use the Eigen package to represent and solve these sparse linear systems [@eigenweb].
Details of this implementation are provided in the [`SparseSystem`](https://simvascular.github.io/svZeroDSolver/class_sparse_system.html#details) and [`Integrator`](https://simvascular.github.io/svZeroDSolver/class_integrator.html#details) classes.
Details on the modular implementation of the blocks, along with their governing equations, are provided in the documentation's [Developer Guide](https://simvascular.github.io/svZeroDSolver/developer_guide.html).
We use the [Eigen package](https://gitlab.com/libeigen/eigen) to represent and solve these sparse linear systems [@eigenweb].
Mathematical details on this implementation are provided in the [`SparseSystem`](https://simvascular.github.io/svZeroDSolver/class_sparse_system.html#details) and [`Integrator`](https://simvascular.github.io/svZeroDSolver/class_integrator.html#details) classes in the documentation.

The input to `svZeroDSolver` is a `.json` file which specifies the simulation parameters (number of time steps, cardiac cycles, etc.), the types of blocks to be included in the specific model, the boundary conditions, and how the blocks are connected (typically using `junction` blocks).
Each of these blocks generally requires several parameters which can be specified using a steady value, a list of time-varying values, or a mathematical function which is parsed using [exprtk](https://github.com/ArashPartow/exprtk).
The solver can either run simulations for a specified number of time steps and cardiac cycles, or until the difference in mean quantities between consecutive cardiac cycles is below a given threshold.

The input to `svZeroDSolver` is a `.json` file which specifies the simulation parameters (number of time steps, cardiac cycles, etc.), the types of blocks to be included in the specific model, the boundary conditions, and how the blocks are connected (typically using `junction` blocks). Each of these blocks requires several parameters which can generally be specified using a steady value, a list of time-varying values, or a mathematical function which is parsed using [exprtk](https://github.com/ArashPartow/exprtk). The solver can either run simulations for a specified number of time steps, or until the difference in mean quantities between consecutive cardiac cycles is below a given threshold.
`svZeroDSolver` currently has implementations of different types of blood vessel blocks with non-linear resistors to model vascular stenoses, junctions between blood vessels, a heart valve block modeled using a hyperbolic tangent function, a cardiac chamber block modeled as a time-varying capacitor and inductor, and several different boundary condition blocks including simple flow, pressure and resistors blocks, windkessel boundary conditions, coronary boundary conditions that include the intramyocardial pressure experienced by coronary arteries, as well as closed-loop versions of windkessel and coronary boundary conditions that allow a user to build a closed-loop circulation model [@Kim2009;@kimcoronary;@menon2023predictors;@menon2024personalized].

`svZeroDSolver` currently has implementations of different types of blood vessel blocks with non-linear resistors to model vascular stenoses, junctions between blood vessels, a heart valve block modeled using a hyperbolic tangent function, a cardiac chamber block modeled as a time-varying capacitor and inductor, and several different boundary condition blocks including simple flow, pressure or resistors blocks, windkessel boundary conditions, coronary boundary conditions that include the intramyocardial pressure experienced by coronary arteries, as well as closed-loop versions of windkessel and coronary boundary conditions that allow a user to build a closed-loop circulation model [@Kim2009;@kimcoronary;@menon2023predictors].
In addition, `svZeroDSolver` is integrated into the `Simvascular` project, which allows users to automatically generate zero-dimensional models from three-dimensional models using a graphical interface [@pfaller2022]. More details on creating zero-dimensional simulations from three-dimensional models are available on the [Simvascular documentation](https://simvascular.github.io/documentation/rom_simulation.html), and examples of configuration files to run `svZeroDSolver` simulations using the various available blocks are in `svZeroDSolver/tests/cases`.
Examples of configuration files to run `svZeroDSolver` simulations using the various available blocks are in `svZeroDSolver/tests/cases`.
The repository also includes examples demonstrating the simple API for interfacing between `svZeroDSolver` and external C++ software packages in `svZeroDSolver/tests/test_inetrface`.
Details on creating zero-dimensional simulations from three-dimensional models using the `Simvascular` graphical interface are available on the [Simvascular documentation](https://simvascular.github.io/documentation/rom_simulation.html).

Future development plans include a graphical interface to create circuit representations of existing zero-dimensional models, as well as functionality to create `svZeroDSolver`-compatible `.json` configuration files directly from graphical (circuit) representations of user-specified circulatory models.
We are also expanding the available blocks to more accurately model hemodynamics, such as by using data-driven models for pressure losses at abritrarily shaped vascular junctions.
Expand Down

0 comments on commit 2dfdf20

Please sign in to comment.