24小时热门版块排行榜    

查看: 316  |  回复: 0

妃子笑16888

新虫 (初入文坛)

[交流] UDF

想用UDF做一个在x加速度随时间变化的函数,然后连接到source term下面的x轴上,按照下面编译没有错误,但效果没有出来,请问就是下面的程序哪里有问题吗,请大神指导一下
/******************************************************************
The acceleration in the x-axis direction changes with time
*******************************************************************/
#include "udf.h"
#define g 9.8
DEFINE_SOURCE(accelaration_source, c, t, dS, eqn)
{
  real x[ND_ND];
  real source;
  real current_time;
  current_time = RP_Get_Real("flow-time";
  source = -0.125*current_time*g+0.5*g;
  dS[eqn] = 0.0;
  return source;
}
回复此楼

» 猜你喜欢

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 妃子笑16888 的主题更新
普通表情 高级回复 (可上传附件)
信息提示
请填处理意见