Page 1 of 1

Simvascular compile under Ubuntu 20.04.1 LTS

Posted: Fri Jan 15, 2021 8:43 pm
by sajeda
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

Re: Simvascular compile under Ubuntu 20.04.1 LTS

Posted: Tue Jan 19, 2021 8:26 pm
by davep
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

Re: Simvascular compile under Ubuntu 20.04.1 LTS

Posted: Thu Jan 21, 2021 9:39 am
by pfaller
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'])

Re: Simvascular compile under Ubuntu 20.04.1 LTS

Posted: Tue Jan 26, 2021 2:22 am
by sajeda
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

Re: Simvascular compile under Ubuntu 20.04.1 LTS

Posted: Wed Jan 27, 2021 6:50 pm
by pfaller
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

Re: Simvascular compile under Ubuntu 20.04.1 LTS

Posted: Wed Jan 27, 2021 9:48 pm
by sajeda
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

Re: Simvascular compile under Ubuntu 20.04.1 LTS

Posted: Fri Feb 05, 2021 11:24 am
by pfaller
Unfortunately, I don't know any other 1D open source codes that incorporate pressure losses due to stenosis.

Re: Simvascular compile under Ubuntu 20.04.1 LTS

Posted: Fri Feb 05, 2021 11:28 pm
by sajeda
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

Re: Simvascular compile under Ubuntu 20.04.1 LTS

Posted: Tue Feb 09, 2021 11:40 am
by davep
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