Best Practice For Plotting Streamlines Around a Cylinder

I made a simulation using OpenFOAM for flow around a cylinder. StreamLines with ‘High resolution Line Source’, gives:

While I want a uniform streamline spacing, it is clear that in the behind of the cylinder, Streamlines are clustered and so close to each other. To achieve a uniform distribution of streamlines like the following image, I went through these steps…
create ‘plane source’ -> ‘resample with dataset filter’ -> ‘another plane source’ -> ‘stream tracer with custom source’ [from this link]
I ended up with this:

I really appreciate anyone commenting on this question.
flowOverCylRe20OF41-streamlineWithCustomSource.pvsm (250.0 KB)

Can you share your data? If your data is in XY plane you can try EvenlySpacedStreamlines2D.

1 Like

This is EXACTLY what I meant! But, when I apply this on my case, nothing appears but this error

Reference Count: 1
Registered Events: (none)

I’ve included my case. Thank you so much!
flowOverCyl.tar.gz (3.7 MB)

How do you read the data you sent? It does not seem to be a .foam file. Thanks.

Generating an empty text file with .foam extension, works. Open this empty file in paraview, then you have access to all of the data.
Thank you.

Here is the picture I got with the default parameters and the ParaView state file I used to get that.

flow.pvsm (376.5 KB)


Okay, Here are is the procedure that worked for me.

  1. If your simulation is 3D,
    a) make a slice at your required position
    b) Convert 3D velocity field to 2D velocity field using calculator (U_xiHAT+U_yjHAT)
    c) Now Plot streamlines using evenly distributed streamlines filter
    d) Select your 2D velocity field as vector field
    e) Adjust start position such that it is away from cylinder body

Hope it works for you.

1 Like

Dear Dan,
I reviewed your settings. Yes, it works, but as soon as I change ,for example, “start point” to (-1 0 0 ) or “separating distance” to 0.5, paraview crashes and is suddenly closed. I have to mention that this does not happen for every change that I make, but it does often.
Could you please provide optimum parameters’ values to obtain a “neat” picture as I have included in the question?

Dear Sana,
To work around 3D field, I used a slice filter so that steps a , b are not needed anymore. As I replied to Dan, right now, my problem is obtaining a “neat and tidy” picture of streamlines. I want to know what do filter’s parameters work?( “start point” , “separating distance", etc). This way I can find optimum parameters to obtain a tidy image.
Thank you,

What version of paraview are you using? I use ParaView master, probably 5.7 RC2 would work the same.

Here is the picture with separating distance 0.5, the same ParaView state file.
Seems like in the picture you sent originally the separating distance is variable, so you won’t be able to get something that matches exactly.

Thank you Dan. I use paraview 5.6. Probably I have to install the newer version that you’ve mentioned.