Page 1 of 1

Flow through a surface

Posted: Mon Aug 30, 2021 9:12 am
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

Re: Flow through a surface

Posted: Mon Aug 30, 2021 12:51 pm
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