Convergence study in Code_Saturne

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
yang
Posts: 15
Joined: Thu Jul 14, 2022 3:39 pm

Convergence study in Code_Saturne

Post 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
Attachments
setup.xml
(7.62 KiB) Downloaded 135 times
PureCSaccuracy.jpg
Yvan Fournier
Posts: 4080
Joined: Mon Feb 20, 2012 3:25 pm

Re: Convergence study in Code_Saturne

Post 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
yang
Posts: 15
Joined: Thu Jul 14, 2022 3:39 pm

Re: Convergence study in Code_Saturne

Post 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
Attachments
Screenshot from 2023-12-19 14-46-52.png
yang
Posts: 15
Joined: Thu Jul 14, 2022 3:39 pm

Re: Convergence study in Code_Saturne

Post by yang »

Hi Yvan,

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

Best,
Yang
Attachments
centredifference.jpg
Yvan Fournier
Posts: 4080
Joined: Mon Feb 20, 2012 3:25 pm

Re: Convergence study in Code_Saturne

Post 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
yang
Posts: 15
Joined: Thu Jul 14, 2022 3:39 pm

Re: Convergence study in Code_Saturne

Post 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
yang
Posts: 15
Joined: Thu Jul 14, 2022 3:39 pm

Re: Convergence study in Code_Saturne

Post 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
Attachments
cs200luma1stconvergence.jpg
Yvan Fournier
Posts: 4080
Joined: Mon Feb 20, 2012 3:25 pm

Re: Convergence study in Code_Saturne

Post 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
yang
Posts: 15
Joined: Thu Jul 14, 2022 3:39 pm

Re: Convergence study in Code_Saturne

Post 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
Attachments
CS_different_velocity_scheme.jpg
Yvan Fournier
Posts: 4080
Joined: Mon Feb 20, 2012 3:25 pm

Re: Convergence study in Code_Saturne

Post 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
Post Reply