24小时热门版块排行榜    

查看: 1073  |  回复: 6
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

凯仂

铜虫 (小有名气)


[交流] flunet UDF 求助

DEFINE_ADJUST(update_mc,d)
{
int curr_ts, last_ts = -1;
cell_t c;
Thread *t;
curr_ts = N_TIME;
if (last_ts != curr_ts)
{
last_ts = curr_ts;
printf ("ADJUST: iteration = %d , = = = = \n", curr_ts);
physical_dt = RP_Get_Real("physical-time-step";
求UDF高手解释下这段程序什么意思,fluent有N_TIME这个命令吗?
回复此楼

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

» 抢金币啦!回帖就可以得到:

查看全部散金贴

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

znon

金虫 (小有名气)


★ ★ ★
凯仂(金币+1): 谢谢参与
xiegangmai: 金币+2, 谢谢参与! 2013-05-28 23:58:03
这就是Fluent帮助中的一个例子。

/**********************************************************************
            Example UDF that uses N_TIME                           
***********************************************************************/
static int last_ts = -1;   /*  Global variable.  Time step is never <0 */

DEFINE_ADJUST(first_iter_only, domain)
{
  int curr_ts;
  curr_ts = N_TIME;
  if (last_ts != curr_ts)
  {
    last_ts = curr_ts;

    /* things to be done only on first iteration of each time step
       can be put here  */
  }
}


N_TIME        integer number of time steps  RP_Get_Integer("time-step" 迭代步数
The integer time step count (accessed using N_TIME) is useful in DEFINE_ADJUST functions for detecting whether the current iteration is the first in the time step.
3楼2013-05-27 16:00:35
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 7 个回答

lsyzlq

银虫 (正式写手)


★ ★
凯仂(金币+1): 谢谢参与
xiegangmai: 金币+1, 谢谢参与! 2013-05-28 23:58:11
这段程序输出的就是迭代步数和时间步长
4楼2013-05-27 20:24:50
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
普通表情 高级回复 (可上传附件)
信息提示
请填处理意见