Flow through a surface

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
lorenzo.iron
Posts: 18
Joined: Tue May 11, 2021 1:22 pm

Flow through a surface

Post by lorenzo.iron »

Good morning,

I'd like to select a surface (both boundary or internal) in Paraview and calculate the fluid flow (m3/s) by integrating the speed.

I can do it with "slice" and "integrate variables" functions in Paraview but when simulations and slices are several, it becomes annoying and time consuming, so I'd prefer to set the surfaces in Code_Saturne.

The default boundary surfaces save only the surface variables, so the speed is not included.

How can I include the speed?

Thank you.
Lorenzo
Yvan Fournier
Posts: 4075
Joined: Mon Feb 20, 2012 3:25 pm

Re: Flow through a surface

Post by Yvan Fournier »

Hello,

If you select an internal surface, you can use the cs_user_postprocess_values user-defined function (in cs_user_postprocess.c) to add any value you need. For internal faces, I recommend averaging the cell values of the neighboring cells. See examples in the in-line documentation (https://www.code-saturne.org/cms/sites/ ... var_p.html).

Best regards,

Yvan
Post Reply