|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
大家好,我要模拟壁面消耗组分的过程,然后定义了一个壁面附近的组分消耗的源项UDF,但是加进去之后,速度很慢,一晚上才迭代了几步,这个是要在壁面的一段上消耗组分,所以里面有个判断位置语句,然后源项消耗量是固定的。希望大家能给错误找出来啦,真不知道改什么了
#include "udf.h"
#define Coating_weight 0.06
#define Coat_Al 0.004
#define Strip_wide 0.5
#define Strip_velocity 2.3
DEFINE_SOURCE(Al_source,c,t,dS,eqn)
{
real source;
real CC[ND_ND];
int zone_ID = 5;
real volume=0.0;
real y;
real area;
Thread *inletstrip;
Thread *t0;
y=0.9-0.2*Strip_velocity*cos(33.5);
area=0.2*Strip_velocity*Strip_wide;
inletstrip = Lookup_Thread(Get_Domain(1),zone_ID);
t0=THREAD_T0(inletstrip);
begin_c_loop(c,t0)
{
C_CENTROID(CC,c,t0);
C_UDMI(c,t0,0)=CC[1];
if (CC[1]>=y&&CC[1]<=0.9)
volume+=C_VOLUME(c,t0);
}
end_c_loop(c,t0)
C_UDMI(c,t0,1)=volume;
if (C_UDMI(c,t0,0)>=y&&C_UDMI(c,t0,0)<=0.9)
{source=-5*Coating_weight*Coat_Al*area/volume;
C_UDMI(c,t0,2)=source;
}
else source=0;
return source;
} |
|