求助:水面变化的udf
随着水流的流入,水位上升,(例如河道内)这个速度进口的速度应该如何设置呢?
用udf如何实现呢?
下面是我写的:
#include "udf.h"
DEFINE_PROFILE(inlet_velocity,thread,position)
{
real x; /* 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);
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;
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 编辑 ]
页:
[1]