Missing "stress_normal" field present in setup.xml

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
fracenvi
Posts: 36
Joined: Wed Jun 19, 2024 9:58 am

Missing "stress_normal" field present in setup.xml

Post by fracenvi »

Hello,

I'm trying to run a calculation in which i try to couple ANN resolution for certain fields with the standard numerical resolution and i need to collect certain data every n time steps. One of them is the measure of the normal stress (that i can easily collect during the postprocess phase) which i haven't figure out how to retrieve. I tried calling the field using

Code: Select all

call field_get_val_s_by_name("stress_normal", bpro_normstress)
(in a f90 user subroutine) as "stress_normal" is what i have in the setup file specifically.

How can i manage to sort this problem?

Thanks to everyone,
Francesco
Attachments
setup.xml
(11.88 KiB) Downloaded 673 times
cs_user_physical_properties.f90
(27.69 KiB) Downloaded 658 times
Yvan Fournier
Posts: 4206
Joined: Mon Feb 20, 2012 3:25 pm

Re: Missing "stress_normal" field present in setup.xml

Post by Yvan Fournier »

Hello,

stress_normal is not actually stored as a field, but evaluated locally using a cs_function_t mechanism.
The field which is stored is named "boundary_stress" or something similar. Be careful, it is currently extensive and not intensive, so you need to divide values by the surface.

Best regards,

Yvan
fracenvi
Posts: 36
Joined: Wed Jun 19, 2024 9:58 am

Re: Missing "stress_normal" field present in setup.xml

Post by fracenvi »

Hello,

How can i access it then? Beacuse in post-processing i can see both "Normal_stress" and "Stress" as boundary fields and i think the boundary_stress field you are mentioning only refers to "Stress".

Eventually, if i have to evaluate it sohuld i refer to the user example cs_user_extra_operations-nusselt_and_friction_calculation.c?

Thanks as always,
Francesco
Yvan Fournier
Posts: 4206
Joined: Mon Feb 20, 2012 3:25 pm

Re: Missing "stress_normal" field present in setup.xml

Post by Yvan Fournier »

Hello,

You should rather check the cs_post_stress_tangential function in src/base/cs_post_util.cpp, and use that as an example, keeping the normal rather than tangential component in your case.

Regards,

Yvan
Post Reply