|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
最近在做一个简单流场,因为是气固吸附。所以我就想着在流场上添加一个质量源项,表征吸附解吸。
质量源项特别简单。但是每次编译,初始化都通过。一计算就提示
FLUENT received fatal signal (ACCESS_VIOLATION)
1. Note exact events leading to error.
2. Save case/data under new name.
3. Exit program and restart to continue.
4. Report error to your distributor.
到底是什么原因啊。着急死我了,请提点意见呢。搞定了就发文章毕业了。啊啊。程序如下:
#include"udf.h"
#define P_OPR 101325 /*定义操作压力*/
#define P_LAN 2501325 /*定义朗格缪尔压力*/
#define M_CH 16 /*定义甲烷分子量*/
#define ROU_S 1450 /*定义煤炭密度*/
#define N_LAN 17.851 /*定义朗格缪尔最大吸附量*/
DEFINE_SOURCE(m_source,cell,thread,dS,eqn)
{
real source,num,p_sum,p_sum_1,p_d1,p_d2,t_step;
num=M_CH*ROU_S;
p_sum=C_P(cell,thread);
p_sum_1=C_P_M1(cell,thread);
t_step=RP_Get_Real("physical-time-step");
p_d1=(P_OPR+p_sum)/(P_LAN+P_OPR+p_sum);
p_d2=(P_OPR+p_sum_1)/(P_LAN+P_OPR+p_sum_1);
source=-0.85*num*(p_d1-p_d2)/t_step;
dS[eqn]=0.0;
return source;
}
DEFINE_SOURCE(xmom_source,cell,thread, dS,eqn)
{
const real c2=100.0;
real x[ND_ND];
real con, source;
C_CENTROID(x, cell, thread);
con = c2*0.5*C_R(cell, thread)*x[1];
source = - con*fabs(C_U(cell, thread))*C_U(cell, thread);
dS[eqn] = - 2.*con*fabs(C_U(cell, thread));
return source;
}
DEFINE_PROFILE(inlet_x_velocity, thread, position)
{
real x[ND_ND];
real y;
face_t f;
begin_f_loop(f, thread)
{
F_CENTROID(x,f,thread);
y=x[1];
F_PROFILE(f,thread,position)=1.0-y*y/(0.24*0.24);
}
end_f_loop(f, thread)
} |
|