openBF.jl
openBF is an open-source 1D blood flow solver based on MUSCL finite-volume numerical scheme, written in Julia and released under Apache 2.0 free software license.
Docs | Installation | Example | Plot | Dev | Hub | Cite
Docs
- openBF ≦v0.6.3 check this website for documentation and tutorials.
- openBF v0.7+ docs can be built as
julia make.jl
inside thedocs/
folder (this requires Documenter package).
Installation
Provided you already have a Julia v1.x installation (all platforms download and Windows instructions), you can add openBF as
julia> ]
(v1.x) pkg> add https://github.com/INSIGNEO/openBF
update it as
julia> ]
(v1.x) pkg> update openBF
test it as
julia> ]
(v1.x) pkg> test openBF
and use it as
julia> using openBF
julia> openBF.runSimulation("<input file name>.yml")
You can also create (MacOSX/Linux only) an openBF alias as
$ echo "alias openBF='cp ~/.julia/v1.x/openBF/main.jl ./main.jl && julia main.jl $1'" >> ~/.bashrc
$ source ~/.bashrc
$ openBF -h
usage: main.jl [-v] [-f] [-c] [-h] input_filename
positional arguments:
input_filename .yml input file name
optional arguments:
-v, --verbose Print STDOUT - default false
-f, --out_files Save complete results story rather than only the
last cardiac cycle
-c, --conv_ceil Ceil convergence value to 100 mmHg (default true)
-h, --help show this help message and exit
Example
project name: <project name>
results folder: <path/to/your/results/directory>
blood:
rho: 1060.0 # density
mu: 4.e-3 # kinematic viscosity
solver:
Ccfl: 0.9 # Courant number
cycles: 100 # max number of cardiac cycles
jump: 100
convergence tolerance: 15.0 # convergence min error threshold
network:
- label: <vessel name>
sn: 1
tn: 2
E: 400000 # Young's modulus
L: 0.04 # length
R0: 0.012 # lumen radius
inlet number: 1
inlet: Q
inlet file: <inlet filename>
- label: <vessel name>
sn: 2
tn: 3
E: 400000
L: 0.103
R0: 0.010
outlet: wk2
Cc: 8.2e-11 # peripheral compliance
R1: 8480000000.0 # peripheral resistance
Plotting
Install Plots.jl
julia> ]
(v1.x) pkg> add Plots
(v1.x) pkg> <backspace>
julia> using Plots
(the first time you run this, the library will be compiled and it may takes several minutes)
plot something
using DelimitedFiles
# open the result files
v1 = DelimitedFiles.readdlm("v1_P.last")
v2 = DelimitedFiles.readdlm("v2_P.last")
plot(v1[:,1], v1[:,end]/133.332, label="v1")
plot(v2[:,1], v2[:,end]/133.332, label="v2")
xlabel!("time (s)")
ylabel!("pressure (mmHg)")
How to dev
$ git clone https://github.com/INSIGNEO/openBF.git
$ cd openBF
$ julia
julia> ]
(v1.x) pkg> add Revise
(v1.x) pkg> activate .
(openBF) <backspace>
julia> using Revise
julia> using openBF
Ecosystem
- A collection of 1D networks (from literature) solved by means of openBF can be found in the openBF-hub repository.
- The scripts to generate a virtual population of ADAN56s can be found in openBF-db repository.
- openBF badge
Publications
openBF has been used in the following works:
- Benemerito I, Narata AP, Narracott A, Marzo A. Determining clinically-viable biomarkers for ischaemic stroke through a mechanistic and machine learning approach. Annals of Biomedical Engineering, 2022. DOI: 10.1007/s10439-022-02956-7
- Mustafa A. An efficient computational approach to guide intervention in treatment of stroke. PhD Thesis, 2021
- Benemerito I, Jordan B, Mustafa A, Marzo A. Quantification of the effects of ageing, hypertension and atherosclerosis on flow reversal during a mechanical thrombectomy procedure, BioMedEng21 September 2021, Sheffield, UK In proceedings
- Benemerito I, Narata AP, Narracott A, Marzo A. Pulsatility indices can inform on distal perfusion following ischaemic stroke, CMMBE September 2021, Online event, In proceedings
- Benemerito I, Narata AP, Narracott A, Marzo A. Identification of biomarkers for perfusion following an ischaemic event, CMBE September 2021, Online event, In proceedings
- Melis A. Gaussian process emulators for 1D vascular models. PhD Thesis, 2017.
- Melis A, Clayton RH, Marzo A. Bayesian sensitivity analysis of a 1D vascular model with Gaussian process emulators. International Journal for Numerical Methods in Biomedical Engineering, 2017. DOI: 10.1002/cnm.2882
- Melis A, Clayton RH, Marzo A. A more efficient approach to perform sensitivity analyses in 0D/1D cardiovascular models, CMBE July 2015, Cachan, FR. In proceedings
Have you used openBF for your research? Let us know!
Citation
@misc{openBF.jl-2018,
title={openBF: Julia software for 1D blood flow modelling},
url={https://figshare.com/articles/openBF_Julia_software_for_1D_blood_flow_modelling/7166183/1},
DOI={10.15131/shef.data.7166183},
abstractNote={
openBF is an open-source 1D blood flow solver based on MUSCL finite-volume numerical scheme, written in Julia and released under Apache 2.0 free software license.
See https://github.com/INSIGNEO/openBF for the git repository and https://insigneo.github.io/openBF/ for the documentation.
},
publisher={figshare},
author={Melis, Alessandro},
year={2018},
month={Oct}}