我是一个普通的硕士生,只有2年,老师让我做fluent模拟,没人指导,真的是难
现在做模拟有一个很大的瓶颈,编写的udf一直运行不了,各位大神有没有能不能抽一点点时间帮我看一下就是很简单的一个吸附udg程序
#include"udf.h"
enum
{xifu,d_xifu};
DEFINE_ADJUST(xifu,domain)
{ Thread *t;
cell_t c;
real n_m;
real E_m;
real x_p;
real A;
real x_b;
real n;
thread_loop_c (t,domain)
{ if (NULL!= THREAD_STORAGE(t,SV_UDS_I(xifu))&&
NULL!=T_STORAGE_R_NV(t,SV_UDSI_M1(xifu)))
{
begin_c_loop (c,t)
{
real tem=C_T(c,t);
n_m=25.4;
E_m=11850+7.05*tem;
x_p=1.85E9/ C_UDSI(c,t,p);
A=8.31429*tem*log(x_p);
x_b=-A*A/E_m/E_m;
C_UDSI(c,t,xifu)=n_m*exp(x_b);
}
end_c_loop (c,t)
}
}
}
DEFINE_ADJUST(d_xifu, domain)
{
Thread *t;
cell_t c;
thread_loop_c (t,domain)
{
if(NULL!=THREAD_STORAGE(t,SV_UDS_I(d_xifu))&&
NULL!=T_STORAGE_R_NV(t,SV_UDSI_M1(d_xifu)))
{ begin_c_loop (c,t)
{
real physical_dt;
physical_dt=RP_Get_Real("physical-time-step" C_UDSI(c,t,d_xifu)=-10.56*(C_UDSI(c,t,xifu)-C_UDSI_M1(c,t,xifu))/physical_dt;
}
end_c_loop (c,t)
}
}
}
DEFINE_SOURCE(mass_source,c,t,dS,eqn)
{
real m_source;
m_source=C_UDSI_M1(c,t,d_xifu);
dS[eqn] = 0;
return m_source;
}
DEFINE_SOURCE(energy_source,c,t,d S,eqn)
{
real e_source;
e_source=-C_UDSI_M1(c,t,d_xifu)*84143E3;
dS[eqn] = 0;
return e_source;
}
然后老是说line5 xifu:function type incompatible with previous definition(function returning void instead of int)
求求大家了
帮帮忙@wuming524 |