1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Finding streamlines in blood flow

  1. Aug 8, 2012 #1
    1. The problem statement, all variables and given/known data

    I'm creating my master thesis in computer science. The title is 'simulator of magnetic resonance angiography'. My problem is that I have to create some kind of overlay on my image with streamlines of flowing blood. I have to arrays with velocity vectors in two directions up/down and left/right - each pixel has its two values in these two directions. How can I simply create streamlines using this data?

    2. Relevant equations

    I'm using Eulers approach - connecting vectors point by point

    3. The attempt at a solution

    I've tried to use Eulers approach, but at some point it didn't work (see picture)
    as you can see, this line isn't going right way. it should go into right part of the vessel, but it's not. Colours are representation of value of velocity (green means fast, red - slow). Is there any simple solution for my problem?

    I'm creating it in c++ and qt if this information can help you :)
  2. jcsd
  3. Aug 8, 2012 #2


    User Avatar
    Science Advisor
    Gold Member

    If using Matlab is an option to you, then you can use its streamline plot function. You can easily overlay the lines onto your image. You can also overlay arrows representing the vector values.
  4. Aug 8, 2012 #3
    You can calculate the stream function, and plot the lines of constant stream function. This will give the stream lines. The main direction of the velocity in your problem sees to be in the upward (y) direction. The partial derivative of the stream function with respect to x is equal to the velocity in the y-direction. You can integrate with respect to x to get the stream function values along each level of y. The stream function should be constant with respect to x along each boundary of the channel. Take the value at the left boundary equal to zero. Hopefully, the values of the stream function you calculate at the right boundary will all be approximately equal. This will be the case if the flow is incompressible. All this hinges, of course, if the flow is two dimensional (channel flow). If those are tubes, you have to proceed differently.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook