声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1472|回复: 0

[UDF专题] 求助:水面变化的udf

[复制链接]
发表于 2009-5-30 17:59 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
随着水流的流入,水位上升,(例如河道内)
这个速度进口的速度应该如何设置呢?
用udf如何实现呢?
下面是我写的:

#include "udf.h"

DEFINE_PROFILE(inlet_velocity,thread,position)

{
             real x[ND_ND];                                             /* this will hold the position vector */
             real y,m;
             cell_t c;

       //water (primary 0),sand (secondary phases 1)
             Thread *mixture_thread;

             Thread **pt;
             pt =THREAD_SUB_THREADS(mixture_thread);

             m=C_VOF(c,pt[1]);

             begin_c_loop(c,thread)                               /* loops over all faces in the thread passed
                              in the DEFINE macro argument  */
                      {
                             C_CENTROID(x,c,thread);
                              y = x[1];

                                if(m=0)
                                 C_PROFILE(c,thread,position) = 0.5;                       
                                else
                                  C_PROFILE(c,thread,position) = 0.0;

                         }
                     end_c_loop(c,thread)
}


开始迭代后就出现问题:

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: ()

不知道问题出在哪儿?
谁能帮忙解决一下?

[ 本帖最后由 合叶126 于 2009-5-30 21:18 编辑 ]
回复
分享到:

使用道具 举报

您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-5-3 02:24 , Processed in 0.107749 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表