AWehenkel / openBF

1D blood flow model

Home Page:https://INSIGNEO.github.io/openBF

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

openBF.jl

TUoS INSIGNEO CompBioMed

License Mentioned in Awesome Julia.jl

DOI

openbf ci status

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 the docs/ 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)")

waveforms

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.
  • The scripts to generate aged versions of a template openBF model can be found in openBF_ageing.
  • openBF badge openBF

Publications

openBF has been used in the following works:

Journal Papers

Conference Papers

PhD theses

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}}

About

1D blood flow model

https://INSIGNEO.github.io/openBF

License:Other


Languages

Language:Julia 99.8%Language:Shell 0.2%