DEFINE_ON_DEMAND(tmax)
{
Domain *d; /* declare domain pointer since it is not passed as an
argument to the DEFINE macro */
/*声明域指针,*/
real tmax = 0.;/*最大温度*/
real temp;
Thread *t;
cell_t c;
d = Get_Domain(6); /* Get the domain using ANSYS Fluent utility 获取Domain的ID */
/* Loop over all cell threads in the domain 在所有的单元上做循环*/
thread_loop_c(t, d)
{
/* Compute max, min, volume-averaged temperature */
/* Loop over all cells */
begin_c_loop(c, t)
{
temp = C_T(c, t); /* get cell temperature */
if (temp > tmax || tmax == 0.) tmax = temp;/* 判断语句,当temp>tamx或者tmax=0时,进行tmax=temp */
}
end_c_loop(c, t)
C_UDMI(c, t, 0) = tmax;
}
}
DEFINE_PROFILE(vel_profile, t, i)
{
real x[ND_ND]; /* this will hold the position vector */
real vel;
cell_t c;
face_t f;
vel = 0.0;
begin_c_loop(f, t)
{
C_CENTROID(x, c, t);
vel = C_UDMI(c, t, 0) / 100;
C_UDMI(c, t, 1) = vel;
F_PROFILE(c, t, i) = C_UDMI(c, t, 1);
}
end_f_loop(c, t)
}