|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
实在是解决不了了,现来求助各位大大,望拔刀相助
写的一个UDF,用于再非定常计算中在特定的区域周期增加体积力源项
读入都无问题,但是只要在面板GENERAL中勾选TRANSIENT就会出现
Error:
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.
Error Object: #f
如使用steady的话就没问题,但是我这就是用于非定常计算的啊,请各位看看到底问题出在哪里呢?
#include "udf.h"
DEFINE_SOURCE(cell_x_source, c, t, dS, eqn)
{
real x[ND_ND];
real a,b;
real source;
int current_step;
current_step=N_TIME;
C_CENTROID(x,c,t);
a = x[0];
b = x[1];
if (a<=0.003&&a>=0.0&&b<=0.0015&&b>=0.0)
{
if(current_step%4==1||current_step%4==2)
{
source = 0.8944*(1.4556*1e5-4.852*1e7*a-9.704*1e7*b);
dS[eqn] = 0.8944*(-4.852*1e7);
}
else
source = dS[eqn] = 0.;
}
else
source = dS[eqn] = 0.;
return source;
}
DEFINE_SOURCE(cell_y_source, c, t, dS, eqn)
{
real x[ND_ND];
real a,b;
real source;
int current_step;
current_step=N_TIME;
C_CENTROID(x,c,t);
a = x[0];
b = x[1];
if (a<=0.003&&a>=0.0&&b<=0.0015&&b>=0.0)
{
if(current_step%4==1||current_step%4==2)
{
source = 0.447*(1.4556*1e5-4.852*1e7*a-9.704*1e7*b);
dS[eqn] = 0.447*(-4.852*1e7);
}
else
source = dS[eqn] = 0.;
}
else
source = dS[eqn] = 0.;
return source;
}
感激不尽啊 各位大大 版主大人 望指教 |
|