浓度方程和边界条件见图片~CODE: #include "udf.h"
DEFINE_UDS_UNSTEADY(MyUnsteady,c,thread,i,apu,su)
{
real physical_dt, vol, phi_old;
physical_dt = RP_Get_Real("physical-time-step");
vol = C_VOLUME(c,thread);
*apu = -vol / physical_dt; /*implicit part*/
phi_old = C_STORAGE_R(c,thread,SV_UDSI_M1(i));
*su = vol*phi_old/physical_dt; /*explicit part*/
}
DEFINE_UDS_FLUX(MyFlux,f,thread,i)
{
real NV_VEC(psi), NV_VEC(A);
F_AREA(A, f, thread);
NV_D(psi, =, F_U(f,thread), F_V(f,thread));
return NV_DOT(psi,A);
}
DEFINE_DIFFUSIVITY(MyDiff,c,thread,i)
{
return 1.6667e-03;
}
DEFINE_PROFILE(density,thread,position)
{
real x[ND_ND];
real y,t,d,d0;
cell_t c;
face_t f;
Thread *t0;
C_UDSI(c,t0,0)=0.0;
C_UDSI_M1(c,t0,0)=0.0;
begin_f_loop(f,thread)
{
c=F_C0(f,thread);
t0=THREAD_T0(f,thread);
C_CENTROID(x,c,t0);
y=2*x[0];
t=RP_Get_Real("physical-time-step");
d=C_UDSI(c,t0,0);
d0=C_UDSI_M1(c,t0,0);
F_PROFILE(f,thread,position)=(d+d0)/t-(d*9.0e-08)/(y-1.0e-07*t);
}
end_f_loop(f,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: ()
[ Last edited by xiegangmai on 2012-3-18 at 07:48 ]