关于P_USER_REAL(p,0)
我写了个程序用到P_USER_REAL(p,0),当连接的时候提示是:P_USER_REAL: undeclared variable。此宏应该是FLUENT自带的宏,有没有人给指点一下,谢谢!#include "udf.h"
#include "models.h"
#include "dpm.h"
#include "surf.h"
#include "threads.h"
#include "math.h"
#include "mem.h"
DEFINE_DPM_SCALAR_UPDATE(particle_depostion,c,t,initialize,p)
{
int i = 0;
face_tf;
Thread *th;
real A;
real area=0,vol=0;
int wall_ID=4;
if (initialize)
P_USER_REAL(p, 0) = 0;
c_face_loop(c,t,i)
{
if(THREAD_ID(C_FACE_THREAD(c,t,i)) == wall_ID)
{
f=C_FACE(c,t,i);
th=C_FACE_THREAD(c,t,i);
F_AREA(A,f, th);
area = NV_MAG(A);
vol=C_VOLUME(c,t);
if(P_DIAM(p)<0.01)
{
C_UDMI(c, t, 0) +=P_DIAM(p);
P_USER_REAL(p,0) = 1.; /* "Evaporate" */
}
}
}
}
DEFINE_DPM_LAW(stop_dpm_law,p,if_cpld)
{
if (0. < P_USER_REAL(p,0))
P_MASS(p) = 0.; /* "Evaporate" */
}
DEFINE_INIT(my_init_func,d)
{
cell_t c;
Thread *t;
thread_loop_c(t,d)
{
begin_c_loop_all(c,t)
{
C_UDMI(c,t,0)=0;
}
end_c_loop_all(c,t)
}
}
页:
[1]