竖直管内气液两相环状流,编译的两个UDF总出错,求教啊

浏览:129528
最近在做竖直管内气液两相环状流。编了这样一个adjust的UDF,目的是定义一个UDS。把这个adjust function compile到fluent中,先把case初始化计算两步,然后再加载adjust function,它可以计算运行,可是我再把我编的一个关于UDS方程的扩散率的diffusivity再compile到fluent中之后,就报错了:
Error: received a fatal signal (Segmentation fault).
Error: received a fatal signal (Segmentation fault).
Error Object: #f
下面是我的程序。出错原因在哪里呢?找了很久没有找到,请大家指点一下,非常感谢啊!
#include "udf.h"
/* Define which user-defined scalars to use. */
enum
{
MF=0,
N_REQUIRED_UDS
};
DEFINE_ADJUST(adjust_droplet_mass_fraction, mixture_domain)
{
cell_t c;
Thread **pt;
Thread *cell_threads;
/* Domain *mixture_domain; /* t is mixture_thread according to the definition of the ADJUST Macro */
mixture_domain = Get_Domain(1);
/* Make sure there are enough user defined-scalars. */
if (n_uds < N_REQUIRED_UDS)
Internal_Error("not enough user-defined scalars allocated" 竖直管内气液两相环状流,编译的两个UDF总出错,求教啊的图1 ;
/* Fill UDS with the variable. */
mp_thread_loop_c(cell_threads, mixture_domain, pt)
{
begin_c_loop (c,cell_threads)
{
C_UDSI(c,cell_threads,MF)= C_VOF(c,pt[1])*C_VOLUME(c,cell_threads)*C_R(c,pt[1])/(C_VOF(c,pt[1])*C_VOLUME(c,cell_threads)*C_R(c,pt[1])+C_VOF(c,pt[0])*C_VOLUME(c,cell_threads)*C_R(c,pt[0])); /*DEFINE the mass fraction of the droplet, the scalar*/
}
end_c_loop (c,cell_threads)
}
}
#include "udf.h"
DEFINE_DIFFUSIVITY(my_uds_diffusivity,c,t,i)
{
/*int phase_domain_index=0;*/
Thread **primary_t=THREAD_SUB_THREADS(t); /* primary phase pointer*/
return C_R(c,primary_t[0])*C_MU_EFF(c,primary_t[0])*C_R(c,primary_t[0])*C_K(c,t)*C_K(c,t)/C_D(c,t);
}
邀请回答 我来回答

当前暂无回答

回答可获赠 200金币

没解决?试试专家一对一服务

换一批
    App下载
    技术邻APP
    工程师必备
    • 项目客服
    • 培训客服
    • 平台客服

    TOP