Page 1 of 1
max and min temperature in LES simulation
Posted: Sat Sep 24, 2022 3:22 pm
by xiaoxue123
Dear experts,
I am running an LES simulation using version 6.0.8. I want to store the minimum and the maximum temperatures at each location.
Are there any suggestions to do that? Can I set up new variables such as minT and maxT in cs_user_parameters.c, then store minT and maxT for each location?
Best regards,
Xiaoxue
Re: max and min temperature in LES simulation
Posted: Sun Sep 25, 2022 10:04 pm
by Yvan Fournier
Hello,
minT and maxY would not be "standard" user variables, as they are defined globally and not on a single cell.
Max and min values are already computed for logging, using functions from cs_array_reduce.c (or cs_array_reduce.h), but if you want to store them, you need to call the same functions from the cs_user_extra_operations function and save them to a a file. Check fo the following:
https://www.code-saturne.org/documentat ... ce_8h.html,
https://www.code-saturne.org/documentat ... cd94f489b7.
Best regards,
Yvan
Re: max and min temperature in LES simulation
Posted: Sun Oct 02, 2022 5:10 pm
by xiaoxue123
Dear Yvan,
Thanks for the information.
I am trying to use cs_array_reduce_minmax_l, I am calling it in cs_user_extra_operations as attached.
The output seems to be at just one cell.
I actually want to print the min and max T over the time period for each cell, can you spot any issue with the attached subroutine?
Best regards,
Xiaoxue
Re: max and min temperature in LES simulation
Posted: Wed Oct 05, 2022 9:31 pm
by Yvan Fournier
Hello,
cs_array_reduce* reduced data spatially, not in time.
So in your case, your best option is to create 2 additional property fields (one for min, one for max), and in cs_user_extra_operations, update the min and max value at each position by comparing them with the current temperature.
Best regards,
Yvan
Re: max and min temperature in LES simulation
Posted: Thu Oct 06, 2022 1:13 am
by xiaoxue123
Hi Yvan,
Thanks a lot, I understand it now.
Xiaoxue