|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
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
不知道是什么原因请高手指教。谢谢!!!!!!!!!!
|
|