# Convect error: Fatal error in Convect (R2) operator: loop =\> velocity too high ? or NaN

**URL:** https://community.freefem.org/t/convect-error-fatal-error-in-convect-r2-operator-loop-velocity-too-high-or-nan/2232
**Category:** General Discussion
**Created:** [January 20, 2023, 12:42am UTC](https://community.freefem.org/t/convect-error-fatal-error-in-convect-r2-operator-loop-velocity-too-high-or-nan/2232 "2023-01-20T00:42:38Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![mahdi](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@mahdi](https://community.freefem.org/u/mahdi)
#### Post date: [January 20, 2023, 12:42am UTC](https://community.freefem.org/t/convect-error-fatal-error-in-convect-r2-operator-loop-velocity-too-high-or-nan/2232/1 "2023-01-20T00:42:38Z")

</div>

Hi there;  
I am trying to solve a 2D advection problem, where the “p1dc” velocity fields (u, v) are computed from an algorithm and then I apply:

MaxU=max(abs(u[].max),abs(v[].max));   
timeStep=CourantNo\*(Th.hmin)/(MaxU+0.001);  
concstarNew=convect([u,v, -timeStep, concstar);

Yet I get the error after \textbf{some} time steps.

I am wondering what are the reasons? and how can I choose a time step that works?

Best  
M

---

<div class="post-metadata">

### Author: ![frederichecht](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/frederichecht/32/15_2.png) [@frederichecht](https://community.freefem.org/u/frederichecht)
#### Post date: [January 21, 2023, 4:35pm UTC](https://community.freefem.org/t/convect-error-fatal-error-in-convect-r2-operator-loop-velocity-too-high-or-nan/2232/2 "2023-01-21T16:35:40Z")

</div>

Generaly, due the discontinuity some characteristics can be lock between 2 element,
