Simvascular compile under Ubuntu 20.04.1 LTS

Provides a system for patient-specific cardiovascular modeling and simulation.
POST REPLY
User avatar
Sajeda Akter
Posts: 44
Joined: Sun Feb 11, 2018 3:06 am

Simvascular compile under Ubuntu 20.04.1 LTS

Post by Sajeda Akter » Fri Jan 15, 2021 8:43 pm

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

User avatar
David Parker
Posts: 1747
Joined: Tue Aug 23, 2005 2:43 pm

Re: Simvascular compile under Ubuntu 20.04.1 LTS

Post by David Parker » Tue Jan 19, 2021 8:26 pm

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

User avatar
Martin Pfaller
Posts: 60
Joined: Tue Oct 01, 2019 10:23 am

Re: Simvascular compile under Ubuntu 20.04.1 LTS

Post by Martin Pfaller » Thu Jan 21, 2021 9:39 am

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

Code: Select all

params_db['...']
is called. You need to run the code within SimVascular-Python (to use the sv module). In Linux, you can do that with

Code: Select all

build_folder/SimVascular-build/sv --python -- your_script.py
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

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'])

User avatar
Sajeda Akter
Posts: 44
Joined: Sun Feb 11, 2018 3:06 am

Re: Simvascular compile under Ubuntu 20.04.1 LTS

Post by Sajeda Akter » Tue Jan 26, 2021 2:22 am

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

User avatar
Martin Pfaller
Posts: 60
Joined: Tue Oct 01, 2019 10:23 am

Re: Simvascular compile under Ubuntu 20.04.1 LTS

Post by Martin Pfaller » Wed Jan 27, 2021 6:50 pm

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

User avatar
Sajeda Akter
Posts: 44
Joined: Sun Feb 11, 2018 3:06 am

Re: Simvascular compile under Ubuntu 20.04.1 LTS

Post by Sajeda Akter » Wed Jan 27, 2021 9:48 pm

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

User avatar
Martin Pfaller
Posts: 60
Joined: Tue Oct 01, 2019 10:23 am

Re: Simvascular compile under Ubuntu 20.04.1 LTS

Post by Martin Pfaller » Fri Feb 05, 2021 11:24 am

Unfortunately, I don't know any other 1D open source codes that incorporate pressure losses due to stenosis.

User avatar
Sajeda Akter
Posts: 44
Joined: Sun Feb 11, 2018 3:06 am

Re: Simvascular compile under Ubuntu 20.04.1 LTS

Post by Sajeda Akter » Fri Feb 05, 2021 11:28 pm

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

User avatar
David Parker
Posts: 1747
Joined: Tue Aug 23, 2005 2:43 pm

Re: Simvascular compile under Ubuntu 20.04.1 LTS

Post by David Parker » Tue Feb 09, 2021 11:40 am

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

POST REPLY