# About residual convergence

**URL:** <https://pyfr.discourse.group/t/about-residual-convergence/1044>\
**Category:** Just Starting\
**Tags:** mesh\
**Created:** [24 February 2024 13:53 UTC](https://pyfr.discourse.group/t/about-residual-convergence/1044 "2024-02-24T13:53:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wgbb](https://avatars.discourse-cdn.com/v4/letter/w/6f9a4e/32.png) [@wgbb](https://pyfr.discourse.group/u/wgbb)\
**Post date:** [24 February 2024 13:53 UTC](https://pyfr.discourse.group/t/about-residual-convergence/1044/1 "2024-02-24T13:53:52Z")

</div>

Hello everyone,

I have a confusing question about residual convergence. When I use the first-order NS equation to calculate, the residual can reach 0.01. However, when I increase the order to 2nd and 3rd, the residual can only converge to around 30. It is worth noting that I am calculating the laminar boundary layer, so the residual should be very small.

Is it possible that the high order residual is caused by insufficient mesh refinement? Is there anything special about laminar flow calculation?

Also, I once saw on a forum that compared to turbulent walls, there seems to be a need for particularly fine grids near laminar walls. Why is this?

By the way, is the residual an absolute error or a relative error compared to the previous step?

Thank you for your help!

Best regards.

---

<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:** [24 February 2024 16:30 UTC](https://pyfr.discourse.group/t/about-residual-convergence/1044/2 "2024-02-24T16:30:21Z")

</div>

The residual norm (which is what the plugin calculates) should scale with the number of degrees of freedom. So to get a better measure you may want to divide by the total number of degrees of freedom.

In the develop version of PyFR the residual is the right hand side vector. In old versions of PyFR it is estimated by taking the difference between two time steps.

Regards, Freddie.

---

<div class="post-metadata">

**Author:** ![wgbb](https://avatars.discourse-cdn.com/v4/letter/w/6f9a4e/32.png) [@wgbb](https://pyfr.discourse.group/u/wgbb)\
**Post date:** [8 March 2024 10:30 UTC](https://pyfr.discourse.group/t/about-residual-convergence/1044/3 "2024-03-08T10:30:14Z")

</div>

Thank you for your patient explanation,

but I don’t quite understand the meaning of number of degrees of freedom. Does it represent DOF? What can I use to estimate this?  
Sorry, the question may be childish.

Good wishes.

---

<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:** [8 March 2024 15:30 UTC](https://pyfr.discourse.group/t/about-residual-convergence/1044/4 "2024-03-08T15:30:31Z")

</div>

DOF = Degree Of Freedom

This is generally considered to be neles_nsoln_nvars.
