Poisson equation solution using Code_Saturne solver

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
Nicolas
Posts: 2
Joined: Tue Apr 21, 2026 10:03 am

Poisson equation solution using Code_Saturne solver

Post by Nicolas »

Good morning,

I am currently trying to solve a Poisson equation based on a scalar field that I define beforehand within NEPTUNE_CFD.

My approach is to reuse the Poisson solver that is originally used for the pressure field in Code_Saturne. However, I noticed that some boundary condition conversions are required between NEPTUNE and Saturne conventions.

At the moment, the solutions I obtain have the correct polynomial order (e.g. quadratic profiles when expected), but they do not match the exact analytical solution. It seems as if the integration constants are not correctly recovered, which makes me suspect an issue related to boundary conditions or their implementation.

I would like to ask:

Are there specific recommendations when reusing the Poisson solver for a custom scalar field?
Are there known pitfalls regarding boundary condition handling between NEPTUNE_CFD and Code_Saturne?
Could this issue be related to how Dirichlet/Neumann conditions are internally treated?

Any advice or feedback would be greatly appreciated.

Best regards,
Nicolas
Yvan Fournier
Posts: 4297
Joined: Mon Feb 20, 2012 3:25 pm

Re: Poisson equation solution using Code_Saturne solver

Post by Yvan Fournier »

Hello,

Boundary conditions in code_saturne may use coupled components for multi-dimensional fields, which is not the case for neptune_cfd. For scalars, coefficients should be similar.

I am out of office today (without my work computer) so cannot check the neptune_cfd code right away (and the rest of the week will be very busy, so I may forget to update this thread), but compared to the initial code_saturne versions, some years ago, the gradient reconstruction and diffusive a/b coefficients were separated (commit 26ada9739c36), whereas the same terms were updated in older versions, and I am not sure whether neptune_cfd adopted the same logic or still only uses only a/b (and no af/bf coefficients). If neptune_cfd also uses af/bf coefficients in addition to a/b coefficients, there should be no difference for a scalar.

Also, the Poisson solver in code_saturne is not handled in a modular manner, which would be useful for some applications or initializations in code_saturne, so we may try to improve this is the future, though I do not know when (depending on juggling priorities). If the current form, some temporary BC coefficients may also be used, to there might be tricks there also.

Best regards,

Yvan
Nicolas
Posts: 2
Joined: Tue Apr 21, 2026 10:03 am

Re: Poisson equation solution using Code_Saturne solver

Post by Nicolas »

Good morning,

Thank you for your detailed answer, this is very helpful.

Your point about the distinction between a/b and af/bf coefficients is particularly interesting, and I will check how this is handled in Neptune_CFD on my side. This may indeed explain some of the differences I am observing.

The remark regarding the Poisson solver and the potential use of temporary boundary condition coefficients is also very valuable, I had not considered that aspect.

Thanks again for your insights, and no worries regarding the delay.

Best regards,
Nicolas
Post Reply