# Best Practice For Plotting Streamlines Around a Cylinder

**URL:** https://discourse.paraview.org/t/best-practice-for-plotting-streamlines-around-a-cylinder/2351
**Category:** ParaView Support
**Created:** [August 2, 2019, 2:53pm UTC](https://discourse.paraview.org/t/best-practice-for-plotting-streamlines-around-a-cylinder/2351 "2019-08-02T14:53:14Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Ali\_Shayegh](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ali_shayegh/32/1837_2.png) [@Ali\_Shayegh](https://discourse.paraview.org/u/Ali_Shayegh)
#### Post date: [August 2, 2019, 2:53pm UTC](https://discourse.paraview.org/t/best-practice-for-plotting-streamlines-around-a-cylinder/2351/1 "2019-08-02T14:53:14Z")

</div>

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

 ![flowOverCylRe20OF41-2](https://discourse.paraview.org/uploads/default/original/2X/c/c4145786bca7fc11eb9e1a16f152e949d8a22924.png)  
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…  
 ![flowOverCylRe20OF41-5](https://discourse.paraview.org/uploads/default/original/2X/1/1259b15c6987cdec18466ed312af1b7016c43898.png)  
create ‘plane source’ -\> ‘resample with dataset filter’ -\> ‘another plane source’ -\> ‘stream tracer with custom source’ [from [this link](https://discourse.paraview.org/t/streamlines-on-sphere-surface/1014)]  
I ended up with this:  
 ![streamLine](https://discourse.paraview.org/uploads/default/original/2X/a/ade3c0b89943c031870f9be15cbefb4ce3594e0b.png)  
I really appreciate anyone commenting on this question.  
[flowOverCylRe20OF41-streamlineWithCustomSource.pvsm](https://discourse.paraview.org/uploads/short-url/2R4AIh3SY224POogpqvt9vMvILE.pvsm) (250.0 KB)

---

<div class="post-metadata">

### Author: ![danlipsa](https://discourse.paraview.org/user_avatar/discourse.paraview.org/danlipsa/32/1563_2.png) [@danlipsa](https://discourse.paraview.org/u/danlipsa)
#### Post date: [August 2, 2019, 3:22pm UTC](https://discourse.paraview.org/t/best-practice-for-plotting-streamlines-around-a-cylinder/2351/2 "2019-08-02T15:22:37Z")

</div>

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

[https://blog.kitware.com/evenly-spaced-streamlines-2d/](https://blog.kitware.com/evenly-spaced-streamlines-2d/)

---

<div class="post-metadata">

### Author: ![Ali\_Shayegh](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ali_shayegh/32/1837_2.png) [@Ali\_Shayegh](https://discourse.paraview.org/u/Ali_Shayegh)
#### Post date: [August 3, 2019, 9:31am UTC](https://discourse.paraview.org/t/best-practice-for-plotting-streamlines-around-a-cylinder/2351/3 "2019-08-03T09:31:27Z")

</div>

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)  
> Request: REQUEST\_DATA  
> FROM\_OUTPUT\_PORT: 0  
> ALGORITHM\_AFTER\_FORWARD: 1  
> FORWARD\_DIRECTION: 0

I’ve included my case. Thank you so much!  
[flowOverCyl.tar.gz](https://discourse.paraview.org/uploads/short-url/4M7YMtIKOFUAa8rBUSH2Hh3CyjT.gz) (3.7 MB)

---

<div class="post-metadata">

### Author: ![danlipsa](https://discourse.paraview.org/user_avatar/discourse.paraview.org/danlipsa/32/1563_2.png) [@danlipsa](https://discourse.paraview.org/u/danlipsa)
#### Post date: [August 5, 2019, 1:44pm UTC](https://discourse.paraview.org/t/best-practice-for-plotting-streamlines-around-a-cylinder/2351/4 "2019-08-05T13:44:41Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Ali\_Shayegh](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ali_shayegh/32/1837_2.png) [@Ali\_Shayegh](https://discourse.paraview.org/u/Ali_Shayegh)
#### Post date: [August 7, 2019, 4:36am UTC](https://discourse.paraview.org/t/best-practice-for-plotting-streamlines-around-a-cylinder/2351/5 "2019-08-07T04:36:58Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![danlipsa](https://discourse.paraview.org/user_avatar/discourse.paraview.org/danlipsa/32/1563_2.png) [@danlipsa](https://discourse.paraview.org/u/danlipsa)
#### Post date: [August 7, 2019, 2:14pm UTC](https://discourse.paraview.org/t/best-practice-for-plotting-streamlines-around-a-cylinder/2351/6 "2019-08-07T14:14:24Z")

</div>

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

[flow.pvsm](https://discourse.paraview.org/uploads/short-url/hIDY2N87UaUeplH8yYjPMNlkw1C.pvsm) (376.5 KB)

 ![flow](https://discourse.paraview.org/uploads/default/original/2X/b/b997a35bda013ef22d8a88c6fa793a60b47af847.png)

---

<div class="post-metadata">

### Author: ![Sana\_Ullah](https://discourse.paraview.org/user_avatar/discourse.paraview.org/sana_ullah/32/1874_2.png) [@Sana\_Ullah](https://discourse.paraview.org/u/Sana_Ullah)
#### Post date: [August 9, 2019, 7:35am UTC](https://discourse.paraview.org/t/best-practice-for-plotting-streamlines-around-a-cylinder/2351/7 "2019-08-09T07:35:57Z")

</div>

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\_x_iHAT+U\_y_jHAT)  
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.  
Best

---

<div class="post-metadata">

### Author: ![Ali\_Shayegh](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ali_shayegh/32/1837_2.png) [@Ali\_Shayegh](https://discourse.paraview.org/u/Ali_Shayegh)
#### Post date: [August 9, 2019, 8:16pm UTC](https://discourse.paraview.org/t/best-practice-for-plotting-streamlines-around-a-cylinder/2351/8 "2019-08-09T20:16:42Z")

</div>

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?  
Best,  
Ali

---

<div class="post-metadata">

### Author: ![Ali\_Shayegh](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ali_shayegh/32/1837_2.png) [@Ali\_Shayegh](https://discourse.paraview.org/u/Ali_Shayegh)
#### Post date: [August 9, 2019, 8:22pm UTC](https://discourse.paraview.org/t/best-practice-for-plotting-streamlines-around-a-cylinder/2351/9 "2019-08-09T20:22:25Z")

</div>

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,  
Ali

---

<div class="post-metadata">

### Author: ![danlipsa](https://discourse.paraview.org/user_avatar/discourse.paraview.org/danlipsa/32/1563_2.png) [@danlipsa](https://discourse.paraview.org/u/danlipsa)
#### Post date: [August 9, 2019, 8:30pm UTC](https://discourse.paraview.org/t/best-practice-for-plotting-streamlines-around-a-cylinder/2351/10 "2019-08-09T20:30:31Z")

</div>

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.

 ![5](https://discourse.paraview.org/uploads/default/original/2X/5/5884558ed3de73a88b3aa7c6d38e7f3fa808ada3.png)

---

<div class="post-metadata">

### Author: ![Ali\_Shayegh](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ali_shayegh/32/1837_2.png) [@Ali\_Shayegh](https://discourse.paraview.org/u/Ali_Shayegh)
#### Post date: [August 10, 2019, 4:19pm UTC](https://discourse.paraview.org/t/best-practice-for-plotting-streamlines-around-a-cylinder/2351/11 "2019-08-10T16:19:03Z")

</div>

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

---

<div class="post-metadata">

### Author: ![JMir](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/b5e925/32.png) [@JMir](https://discourse.paraview.org/u/JMir)
#### Post date: [January 23, 2020, 12:58pm UTC](https://discourse.paraview.org/t/best-practice-for-plotting-streamlines-around-a-cylinder/2351/12 "2020-01-23T12:58:50Z")

</div>

Dear Ali,

I tried your methodology, however I got the errors:

- vtkEvenlySpacedStreamlines2D does not support planes not aligned with XY.

and

Debug: Off  
Modified Time: 1703398  
Reference Count: 1  
Registered Events: (none)  
Request: REQUEST\_DATA  
FORWARD\_DIRECTION: 0  
ALGORITHM\_AFTER\_FORWARD: 1  
FROM\_OUTPUT\_PORT: 0

I also used the methodology suggested by Sana before and got the same error.  
I am using Paraview 5.7.0 on windows.

Can you please point me to what I am doing wrong?  
Thanks a lot.  
Joao

---

<div class="post-metadata">

### Author: ![Ali\_Shayegh](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ali_shayegh/32/1837_2.png) [@Ali\_Shayegh](https://discourse.paraview.org/u/Ali_Shayegh)
#### Post date: [January 23, 2020, 3:25pm UTC](https://discourse.paraview.org/t/best-practice-for-plotting-streamlines-around-a-cylinder/2351/13 "2020-01-23T15:25:41Z")

</div>

Hi Joao,

Did you use “Slice” Filter first?  
If not, use it first. Then apply EvenlySpacedStreamlines2D on that.

Best,  
Ali

---

<div class="post-metadata">

### Author: ![JMir](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/b5e925/32.png) [@JMir](https://discourse.paraview.org/u/JMir)
#### Post date: [January 24, 2020, 8:17am UTC](https://discourse.paraview.org/t/best-practice-for-plotting-streamlines-around-a-cylinder/2351/14 "2020-01-24T08:17:15Z")

</div>

Dear Ali, I did used the slice filter. I took z normal so to get a XY plane where to do the streamlines. Still go the error. I see after the calculator filter that I can choose for “showing” the 3 directions however the z direction shows values from 0 to 1.2\*10^-38.

Can this be the reason, that is still a 3D vector?  
Thanks a lot.

Joao

---

<div class="post-metadata">

### Author: ![Ali\_Shayegh](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ali_shayegh/32/1837_2.png) [@Ali\_Shayegh](https://discourse.paraview.org/u/Ali_Shayegh)
#### Post date: [January 25, 2020, 12:45pm UTC](https://discourse.paraview.org/t/best-practice-for-plotting-streamlines-around-a-cylinder/2351/15 "2020-01-25T12:45:20Z")

</div>

If you attach your case I hope I can help better.

---

<div class="post-metadata">

### Author: ![JMir](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/b5e925/32.png) [@JMir](https://discourse.paraview.org/u/JMir)
#### Post date: [January 28, 2020, 8:39am UTC](https://discourse.paraview.org/t/best-practice-for-plotting-streamlines-around-a-cylinder/2351/16 "2020-01-28T08:39:15Z")

</div>

Dear Ali,

I sent you a message. How can I share my case here?  
Thanks a lot.

Best wishes,

Joao

---

<div class="post-metadata">

### Author: ![Ali\_Shayegh](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ali_shayegh/32/1837_2.png) [@Ali\_Shayegh](https://discourse.paraview.org/u/Ali_Shayegh)
#### Post date: [January 30, 2020, 8:02am UTC](https://discourse.paraview.org/t/best-practice-for-plotting-streamlines-around-a-cylinder/2351/17 "2020-01-30T08:02:41Z")

</div>

When you press reply button, a box appears, above of which are some keys like _Hyperlink_ , _Emoji_ , _Upload_… . press upload and attach your file. your stat file is not enough. Make a minimum sized zip file including stat and your case.

---

<div class="post-metadata">

### Author: ![JMir](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/b5e925/32.png) [@JMir](https://discourse.paraview.org/u/JMir)
#### Post date: [January 30, 2020, 8:31am UTC](https://discourse.paraview.org/t/best-practice-for-plotting-streamlines-around-a-cylinder/2351/18 "2020-01-30T08:31:29Z")

</div>

Dear Ali, thanks once again for your help. This is the case. I shared like this as it is a quite large one (around 400 mb)  
I tried to do a 2D slice at z=0 with normal (0 0 1) and plot the 2D streamlines

Thanks a lot in advance for any help.[3D data](https://drive.google.com/file/d/1ShKeS8c0TYw4bWF3J8s3e5Ix6amqOv5S/view?usp=sharing)

---

<div class="post-metadata">

### Author: ![Ali\_Shayegh](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ali_shayegh/32/1837_2.png) [@Ali\_Shayegh](https://discourse.paraview.org/u/Ali_Shayegh)
#### Post date: [January 31, 2020, 11:56am UTC](https://discourse.paraview.org/t/best-practice-for-plotting-streamlines-around-a-cylinder/2351/19 "2020-01-31T11:56:17Z")

</div>

I tested the case, however unfortunately with no success. I also left a comment [here](https://discourse.paraview.org/t/evenly-spaced-streamlines-2d/3452/7) in the hope that the issue be solved.

---

<div class="post-metadata">

### Author: ![danlipsa](https://discourse.paraview.org/user_avatar/discourse.paraview.org/danlipsa/32/1563_2.png) [@danlipsa](https://discourse.paraview.org/u/danlipsa)
#### Post date: [January 31, 2020, 3:09pm UTC](https://discourse.paraview.org/t/best-practice-for-plotting-streamlines-around-a-cylinder/2351/20 "2020-01-31T15:09:29Z")

</div>

A fix for this issue is at:  
[https://gitlab.kitware.com/vtk/vtk/merge\_requests/6436](https://gitlab.kitware.com/vtk/vtk/merge_requests/6436)

It will take a few weeks for this fix to be picked up by ParaView, but it will be eventually in ParaView master.

Here is a picture I generated from that dataset.

 ![streamlines.png](https://discourse.paraview.org/uploads/default/original/2X/a/ad348a17fd7ffb55100a2cbe3bc1036e80f97658.png)

[Next page](https://discourse.paraview.org/t/best-practice-for-plotting-streamlines-around-a-cylinder/2351.md?page=2)
