找回密码
 注册
查看: 1685|回复: 2

关于udf的问题

[复制链接]
发表于 2005-7-15 21:00:01 | 显示全部楼层 |阅读模式

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

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

x
我做了一个关于多相流中关于第二相体积设定的UDF。程序如下:
#include "udf.h"
/* domain pointer that is passed by INIT function is mixture domain  */
DEFINE_INIT(my_init_function, mixture_domain)
{
  int phase_domain_index;
  cell_t cell;
  Thread *cell_thread;
  Domain *subdomain;
  real xc[ND_ND];
  /* loop over all subdomains (phases) in the superdomain (mixture) */
  sub_domain_loop(subdomain, mixture_domain, phase_domain_index)
  {
     /* loop if secondary phase  */
     if (DOMAIN_ID(subdomain) == 2)
     /* loop over all cell threads in the secondary phase domain  */
     thread_loop_c (cell_thread,subdomain)
     {
         /* loop over all cells in secondary phase cell threads  */
         begin_c_loop_all (cell,cell_thread)
         {
             C_CENTROID(xc,cell,cell_thread);
             if (xc[0]>-40&xc[0]<40&xc[1]>-20&xc[1]<20&SN_SUM(pow(xc[0]-0,2.),pow(xc[1]-60,2.),pow(xc[2]-0,2.))>20&SN_SUM(pow(xc[0]-0,2.),pow(xc[1]+60,2.),pow(xc[2]-0,2.))>20)      
               /*  set volume fraction to 1 for centroid  */
               C_VOF(cell,cell_thread) = 1.;               
             else
               /*  otherwise initialize to zero  */
               C_VOF(cell,cell_thread) = 0.;     
         }
         end_c_loop_all (cell,cell_thread)
     }   }}
但是在interpreted UDFs 面板中导入时,fluent提示错误为: line 1:parse error
不知道是什么原因请高手指教。谢谢!!!!!!!!!!
 楼主| 发表于 2005-7-17 10:02:24 | 显示全部楼层

关于udf的问题

自己顶
发表于 2006-2-23 12:30:03 | 显示全部楼层

关于udf的问题

下面引用由cuihuixi2005/07/17 10:02am 发表的内容:
自己顶
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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