Page 1 of 1

Convergence study in Code_Saturne

Posted: Tue Dec 19, 2023 12:52 pm
by yang
Hi team,

I did a convergence study using Code_Saturne v7.0.2. I tested a pseudo-3D Poiseuille flow with inlet boundary (u=4.0*(y-y*y)) and outlet boundary. Also, the domain is (1m * 1m) and uniform mesh with 16, 50, 100 resolutions. In order to ensure accuracy, I set SOLU velocity scheme. However, my results shows about 1st accuracy. Do you think this is reasonable for this case? Here I attached convergence results and setup file.
[img][PureCSaccuracy.jpg]

Best wishes,
Yang

Re: Convergence study in Code_Saturne

Posted: Tue Dec 19, 2023 1:20 pm
by Yvan Fournier
Hello,

In most of our verification cases, we obtain 2nd order convergence, so your results are a bit surprising.

Did you test using the default centered scheme ? SOLU is somewhat more robust, not more precise.

Also, what type of mesh are you using ?

Regards,

Yvan

Re: Convergence study in Code_Saturne

Posted: Tue Dec 19, 2023 4:35 pm
by yang
Thanks Yvan,

(1) Did you test using the default centered scheme?
I think Code_Saturne default is velocity upwind scheme, and it results is first-order accuracy. Let me test centered scheme then.

(2)what type of mesh are you using ?
I generate mesh using Code_Saturne GUI, as shown below.

Best,
Yang

Re: Convergence study in Code_Saturne

Posted: Tue Dec 19, 2023 7:10 pm
by yang
Hi Yvan,

I tested this case using centered velocity scheme, but it shows similar results.

Best,
Yang

Re: Convergence study in Code_Saturne

Posted: Wed Dec 20, 2023 1:14 am
by Yvan Fournier
Hello,

Other important question, how do you measure the error ? Which type of data do you extract ? Do you interpolate it in any way ?

Regards,

Yvan

Re: Convergence study in Code_Saturne

Posted: Wed Dec 20, 2023 11:57 am
by yang
Hi Yvan,

I used paraview to extract data (velocity distribution) and tested interpolation and no interpolation. The error calculation is through L2-norm:



Best,
Yang

Re: Convergence study in Code_Saturne

Posted: Wed Dec 20, 2023 5:44 pm
by yang
Hello Yvan,

Thanks for your advice in post-processing. I know the reasons and list here in case someone has similar questions:
(1) I should extract velocity component instead of resultant velocity.
(2)I extract data from the cell centre and avoid any interpolation scheme.
(3)I use velocity centered scheme in Code_Saturne.
Below shows the good results:

Thanks!
Best,
Yang

Re: Convergence study in Code_Saturne

Posted: Wed Dec 20, 2023 11:00 pm
by Yvan Fournier
Hello,

That is reassuring.

Now that your postprocessing does not interfere with the convergence order measurement any more, I gues you should also get something close to 2nd order with SOLU, though I do not expect it to be more precise than the centered option (though it may be more robust on distorted meshes, which can be useful in industrial studies).

Best regards,

Yvan

Re: Convergence study in Code_Saturne

Posted: Sun Dec 31, 2023 6:24 pm
by yang
Hi Yvan,

I have tested Code_Saturne three velocity scheme -- automatic, SOLU and second-order scheme.
As you predicted, SOLU and second-order scheme show excellent 2nd-order accuracy, but second-order scheme has lower error. The default setup (automatic) only has first-order accuracy, as shown in below figure.

There is an upwind scheme I didn't test (1st-order accuracy?). If I set automatic, Code_Saturne will adopt which scheme?

Correction: In previous conversation, I showed SOLU scheme has slope -2.53. This result is error because wrong boundary treatment in post-processing.

Best wishes,
Yang

Re: Convergence study in Code_Saturne

Posted: Tue Jan 02, 2024 11:53 pm
by Yvan Fournier
Hello Yang,

The default is centered. Or more precisely, centered with slope test. When the slope test kicks in for a given face, it locally switches to pure upwind (for that face and operation), so the convergence order drops to 1. (There is an advanced setting allowing to use blending here, but it is still work in progress).

Best regards,

Yvan