WSS calculations directly from SimVascular
- Atefeh Razavi
- Posts: 33
- Joined: Sun Mar 04, 2018 10:47 am
WSS calculations directly from SimVascular
Hello,
I was wondering to know how I may extract (calculate) WSS values directly from SimVascular not Paraview.
Thank you and looking forward to your reply,
Ati
I was wondering to know how I may extract (calculate) WSS values directly from SimVascular not Paraview.
Thank you and looking forward to your reply,
Ati
- David Parker
- Posts: 1742
- Joined: Tue Aug 23, 2005 2:43 pm
Re: WSS calculations directly from SimVascular
Hi Ati,
WSS is calculated from the simulation results using the svPost program, which is part of the svSolver programs. You could have a look at the source code to see how the values are calculated (see https://github.com/SimVascular/svSolver ... ver/svPost).
Cheers,
Dave
WSS is calculated from the simulation results using the svPost program, which is part of the svSolver programs. You could have a look at the source code to see how the values are calculated (see https://github.com/SimVascular/svSolver ... ver/svPost).
Cheers,
Dave
- Atefeh Razavi
- Posts: 33
- Joined: Sun Mar 04, 2018 10:47 am
Re: WSS calculations directly from SimVascular
Hi Dave!
I looked at the code, however due to high number of variables, I did not figure out which variables were used to calculate WSS.
As defined, WSS is the velocity derived tangential stress. I was interested to see if I can calculate WSS from the velocity as well as the normal to the cell and then compare it with the WSS values given in Paraview.
Thanks,
Atefeh
I looked at the code, however due to high number of variables, I did not figure out which variables were used to calculate WSS.
As defined, WSS is the velocity derived tangential stress. I was interested to see if I can calculate WSS from the velocity as well as the normal to the cell and then compare it with the WSS values given in Paraview.
Thanks,
Atefeh
- David Parker
- Posts: 1742
- Joined: Tue Aug 23, 2005 2:43 pm
Re: WSS calculations directly from SimVascular
Hi Atefeh,
Sorry, I mislead you! The WSS calculation is actually done in the solver in solver_subroutines.f at line 1667:
where flxnrm is the outward normal and flxres is the viscous flux.
Cheers,
Dave
Sorry, I mislead you! The WSS calculation is actually done in the solver in solver_subroutines.f at line 1667:
Code: Select all
rtmp = zero
wallssVec = zero
do i=1, numnp
if (invflx(i) .ne. 0) then
rtmp(i,2:4) = flxres(i,1:3) !viscous flux
c calculate the WSS
tn = flxres(i,1) * flxnrm(i,1)
& + flxres(i,2) * flxnrm(i,2)
& + flxres(i,3) * flxnrm(i,3)
wallssVec(i,1) = flxres(i,1) - tn * flxnrm(i,1)
wallssVec(i,2) = flxres(i,2) - tn * flxnrm(i,2)
wallssVec(i,3) = flxres(i,3) - tn * flxnrm(i,3)
endif
enddo
Cheers,
Dave
- Atefeh Razavi
- Posts: 33
- Joined: Sun Mar 04, 2018 10:47 am
Re: WSS calculations directly from SimVascular
Hi Dave,
Thanks for the info.
I was wondering to know if it is possible and how I may use this code directly (probably in SV console) to extract WSS.
Another question is when using Paraview, if a line is intersected with a radial cross-section, instead of having presumably two WSS values (two points on the wall), a series of WSS values along that line are reported. I appreciate your answer.
Thank you,
Ati
Thanks for the info.
I was wondering to know if it is possible and how I may use this code directly (probably in SV console) to extract WSS.
Another question is when using Paraview, if a line is intersected with a radial cross-section, instead of having presumably two WSS values (two points on the wall), a series of WSS values along that line are reported. I appreciate your answer.
Thank you,
Ati
- David Parker
- Posts: 1742
- Joined: Tue Aug 23, 2005 2:43 pm
Re: WSS calculations directly from SimVascular
Hi Ati,
If you want to calculate wss yourself then you would need to incorporate the code I posted into a program that could read in SV results and mesh files, calculate surface normals, viscous fluxes and then wss. This would be quite involved.
If you would like to just look at the wss values then you can write them to a text file using ParaView. If you could explain to me what you would like to do with the wss values then maybe I could write a Python script to do what you want.
I believe the ParaView line probe samples the mesh at several points along the line.
Cheers,
Dave
If you want to calculate wss yourself then you would need to incorporate the code I posted into a program that could read in SV results and mesh files, calculate surface normals, viscous fluxes and then wss. This would be quite involved.
If you would like to just look at the wss values then you can write them to a text file using ParaView. If you could explain to me what you would like to do with the wss values then maybe I could write a Python script to do what you want.
I believe the ParaView line probe samples the mesh at several points along the line.
Cheers,
Dave
- Atefeh Razavi
- Posts: 33
- Joined: Sun Mar 04, 2018 10:47 am
Re: WSS calculations directly from SimVascular
Hi Dave,
I would like to check WSS results read in Paraview with a step- by step extracted one,as you explained, in a program (that could be what?).
The reason is that I have seen regions of high WSS (compared to previously reported data for the coronary simulations) and try to make sure they are accurate.
I need to mention that I have done mesh study as well (with the flow and pressure matching clinical data) and the values do not change (less than 3%) for the consecutive meshes.
Thank you,
Ati
I would like to check WSS results read in Paraview with a step- by step extracted one,as you explained, in a program (that could be what?).
The reason is that I have seen regions of high WSS (compared to previously reported data for the coronary simulations) and try to make sure they are accurate.
I need to mention that I have done mesh study as well (with the flow and pressure matching clinical data) and the values do not change (less than 3%) for the consecutive meshes.
Thank you,
Ati
- Atefeh Razavi
- Posts: 33
- Joined: Sun Mar 04, 2018 10:47 am
Re: WSS calculations directly from SimVascular
About the wss along a line, I still don't understand why more than one point on each end of the line should be reported.
The image attached showed the velocity and wss along a segment of the line (all the pink dots are WSS values which increase dramatically along the line). I would expect to see one value for WSS and then zero for the rest of the mesh. So I am not sure if the highest value of these is the one showed in WSS contours.
Thank you,
Ati
The image attached showed the velocity and wss along a segment of the line (all the pink dots are WSS values which increase dramatically along the line). I would expect to see one value for WSS and then zero for the rest of the mesh. So I am not sure if the highest value of these is the one showed in WSS contours.
Thank you,
Ati
- Attachments
-
- vel_WSS_2.JPG (47.37 KiB) Viewed 1999 times
- David Parker
- Posts: 1742
- Joined: Tue Aug 23, 2005 2:43 pm
Re: WSS calculations directly from SimVascular
Hi Ati,
I will write a program to extract the wss from the SV results files, this is something I've been wanting to do anyway.
If you are reading in.vtu files to visualize wss then the wss results are calculated for all nodes in the mesh but are only non-zero on the surface. So the line probe will sample wss values in the mesh volume. The wss will drop from a non-zero value on the surface to a zero value within an element. You can see this in the attached image, where the wss fades from red to blue within a single element.
Cheers,
Dave
I will write a program to extract the wss from the SV results files, this is something I've been wanting to do anyway.
If you are reading in.vtu files to visualize wss then the wss results are calculated for all nodes in the mesh but are only non-zero on the surface. So the line probe will sample wss values in the mesh volume. The wss will drop from a non-zero value on the surface to a zero value within an element. You can see this in the attached image, where the wss fades from red to blue within a single element.
Cheers,
Dave
- Attachments
-
- wss-probe.png (56.68 KiB) Viewed 1975 times
- Atefeh Razavi
- Posts: 33
- Joined: Sun Mar 04, 2018 10:47 am
Re: WSS calculations directly from SimVascular
Hi Dave,
Thanks for the answer and it would be great to extract wss from SV results.
So there is a range of WSS values not just WSS on the surface. So which value of this range is reported if a vtp file is used? just the maximum on the surface? or the mean of the range within the element?
Thank you,
Ati
Thanks for the answer and it would be great to extract wss from SV results.
So there is a range of WSS values not just WSS on the surface. So which value of this range is reported if a vtp file is used? just the maximum on the surface? or the mean of the range within the element?
Thank you,
Ati