Simple pipe simulation which diverge... after a while

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
LCVPierre
Posts: 3
Joined: Sat Sep 06, 2025 12:47 pm

Simple pipe simulation which diverge... after a while

Post by LCVPierre »

Hello,
I am trying to learn code_saturne usage and I encounter an issue I cannot fix. Basically, I am trying to perform a simulation on a simple 3D pipe with water flow specified at the inlet with a reasonable velocity value to generate a turbulent flow. The idea is just to perform simulation starting from scratch, generate the mesh with salome, run the simulation with code_saturne and post-processing with paraview. I obtain a mesh which is not too bad from Salome (from my pov) see a picture just after :
Image
The transition between the last layer of prisms and the middle cells is a bit high but from my point of view it should not be an issue for a such simple case. I mean, the solver should be able to handle this mesh...
I run the calculation and at the beginning everything is fine and after a while, the residuals starts to become crazy :
Image
It seems that the pressure starts to be crazy and finally the simulation diverge... I have checked the calculation in Paraview and it seems that the issue is linked with the outlet even though the velocity profile is reasonable everywhere before starting to become crazy at the outlet. See just after the outlet when it diverges :
Image
I have tried to keep the settings as default as possible to perform this "basic" simulation. I have tried to change the mesh, increase the length of the pipe, increase the water viscosity by a factor 2 and the same issue still to occurs. The inlet velocity is at 0.3 m/s, k-w SST turbulence model is used and I am using SIMPLEC with a constant time step option and 0.01 sec as reference time step. Of course, I thought about an issue about the outlet boundary condition but there is apparently nothing to specify regarding the oulet in code_saturne GUI...
Image

Do you have any idea about the root cause for this issue ?

Thank you for your help !
Pierre
Yvan Fournier
Posts: 4251
Joined: Mon Feb 20, 2012 3:25 pm

Re: Simple pipe simulation which diverge... after a while

Post by Yvan Fournier »

Hello,

Outlet boundary conditions tend to have a high sensitivity to mesh quality in code_saturne, so whether using tetrahedral meshes or even hexahadral meshes with cell warping at the outlet, the following options usually work well :

- Add one or two prism layers at the outlet using the code's mesh extrusion features (in the GUI, under Mesh/Preprocessing)
- If this is relevant, use an imposed pressure outlet instead of a standard outlet.

If the outlet profile is known, imposing a "reverse inlet" at an outlet (and a free inlet/outlet for an inlet) can also help, when all else fails.

In your case, mesh extrusion at the outlet should do.

We do need to work on outlet boundary conditions to mitigate this issue in a more automatic manner....

Best regards,

Yvan
LCVPierre
Posts: 3
Joined: Sat Sep 06, 2025 12:47 pm

Re: Simple pipe simulation which diverge... after a while

Post by LCVPierre »

Dear Yvan,
Thank you for your reply !
You are right, I have added 3 prisms layers on the outlet and the simulation converged ! Just for my curiosity, how could I impose a pressure outlet instead of a standard outlet ? Indeed, it seems not possible to impose anything on the outlet with the GUI...

Thank you very much

Regards,
Pierre
Chai
Posts: 9
Joined: Mon Jan 04, 2021 5:54 pm

Re: Simple pipe simulation which diverge... after a while

Post by Chai »

Dear Pierre,

If you wish to explicitely set the pressure, you need to choose "Imposed P outlet" as a boundary type in the GUI instead of "Outlet" (the latter computes an automatic value based on the reference pressure and hydraulic head).

With Kind Regards,
LCVPierre
Posts: 3
Joined: Sat Sep 06, 2025 12:47 pm

Re: Simple pipe simulation which diverge... after a while

Post by LCVPierre »

Great ! Thank you Chai !

Regards,
Pierre
Antech
Posts: 204
Joined: Wed Jun 10, 2015 10:02 am

Re: Simple pipe simulation which diverge... after a while

Post by Antech »

Yes, its'strange specific Saturne problem with Outlet BC. To solve this, you need:
1. Outlet extrusion with cell size comparable with main mesh.
2. Straight flow at outlet with no recirculation zones! Add more extrusion or even small local resistance if needed.
In some cases it doesn't work because, due to geometric uncertainity, Saturne creates cells with negative volume on inflated mesh (such in this SST case where we need boundary inflation layers). I think, more flexible automatic solution is needed.

Ivan,
Unfortunately, Free inlet does not help. It starts good where simple outlet divegred but, after some iterations, even worst crazy divergence begins.
Post Reply