# Minimum sized time step rejected 2d pipe flow

**URL:** <https://pyfr.discourse.group/t/minimum-sized-time-step-rejected-2d-pipe-flow/720>\
**Category:** Cases\
**Created:** [11 December 2022 13:10 UTC](https://pyfr.discourse.group/t/minimum-sized-time-step-rejected-2d-pipe-flow/720 "2022-12-11T13:10:58Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![alinala](https://avatars.discourse-cdn.com/v4/letter/a/a4c791/32.png) [@alinala](https://pyfr.discourse.group/u/alinala)\
**Post date:** [11 December 2022 13:10 UTC](https://pyfr.discourse.group/t/minimum-sized-time-step-rejected-2d-pipe-flow/720/1 "2022-12-11T13:10:58Z")

</div>

Hi all,  
I am trying to simulate a really simple case of 2D flow in-between two parallel plates. But keep getting ‘minimum sized time step rejected’. Tried different meshes, tried reducing time step, tried with and without anti-aliasing. Still the same error.

Can you please help  
[Attached here msh and ini files](https://drive.google.com/drive/folders/1yH7Ek16M9HEmK99m-7Jlpud_uBfDMoGc)

Thank you in advance,  
Alina

---

<div class="post-metadata">

**Author:** ![WillT](https://avatars.discourse-cdn.com/v4/letter/w/bc79bd/32.png) [@WillT](https://pyfr.discourse.group/u/WillT)\
**Post date:** [12 December 2022 08:54 UTC](https://pyfr.discourse.group/t/minimum-sized-time-step-rejected-2d-pipe-flow/720/2 "2022-12-12T08:54:15Z")

</div>

I think the issue is that the boundary conditions you are applying aren’t quite doing what you want.

Looing at your mesh, I presume that you want the flow to be coming in the bottom at y=-21.8987 and exiting at y=42.1013? If so you need to swap the x and y velocities in your initial condition and inlet boundary condition.

---

<div class="post-metadata">

**Author:** ![alinala](https://avatars.discourse-cdn.com/v4/letter/a/a4c791/32.png) [@alinala](https://pyfr.discourse.group/u/alinala)\
**Post date:** [13 December 2022 08:37 UTC](https://pyfr.discourse.group/t/minimum-sized-time-step-rejected-2d-pipe-flow/720/3 "2022-12-13T08:37:30Z")

</div>

Ohhh you are right.  
It works now!

Thank you,  
Alina

---

<div class="post-metadata">

**Author:** ![alinala](https://avatars.discourse-cdn.com/v4/letter/a/a4c791/32.png) [@alinala](https://pyfr.discourse.group/u/alinala)\
**Post date:** [15 December 2022 21:09 UTC](https://pyfr.discourse.group/t/minimum-sized-time-step-rejected-2d-pipe-flow/720/4 "2022-12-15T21:09:06Z")

</div>

Hi all,  
I have changed the geometry, and now it is aligned with x axes and the the gap between the plates is only 2 mm. Again I am getting ‘minimum sized time step rejected’.

Can you please take a look,  
Alina  
[Attached files](https://drive.google.com/drive/folders/1yH7Ek16M9HEmK99m-7Jlpud_uBfDMoGc)

---

<div class="post-metadata">

**Author:** ![WillT](https://avatars.discourse-cdn.com/v4/letter/w/bc79bd/32.png) [@WillT](https://pyfr.discourse.group/u/WillT)\
**Post date:** [16 December 2022 09:01 UTC](https://pyfr.discourse.group/t/minimum-sized-time-step-rejected-2d-pipe-flow/720/5 "2022-12-16T09:01:08Z")

</div>

Have you tried looking at solution at time t=0 to see if the boundary conditions and initial condition are doing what you expect? The next thing I’d try is setting the writer plugin dt to be small and see what the flow looks like in the build up to it failing.

---

<div class="post-metadata">

**Author:** ![alinala](https://avatars.discourse-cdn.com/v4/letter/a/a4c791/32.png) [@alinala](https://pyfr.discourse.group/u/alinala)\
**Post date:** [18 December 2022 20:59 UTC](https://pyfr.discourse.group/t/minimum-sized-time-step-rejected-2d-pipe-flow/720/6 "2022-12-18T20:59:51Z")

</div>

Boundary and initial conditions looks right.  
I have set a writer plugin to be really small but still only [file name]-000.pyfrs is produced.

---

<div class="post-metadata">

**Author:** ![WillT](https://avatars.discourse-cdn.com/v4/letter/w/bc79bd/32.png) [@WillT](https://pyfr.discourse.group/u/WillT)\
**Post date:** [20 December 2022 10:25 UTC](https://pyfr.discourse.group/t/minimum-sized-time-step-rejected-2d-pipe-flow/720/7 "2022-12-20T10:25:45Z")

</div>

Can you set a small and constant time step and look at what it happening?

---

<div class="post-metadata">

**Author:** ![alinala](https://avatars.discourse-cdn.com/v4/letter/a/a4c791/32.png) [@alinala](https://pyfr.discourse.group/u/alinala)\
**Post date:** [20 December 2022 21:33 UTC](https://pyfr.discourse.group/t/minimum-sized-time-step-rejected-2d-pipe-flow/720/8 "2022-12-20T21:33:09Z")

</div>

It failed with NaNs detected at t = 1.9399999999999996e-06

---

<div class="post-metadata">

**Author:** ![WillT](https://avatars.discourse-cdn.com/v4/letter/w/bc79bd/32.png) [@WillT](https://pyfr.discourse.group/u/WillT)\
**Post date:** [22 December 2022 14:06 UTC](https://pyfr.discourse.group/t/minimum-sized-time-step-rejected-2d-pipe-flow/720/9 "2022-12-22T14:06:00Z")

</div>

Looking at your mesh and ini file, your channel 0.002 wide and you are using a pressure of 1e5. With this config it doesn’t surprise me that its blowing up with such a time step. You can either further reduce the time step, or change the pressure to effectively non-dimensionalise it.

---

<div class="post-metadata">

**Author:** ![nathanbl](https://avatars.discourse-cdn.com/v4/letter/n/e480ec/32.png) [@nathanbl](https://pyfr.discourse.group/u/nathanbl)\
**Post date:** [26 December 2022 11:20 UTC](https://pyfr.discourse.group/t/minimum-sized-time-step-rejected-2d-pipe-flow/720/10 "2022-12-26T11:20:45Z")

</div>

![capture](https://global.discourse-cdn.com/free1/uploads/pyfr/original/1X/b2cded9b32b65d6faa24c2177afe41960705965c.png)  
Hi will, I am also working with Alina on the case. we tried to non-dimensionalise and reduce the time step but neither worked for us. I believe the issue is related to the boundary conditions. attaching a screenshot from t=1e-7, before divergence began. you can see that the no-slip boundary condition is not imposed, and instead of being 0 the velocity at the wall is increased.

Would be thankful for your assistance

Nathan

---

<div class="post-metadata">

**Author:** ![fdw](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@fdw](https://pyfr.discourse.group/u/fdw)\
**Post date:** [29 December 2022 12:09 UTC](https://pyfr.discourse.group/t/minimum-sized-time-step-rejected-2d-pipe-flow/720/11 "2022-12-29T12:09:15Z")

</div>

The major issue appears to be that you are running `p = 0`.

Regards, Freddie.

---

<div class="post-metadata">

**Author:** ![nathanbl](https://avatars.discourse-cdn.com/v4/letter/n/e480ec/32.png) [@nathanbl](https://pyfr.discourse.group/u/nathanbl)\
**Post date:** [29 December 2022 13:46 UTC](https://pyfr.discourse.group/t/minimum-sized-time-step-rejected-2d-pipe-flow/720/12 "2022-12-29T13:46:17Z")

</div>

Thank you for your answer Freddie, could you clarify for us a bit? do you mean the polynomial order or the pressure?  
we tried running with order=1,2,3, and got even faster divergence.

regarding the pressure, it is defined as P0~=1e5.

Thanks again, we really appreciate both your help and Will’s  
Nathan

---

<div class="post-metadata">

**Author:** ![fdw](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@fdw](https://pyfr.discourse.group/u/fdw)\
**Post date:** [29 December 2022 14:06 UTC](https://pyfr.discourse.group/t/minimum-sized-time-step-rejected-2d-pipe-flow/720/13 "2022-12-29T14:06:26Z")

</div>

The polynomial `order = 0` part. Here, each element only has a single degree of freedom in its cell centre. This makes it virtually impossible to meaningfully enforce any kind of boundary condition.

Regards, Freddie.

---

<div class="post-metadata">

**Author:** ![nathanbl](https://avatars.discourse-cdn.com/v4/letter/n/e480ec/32.png) [@nathanbl](https://pyfr.discourse.group/u/nathanbl)\
**Post date:** [29 December 2022 14:15 UTC](https://pyfr.discourse.group/t/minimum-sized-time-step-rejected-2d-pipe-flow/720/14 "2022-12-29T14:15:40Z")

</div>

Ok I see. like I said we tried to change it and it did not help

---

<div class="post-metadata">

**Author:** ![fdw](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@fdw](https://pyfr.discourse.group/u/fdw)\
**Post date:** [29 December 2022 14:28 UTC](https://pyfr.discourse.group/t/minimum-sized-time-step-rejected-2d-pipe-flow/720/15 "2022-12-29T14:28:48Z")

</div>

So the polynomial order is not an arbitrary constant. Rather, it should be set in conjunction with your mesh resolution based on the size of scales you expect to see in the problem.

Thus, I would suggest first starting with the Reynolds number of your problem and from there obtaining an estimate for the `y+`. Next, compare this against how much resolution you have in your domain (accounting for the polynomial order and the number of elements in the vertical direction).

Regards, Freddie.

---

<div class="post-metadata">

**Author:** ![nathanbl](https://avatars.discourse-cdn.com/v4/letter/n/e480ec/32.png) [@nathanbl](https://pyfr.discourse.group/u/nathanbl)\
**Post date:** [29 December 2022 14:50 UTC](https://pyfr.discourse.group/t/minimum-sized-time-step-rejected-2d-pipe-flow/720/16 "2022-12-29T14:50:59Z")

</div>

The Reynolds number here is very low, so to the best of my understanding and there is no Boundary layer here, just a simple Pouiselle flow. We just wanted to run a simple test case and then work our way up from there. We started with P=3 (about 20 DOF in the y direction) because this is about what we need to resolve a simple parabolic flow profile. we then reduced the order with the hope that it will help stabilize the simulation.

Nathan

---

<div class="post-metadata">

**Author:** ![fdw](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@fdw](https://pyfr.discourse.group/u/fdw)\
**Post date:** [30 December 2022 20:41 UTC](https://pyfr.discourse.group/t/minimum-sized-time-step-rejected-2d-pipe-flow/720/17 "2022-12-30T20:41:54Z")

</div>

Question: what should the x velocity be at the top- and bottom-left corners of the domain?

Regards, Freddie.

---

<div class="post-metadata">

**Author:** ![nathanbl](https://avatars.discourse-cdn.com/v4/letter/n/e480ec/32.png) [@nathanbl](https://pyfr.discourse.group/u/nathanbl)\
**Post date:** [1 January 2023 08:36 UTC](https://pyfr.discourse.group/t/minimum-sized-time-step-rejected-2d-pipe-flow/720/18 "2023-01-01T08:36:50Z")

</div>

That is a good point, there is a discontinuity between the two boundary conditions imposed there, do you think this is the reason for divergence?

---

<div class="post-metadata">

**Author:** ![fdw](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@fdw](https://pyfr.discourse.group/u/fdw)\
**Post date:** [1 January 2023 18:18 UTC](https://pyfr.discourse.group/t/minimum-sized-time-step-rejected-2d-pipe-flow/720/19 "2023-01-01T18:18:08Z")

</div>

Yes. Looking at the solution just before it diverges we see:

 ![foo](https://global.discourse-cdn.com/free1/uploads/pyfr/original/1X/56d5b9de9d04e9c7323eae40c5269570af7a3510.png)

Observe the spike in the velocity magnitude at the two corners. Indeed, this is why it is so essential to actually look at the solution just before it diverges as this typically provides a huge amount of insight into what is going on with the flow.

Regards, Freddie.

---

<div class="post-metadata">

**Author:** ![nathanbl](https://avatars.discourse-cdn.com/v4/letter/n/e480ec/32.png) [@nathanbl](https://pyfr.discourse.group/u/nathanbl)\
**Post date:** [10 January 2023 06:46 UTC](https://pyfr.discourse.group/t/minimum-sized-time-step-rejected-2d-pipe-flow/720/20 "2023-01-10T06:46:10Z")

</div>

Thank you again Freddie. We tried to change the inlet boundary condition to:  
`u=Uww*(1 -1000000*(y*y-0.002*y+0.000001))`  
where Uww is a constant. This imposes a velocity profile that is compatible with the no-slip boundary conditions (u=0 at y=0 and y=0.002). However the solution still diverges and divergence still seems to come from the corner. See attached screenshots from t=1e-7 (at the very beginning) and 4e-7 (a bit before divergence). any thoughts?

 ![capture](https://global.discourse-cdn.com/free1/uploads/pyfr/original/1X/dbe0fa53d92eec41db92fd4d5a1ddb9ce84c6558.png)

[Next page](https://pyfr.discourse.group/t/minimum-sized-time-step-rejected-2d-pipe-flow/720.md?page=2)
