|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
我得udf如下:
其中在不加
c_face_loop(cell, mix_th, n)
{
f = C_FACE(cell,mix_th,n);
tf = C_FACE_THREAD(cell,mix_th,n);
if(F_T(f,tf)>t0)
t0=F_T(f,tf);
}
这一段在后面程序中把t0设为常数时计算很好。
但是加上这段后歘现
Error: C:\water\m-tran2.c: line 28: non-integer subscript expression: unsigned char
不解应该改正那里?求高手指点迷津!!!
#include "udf.h"
#include "metric.h"
#include "mem.h"
DEFINE_MASS_TRANSFER(liq_gas_source,cell,mix_th,from_index,from_species_index,to_index,t
o_species_index)
{
real m_lg;
real Na;
real freq;
real xc[ND_ND];
real t0;
face_t f;
Thread *tf;
int n;
real T_SAT = 273.15;
real Db=1e-3;
real area=3.9275e-6;
Thread *liq = THREAD_SUB_THREAD(mix_th, from_index);
Thread *gas = THREAD_SUB_THREAD(mix_th, to_index);
m_lg=0.;
C_CENTROID(xc,cell,mix_th);
if (sqrt(ND_SUM(pow(xc[0]-xc[0],2.),pow(xc[1],2.),pow(xc[2],2.))) >0.0048)
{
t0=273.15;
c_face_loop(cell, mix_th, n)
{
f = C_FACE(cell,mix_th,n);
tf = C_FACE_THREAD(cell,mix_th,n);
if(F_T(f,tf)>t0)
t0=F_T(f,tf);
}
Na=pow(210*(t0-T_SAT),1.805);
freq=113.7;
if(C_T(cell,mix_th) >= 275.15)
{
m_lg=3.412*Na*freq*pow(Db,3)*area/6;
}
else if(C_VOF(cell,gas)>0.0)
{
m_lg=3.412*Na*freq*pow(Db,3)*area/6;
}
}
return (m_lg);
}[USECHGFONTE] |
|