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
max and min temperature in LES simulation
Forum rules
Please read the forum usage recommendations before posting.
Please read the forum usage recommendations before posting.
-
- Posts: 29
- Joined: Fri Mar 02, 2018 11:50 am
-
- Posts: 4079
- Joined: Mon Feb 20, 2012 3:25 pm
Re: max and min temperature in LES simulation
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
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
-
- Posts: 29
- Joined: Fri Mar 02, 2018 11:50 am
Re: max and min temperature in LES simulation
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
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 73 times
-
- cs_user_extra_operations.c
- (5.53 KiB) Downloaded 73 times
-
- Posts: 4079
- Joined: Mon Feb 20, 2012 3:25 pm
Re: max and min temperature in LES simulation
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
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
-
- Posts: 29
- Joined: Fri Mar 02, 2018 11:50 am
Re: max and min temperature in LES simulation
Hi Yvan,
Thanks a lot, I understand it now.
Xiaoxue
Thanks a lot, I understand it now.
Xiaoxue