# force stream lines to go up to end of simulation domain

**URL:** https://discourse.paraview.org/t/force-stream-lines-to-go-up-to-end-of-simulation-domain/14048
**Category:** ParaView Support
**Created:** [February 28, 2024, 4:31pm UTC](https://discourse.paraview.org/t/force-stream-lines-to-go-up-to-end-of-simulation-domain/14048 "2024-02-28T16:31:06Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![otaolafr](https://discourse.paraview.org/user_avatar/discourse.paraview.org/otaolafr/32/3595_2.png) [@otaolafr](https://discourse.paraview.org/u/otaolafr)
#### Post date: [February 28, 2024, 4:31pm UTC](https://discourse.paraview.org/t/force-stream-lines-to-go-up-to-end-of-simulation-domain/14048/1 "2024-02-28T16:31:07Z")

</div>

Hello,  
I have created stream lines from a custom source,  
the simulation is a tube with an internal mixer. (with axial direction be Z)  
for the source of the stream lines,

1. load the inlet patch
2. use extract block
3. use slice in the extract block in X direction by 10 elements
4. use slice in the previous created slice in Y direction by 10 elements this creates a homogeneous grid

this works like charm, with the only issue that when I try to ‘show’ the distribution of the stream lines at the end of the tube (at 0.99 zMax), using slice, I am getting a smaller number of points than the ones from the source, some of them are stoped over the tube.  
I have played with the limits of the stream line filter and went up to:

```auto
MaximumStepLength = 0.05
MaximumSteps = 200000
MaximumStreamlineLength = 1000000.0

```

when the tube only makes 0.05x0.05x1 in total dimensions.  
the number of ‘seeds’ lost is quite small (~14% see photo down the post) but I would like to know if there is any other option/parameter to enable the seeds that are stopped in the walls to continue and exit the reactor.

 ![image](https://discourse.paraview.org/uploads/default/original/2X/2/2f2ea6629e9bbd32ce28139dffaddba4a5a6ec3f.png)  
thanks in advance,

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [February 28, 2024, 4:43pm UTC](https://discourse.paraview.org/t/force-stream-lines-to-go-up-to-end-of-simulation-domain/14048/2 "2024-02-28T16:43:42Z")

</div>

They probably go out of domain, are you using the streamtracer ?

---

<div class="post-metadata">

### Author: ![otaolafr](https://discourse.paraview.org/user_avatar/discourse.paraview.org/otaolafr/32/3595_2.png) [@otaolafr](https://discourse.paraview.org/u/otaolafr)
#### Post date: [February 29, 2024, 1:03pm UTC](https://discourse.paraview.org/t/force-stream-lines-to-go-up-to-end-of-simulation-domain/14048/3 "2024-02-29T13:03:58Z")

</div>

Hello Mathieu,  
Sorry for the late response,  
I am using stream lines from custom source.  
I feel from the images that some of streams ‘stops’ over some walls I can imagine that is the 0 velocity from the wall, but not sure… As even if I increase the parameters that I post it this stream lines do not grow more.  
Regards,

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [February 29, 2024, 1:13pm UTC](https://discourse.paraview.org/t/force-stream-lines-to-go-up-to-end-of-simulation-domain/14048/4 "2024-02-29T13:13:30Z")

</div>

Please share data and a statefile

---

<div class="post-metadata">

### Author: ![otaolafr](https://discourse.paraview.org/user_avatar/discourse.paraview.org/otaolafr/32/3595_2.png) [@otaolafr](https://discourse.paraview.org/u/otaolafr)
#### Post date: [March 4, 2024, 6:20am UTC](https://discourse.paraview.org/t/force-stream-lines-to-go-up-to-end-of-simulation-domain/14048/5 "2024-03-04T06:20:30Z")

</div>

Hello Mathieu,  
I cleaned the case to the bare bones.  
here it is:  
[https://filesender.renater.fr/?s=download&token=a45e660e-3c34-4470-b2fc-9e3ee235b54e](https://filesender.renater.fr/?s=download&token=a45e660e-3c34-4470-b2fc-9e3ee235b54e)  
there is a script “paraviewNew.py” inside that is the one I am running to get the streamlines&points. hope it helps.  
(and as you can see if you check the length of pointsOfPatchData and pointsAtOutletData they are 7660 and 6592 respectively for a tube with one inlet and one outlet so, no particles should ‘go out’ of the system without going thought the outlet( where the pointsAtOutletData is taken))  
sorry didnt saw that you asked also for a statefile, the python script will give the exact result i am facing, in any case you prefere here is the statefile  
[stateFile.pvsm](https://discourse.paraview.org/uploads/short-url/nMRgOY57N2TzsJHxN2okZ1rQzYa.pvsm) (136.8 KB)  
for example here are two streamlines that ‘stop’ at one moment indeferently of the values that I put in the stream line from custom source parameters:

 ![image](https://discourse.paraview.org/uploads/default/original/2X/6/60edb480261dee3363b24cf825115297c18b6220.png)

---

<div class="post-metadata">

### Author: ![otaolafr](https://discourse.paraview.org/user_avatar/discourse.paraview.org/otaolafr/32/3595_2.png) [@otaolafr](https://discourse.paraview.org/u/otaolafr)
#### Post date: [March 8, 2024, 7:33am UTC](https://discourse.paraview.org/t/force-stream-lines-to-go-up-to-end-of-simulation-domain/14048/6 "2024-03-08T07:33:18Z")

</div>

Hello Mathieu,  
any solution that you can imagine for this? is this a bug?  
I played with every parameter in the filter (stream lines from custom source) that i could find and nothing solved it…  
thanks in advance,

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [March 8, 2024, 2:33pm UTC](https://discourse.paraview.org/t/force-stream-lines-to-go-up-to-end-of-simulation-domain/14048/7 "2024-03-08T14:33:35Z")

</div>

I tried your statefile with 5.11 and 5.12 and got segaults everytime. More investigation needed.

In any case, you may want to switch to point locator if not already.

---

<div class="post-metadata">

### Author: ![otaolafr](https://discourse.paraview.org/user_avatar/discourse.paraview.org/otaolafr/32/3595_2.png) [@otaolafr](https://discourse.paraview.org/u/otaolafr)
#### Post date: [March 8, 2024, 2:41pm UTC](https://discourse.paraview.org/t/force-stream-lines-to-go-up-to-end-of-simulation-domain/14048/8 "2024-03-08T14:41:05Z")

</div>

Hello Mathieu,  
what do you mean by `segaults`?  
same question to the `point locator`, you mean the path in the python script? if that, yeah, I changed to:

```auto
foamFile='sim.foam'
casePath=str( __file__ ).replace('\\','/')
casePath=casePath.replace(casePath.split('/')[-1],'')
path=casePath+foamFile

```

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [March 8, 2024, 3:01pm UTC](https://discourse.paraview.org/t/force-stream-lines-to-go-up-to-end-of-simulation-domain/14048/9 "2024-03-08T15:01:27Z")

</div>

I’m using the pvsm.

By segfault I mean a crash.

---

<div class="post-metadata">

### Author: ![otaolafr](https://discourse.paraview.org/user_avatar/discourse.paraview.org/otaolafr/32/3595_2.png) [@otaolafr](https://discourse.paraview.org/u/otaolafr)
#### Post date: [March 8, 2024, 3:08pm UTC](https://discourse.paraview.org/t/force-stream-lines-to-go-up-to-end-of-simulation-domain/14048/10 "2024-03-08T15:08:23Z")

</div>

oh, my bad, maybe because not enought RAM? as it is creating a lot of streamlines, here is the same state with way less.  
[stateWithLessStreamLines.pvsm](https://discourse.paraview.org/uploads/short-url/69dtg5IDNUbKmNknj0uaVKxttG9.pvsm) (236.6 KB) (this but even the previous pvsm file runned correctly for me over tuxedOS (ubuntu based) in paraview 5.12.0)  
and even with less number of stream lines (less seed points) it is always the same issue of having lines that stop…

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [March 8, 2024, 4:22pm UTC](https://discourse.paraview.org/t/force-stream-lines-to-go-up-to-end-of-simulation-domain/14048/11 "2024-03-08T16:22:02Z")

</div>

I dont see any streamlines stopping using 5.12.0:

 ![image](https://discourse.paraview.org/uploads/default/original/2X/f/f0b94db611285854f46ad2dd46bf7bba4ed5d2de.png)

---

<div class="post-metadata">

### Author: ![otaolafr](https://discourse.paraview.org/user_avatar/discourse.paraview.org/otaolafr/32/3595_2.png) [@otaolafr](https://discourse.paraview.org/u/otaolafr)
#### Post date: [March 8, 2024, 5:01pm UTC](https://discourse.paraview.org/t/force-stream-lines-to-go-up-to-end-of-simulation-domain/14048/12 "2024-03-08T17:01:16Z")

</div>

hello Mathieu,  
have a look at the inlet and at the outlet you will see different number of streams,  
also in the figure pretty sure it can be seen that is being cutted

 ![image](https://discourse.paraview.org/uploads/default/original/2X/2/28fa6ccb5d44f85c5d1eeb1b65f1a0c7c8204bb4.png)  
 ![image](https://discourse.paraview.org/uploads/default/original/2X/e/ec8a35efb99ff6be26a58c728158d39b443834e1.jpeg)

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [March 11, 2024, 8:46am UTC](https://discourse.paraview.org/t/force-stream-lines-to-go-up-to-end-of-simulation-domain/14048/13 "2024-03-11T08:46:58Z")

</div>

They go out of domain:

 ![image](https://discourse.paraview.org/uploads/default/original/2X/8/866414573174d7cf40d881b9ac045542f4cc1646.jpeg)

---

<div class="post-metadata">

### Author: ![otaolafr](https://discourse.paraview.org/user_avatar/discourse.paraview.org/otaolafr/32/3595_2.png) [@otaolafr](https://discourse.paraview.org/u/otaolafr)
#### Post date: [March 11, 2024, 9:08am UTC](https://discourse.paraview.org/t/force-stream-lines-to-go-up-to-end-of-simulation-domain/14048/14 "2024-03-11T09:08:28Z")

</div>

Hello mathieu,  
thanks for the insight, but how can I resolve this? as the velocity on the wall (cylindrical surface) is equal to 0 in each direction, and this should not happen as it is not physically accurate. is there any way to stop the stream lines of ‘going out of the domain’?  
the same happends over the mixer with one of the stream lines:  
 ![image](https://discourse.paraview.org/uploads/default/original/2X/3/35489d577537da34a4526ea454eada2b7aff1967.png)

regards,

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [March 11, 2024, 9:16am UTC](https://discourse.paraview.org/t/force-stream-lines-to-go-up-to-end-of-simulation-domain/14048/15 "2024-03-11T09:16:03Z")

</div>

The particles has residual velocity so the 0 velocity at the surface means that it will keep going out slowly but surely. You need to have a small invward velocity at the surface to avoid that.

Alternatively, use a streamtracer that support boundary interaction like the LagrandianParticleTracker.

More complex to setup though: [https://www.kitware.com/vtk-and-paraview-add-highly-configurable-particle-tracker/](https://www.kitware.com/vtk-and-paraview-add-highly-configurable-particle-tracker/)
