Simvascular compile under Ubuntu 20.04.1 LTS
- Sajeda Akter
- Posts: 44
- Joined: Sun Feb 11, 2018 3:06 am
Simvascular compile under Ubuntu 20.04.1 LTS
Hello Developers,
Hope you are all fine.
I would like to know about the simvascular compilation in Ubuntu 20. Is it possible to compile Simvascular step by step for patient-based blood flow simulations under ubuntu 20.04.1 LTS?
In addition, I want to simulate 1D blood flow simulation by using Python interface (under windows 10 in different machine). I have centreline of a model but how can I apply pwlf.py and mesh.py files in the centreline for adaptive meshes.
Thank you in advance
Cheers,
Sajeda
Hope you are all fine.
I would like to know about the simvascular compilation in Ubuntu 20. Is it possible to compile Simvascular step by step for patient-based blood flow simulations under ubuntu 20.04.1 LTS?
In addition, I want to simulate 1D blood flow simulation by using Python interface (under windows 10 in different machine). I have centreline of a model but how can I apply pwlf.py and mesh.py files in the centreline for adaptive meshes.
Thank you in advance
Cheers,
Sajeda
- David Parker
- Posts: 1718
- Joined: Tue Aug 23, 2005 2:43 pm
Re: Simvascular compile under Ubuntu 20.04.1 LTS
Hi Sajeda,
The Ubuntu 18 SV version should work on Ubuntu 20. Do you want to build SV from the GitHub source? I haven't tried that, might be some issues with the compiler version.
I'll have Martin answer the second part of your question.
Cheers,
Dave
The Ubuntu 18 SV version should work on Ubuntu 20. Do you want to build SV from the GitHub source? I haven't tried that, might be some issues with the compiler version.
I'll have Martin answer the second part of your question.
Cheers,
Dave
- Martin Pfaller
- Posts: 60
- Joined: Tue Oct 01, 2019 10:23 am
Re: Simvascular compile under Ubuntu 20.04.1 LTS
Hi Sajeda,
Below is some code you could start with to run the 1D pipeline from Python. Note that you can't run the code "as is", you need to set your own parameters whenever is called. You need to run the code within SimVascular-Python (to use the sv module). In Linux, you can do that with
I don't know what the equivalent in Windows is. If you run into trouble, let us know.
Also, have a look at this documentation: https://github.com/SimVascular/SimVascu ... ulation.py
Best
Martin
Below is some code you could start with to run the 1D pipeline from Python. Note that you can't run the code "as is", you need to set your own parameters whenever
Code: Select all
params_db['...']
Code: Select all
build_folder/SimVascular-build/sv --python -- your_script.py
Also, have a look at this documentation: https://github.com/SimVascular/SimVascu ... ulation.py
Best
Martin
Code: Select all
import sv
# create 1d simulation
oned_simulation = sv.simulation.OneDimensional()
# Create 1D simulation parameters
params = sv.simulation.OneDimensionalParameters()
# Mesh parameters
mesh_params = params.MeshParameters()
# Model parameters
model_params = params.ModelParameters()
model_params.name = geo
model_params.inlet_face_names = ['inflow']
model_params.outlet_face_names = params_db['outlets']
model_params.centerlines_file_name = params_db['centerlines_input_file']
# Fluid properties
fluid_props = params.FluidProperties()
# Set wall properties
material = params.WallProperties.OlufsenMaterial()
# Set boundary conditions
bcs = params.BoundaryConditions()
# add inlet
bcs.add_velocities(face_name='inlet', file_name=params_db['inflow_input_file'])
# add outlets
for cp in params_db['outlets']:
t = params_db['bc_def']['bc_type'][cp]
bc = params_db['bc_def']['bc'][cp]
if 'Po' in bc and bc['Po'] != 0.0:
raise ValueError('RCR reference pressure not implemented')
if t == 'rcr':
bcs.add_rcr(face_name=cp, Rp=bc['Rp'], C=bc['C'], Rd=bc['Rd'])
elif t == 'resistance':
bcs.add_resistance(face_name=cp, resistance=bc['R'])
elif t == 'coronary':
raise ValueError('Coronary BC not implemented')
# Set solution parameters
solution_params = params.Solution()
solution_params.time_step = params_db['dt']
solution_params.num_time_steps = params_db['num_dts']
solution_params.save_frequency = params_db['save_data_freq']
# Write a 1D solver input file
oned_simulation.write_input_file(model=model_params, mesh=mesh_params, fluid=fluid_props,
material=material, boundary_conditions=bcs, solution=solution_params,
directory=params_db['fpath_1d'])
- Sajeda Akter
- Posts: 44
- Joined: Sun Feb 11, 2018 3:06 am
Re: Simvascular compile under Ubuntu 20.04.1 LTS
Thank you Dave and Martin for your reply.
One more thing I want to know about the sudden changing of the pressure difference in the 1D stenosis area. Is it possible to generate the sudden change pressure in 1D simulation by using GUI in sv? I would be happy if you write more about the 1D simulation for stenosis variation pressure difference.
Thank you in advance
Cheers
Sajeda
One more thing I want to know about the sudden changing of the pressure difference in the 1D stenosis area. Is it possible to generate the sudden change pressure in 1D simulation by using GUI in sv? I would be happy if you write more about the 1D simulation for stenosis variation pressure difference.
Thank you in advance
Cheers
Sajeda
- Martin Pfaller
- Posts: 60
- Joined: Tue Oct 01, 2019 10:23 am
Re: Simvascular compile under Ubuntu 20.04.1 LTS
Hi Sajeda,
Unfortunately, the 1D solver right now can't handle a sudden change in pressure. There will be a slight drop, but the drop will be much lower than in the 3D model.
We want to include stenosis modeling in a future release.
Best
Martin
Unfortunately, the 1D solver right now can't handle a sudden change in pressure. There will be a slight drop, but the drop will be much lower than in the 3D model.
We want to include stenosis modeling in a future release.
Best
Martin
- Sajeda Akter
- Posts: 44
- Joined: Sun Feb 11, 2018 3:06 am
Re: Simvascular compile under Ubuntu 20.04.1 LTS
Hi Martin,
Thank you very much for your reply and your information.
I would like know that is there any open source code or technique or document for 1D such simulation?
Actually, I've crying need this 1D simulation.
Thank you in advanceeeee
Best
Sajeda
Thank you very much for your reply and your information.
I would like know that is there any open source code or technique or document for 1D such simulation?
Actually, I've crying need this 1D simulation.
Thank you in advanceeeee
Best
Sajeda
- Martin Pfaller
- Posts: 60
- Joined: Tue Oct 01, 2019 10:23 am
Re: Simvascular compile under Ubuntu 20.04.1 LTS
Unfortunately, I don't know any other 1D open source codes that incorporate pressure losses due to stenosis.
- Sajeda Akter
- Posts: 44
- Joined: Sun Feb 11, 2018 3:06 am
Re: Simvascular compile under Ubuntu 20.04.1 LTS
Thank you Martin and Dave.
You all doing a great job...
I have one more query that is it possible to calculate RRT (relative residence time) directly like WSS or TAWSS in 3d sv module?
Thank you in advance
Cheers,
Sajeda
You all doing a great job...
I have one more query that is it possible to calculate RRT (relative residence time) directly like WSS or TAWSS in 3d sv module?
Thank you in advance
Cheers,
Sajeda
- David Parker
- Posts: 1718
- Joined: Tue Aug 23, 2005 2:43 pm
Re: Simvascular compile under Ubuntu 20.04.1 LTS
Hi Sajeda,
To compute RRT you would need to add code to the svSolver post processing program https://github.com/SimVascular/svSolver ... solver.cxx. Have a look around line 1400 to see how TWSS is computed.
Cheers,
Dave
To compute RRT you would need to add code to the svSolver post processing program https://github.com/SimVascular/svSolver ... solver.cxx. Have a look around line 1400 to see how TWSS is computed.
Cheers,
Dave