Page 1 of 1

Measuring forces

Posted: Mon Mar 24, 2025 6:14 pm
by bat
Hello,

I'm trying to calculate a drag force on a plate in a 2D mesh. I copied the code from viewtopic.php?p=17551&hilit=drag+force#p17551. For the output file to be filled, I need to add a User Specified Field. I did it manually (on Gui), but do not understand how they work. I do not know what location I should put (boundary gives me only zeros...).

The problem is that when I change the speed from the inlet, the forces do not change, nor vary after the second time step (see boundary_force_table.csv).

Does anyone have some hints to give ?
Thanks !

Bat

Code version : code_saturne 8.3
(I can't manage to insert more files, but I can send them if needed)

Re: Measuring forces

Posted: Tue Mar 25, 2025 3:38 pm
by bat
In the end, I found why the solution was not being plotted, but there are multiple possible causes :
- in the C file, the field is "boundary_stress", not "boundary_force"
- I had deactivated the postprocessing of the stress in GUI (see screenshot) in the solution control...

With these two changes, it works !

Re: Measuring forces

Posted: Tue Mar 25, 2025 3:58 pm
by Yvan Fournier
Hello,

Did you try visualizing the boundary stresses ? to check for the sensitivity when you increase the velocity ?

This may help you determine if/where there is a bug (i.e. bug in you code, bug in upstream code_saturne, or no obvious bug but forces in given zone not too sensitive to velocity) ?

Best regards,

Yvan

Re: Measuring forces

Posted: Wed Mar 26, 2025 10:12 am
by jcharris
I confirm that if this is not checked in the GUI (which the hover text makes reference to ipstdv which hasn't existed since v7, it seems), then this hides the boundary stress not just from the output files, but also cs_user_extra_operations (unclear if that is desired behavior or not).

By chance, are there plans on integrating force calculation into the GUI in the future? It seems like a relatively common thing.

Re: Measuring forces

Posted: Wed Mar 26, 2025 7:23 pm
by Yvan Fournier
Hello,

I think a colleague had plans for "summation by zone" of selected variables, which would fit here, so yes, there are plans for this in the GUI, though I have no idea on where this sits on the priority list.

Best regards,

Yvan