Page 1 of 2
WSS calculations directly from SimVascular
Posted: Mon May 13, 2019 10:27 am
by atefehrazavi
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
Re: WSS calculations directly from SimVascular
Posted: Mon May 13, 2019 4:19 pm
by davep
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
Re: WSS calculations directly from SimVascular
Posted: Thu May 16, 2019 9:49 am
by atefehrazavi
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
Re: WSS calculations directly from SimVascular
Posted: Thu May 16, 2019 10:33 am
by davep
Hi Atefeh,
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
where
flxnrm is the outward normal and
flxres is the viscous flux.
Cheers,
Dave
Re: WSS calculations directly from SimVascular
Posted: Wed May 22, 2019 8:10 pm
by atefehrazavi
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
Re: WSS calculations directly from SimVascular
Posted: Wed May 22, 2019 9:39 pm
by davep
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
Re: WSS calculations directly from SimVascular
Posted: Thu May 23, 2019 8:36 am
by atefehrazavi
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
Re: WSS calculations directly from SimVascular
Posted: Thu May 23, 2019 10:01 am
by atefehrazavi
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
Re: WSS calculations directly from SimVascular
Posted: Fri May 24, 2019 10:59 am
by davep
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
Re: WSS calculations directly from SimVascular
Posted: Fri May 24, 2019 3:13 pm
by atefehrazavi
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