|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
#include "udf.h"
DEFINE_ON_DEMAND(on_demand_calc)
{
Domain *d;
Thread *t;
/* Integrate dissipation. */
real sum_dot=0.;
real x=0.0;
real y=0.0;
real z=0.0;
cell_t c;
real u=0.0;
real v=0.0;
real w=0.0;
d = Get_Domain(1);
thread_loop_c (t,d)
{
begin_c_loop (c,t)
x=C_T_G(c,t)[0];
y=C_T_G(c,t)[1];
z=C_T_G(c,t)[2];
ND_SET(u, v, w, C_U(c, t), C_V(c, t), C_W(c, t));
sum_dot += ND_DOT(x, y, z, u, v, w)*
C_VOLUME(c,t);
end_c_loop (c,t)
/* y=C_CENTROID(x,c,t)*/
}
printf("x %g\n", y);
printf("Volume integral of temperature: %g\n", sum_dot);
} |
|