找回密码
 注册
查看: 967|回复: 1

[求助]那位大侠帮俺看看我的udf为何不能用,我是在例子的基础上改的,急,不胜感激

[复制链接]
发表于 2004-8-18 09:17:56 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

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);
}
 楼主| 发表于 2004-8-18 09:21:22 | 显示全部楼层

[求助]那位大侠帮俺看看我的udf为何不能用,我是在例子的基础上改的,急,不胜感激

说明:我想计算速度与温度梯度的的点积值,那位帮忙非常感激,我闷了一个月了
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表