Post reply

Note: this post will not display until it's been approved by a moderator.

Name:
Email:
Subject:
Message icon:

Verification:
Type the letters shown in the picture
Listen to the letters / Request another image

Type the letters shown in the picture:

shortcuts: hit alt+s to submit/post or alt+p to preview


Topic Summary

Posted by: infocfd
« on: September 24, 2020, 05:24:53 PM »

Thanks!
Posted by: william
« on: September 24, 2020, 05:14:20 PM »

Hi,

The Global Maximum Value of a certain variable can be obtained through the User Defined Functions in Fluent using Global Maximum Macro PRF_GRHIGH1(x). This can be used to obtain the Global Minimum as well.

Here is the implementation that outputs the global maximum temperature in the domain:

Code: [Select]
#include "udf.h"
DEFINE_ON_DEMAND(MaxTemp)
{
Domain *d;
d = Get_Domain(1); /* Get the domain using Fluent utility */
Thread *t;
cell_t c;
real T_maxx = 0;
real T_max = 0;
#if RP_NODE
{
thread_loop_c(t,d)
{
if (FLUID_THREAD_P(t))
{
begin_c_loop(c,t)
{
T_maxx = MAX(C_T(c,t), T_maxx);
}
end_c_loop(c,t)
}
}
}
#endif
 T_max = PRF_GRHIGH1(T_maxx);
Message("\n T_maxx %0.14f", T_maxx);
Message("\n T_max %0.14f", T_max);
}
Posted by: infocfd
« on: September 24, 2020, 05:06:04 PM »

Is there any way of accessing the value of a global maximum value in the domain using a UDF in fluent?

Thank you in advance.