max and min temperature in LES simulation

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
xiaoxue123
Posts: 26
Joined: Fri Mar 02, 2018 11:50 am

max and min temperature in LES simulation

Post 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
Yvan Fournier
Posts: 3814
Joined: Mon Feb 20, 2012 3:25 pm

Re: max and min temperature in LES simulation

Post 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
xiaoxue123
Posts: 26
Joined: Fri Mar 02, 2018 11:50 am

Re: max and min temperature in LES simulation

Post 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
Attachments
T_minmax.dat
(42 Bytes) Downloaded 14 times
cs_user_extra_operations.c
(5.53 KiB) Downloaded 15 times
Yvan Fournier
Posts: 3814
Joined: Mon Feb 20, 2012 3:25 pm

Re: max and min temperature in LES simulation

Post 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
xiaoxue123
Posts: 26
Joined: Fri Mar 02, 2018 11:50 am

Re: max and min temperature in LES simulation

Post by xiaoxue123 »

Hi Yvan,

Thanks a lot, I understand it now.

Xiaoxue
Post Reply