useful udf ! thanks to macfly
Posted October 21, 2014 at 18:33 by diamondx
#include "udf.h"
real T_mean; /* defined outside because will be used in multiple DEFINE macros */
DEFINE_ADJUST(adjust, domain, t)
{
real T_tot;
real u;
real counter = 0;
face_t f;
int ID = 20; /* outlet ID displayed in Fluent boundary conditions panel */
Thread *thread;
thread = Lookup_Thread(domain, ID);
begin_f_loop(f, thread)
{
u = F_U(f, thread); /* x velocity */
if (u >= 0) /* if fluid is going out... */
{
T_tot += F_T(f, thread);
counter = counter + 1;
}
}
end_f_loop(f, thread)
T_mean = T_tot/counter; /* arithmetic mean T of outflow */
}
DEFINE_PROFILE(T_backflow, thread, position)
{
face_t f;
begin_f_loop(f, thread)
{
F_PROFILE(f, thread, position) = T_mean;
}
end_f_loop(f, thread)
}
real T_mean; /* defined outside because will be used in multiple DEFINE macros */
DEFINE_ADJUST(adjust, domain, t)
{
real T_tot;
real u;
real counter = 0;
face_t f;
int ID = 20; /* outlet ID displayed in Fluent boundary conditions panel */
Thread *thread;
thread = Lookup_Thread(domain, ID);
begin_f_loop(f, thread)
{
u = F_U(f, thread); /* x velocity */
if (u >= 0) /* if fluid is going out... */
{
T_tot += F_T(f, thread);
counter = counter + 1;
}
}
end_f_loop(f, thread)
T_mean = T_tot/counter; /* arithmetic mean T of outflow */
}
DEFINE_PROFILE(T_backflow, thread, position)
{
face_t f;
begin_f_loop(f, thread)
{
F_PROFILE(f, thread, position) = T_mean;
}
end_f_loop(f, thread)
}
Total Comments 1
Comments
-
can you explain what is this
thanks a lotPosted January 25, 2018 at 03:44 by tufygo