求教一段和梯度相关的UDF代码的含义,先谢过了~
代码内容如下:
DEFINE_ADJUST(adjust_for_force, domain)
{
Thread **pt;
Thread *t;
cell_t c0;
Domain *pDomain = DOMAIN_SUB_DOMAIN(domain,1);
/* if turbulence begin */
Alloc_Storage_Vars(pDomain,SV_VOF_RG,SV_VOF_G,SV_NULL);
Scalar_Reconstruction(pDomain, SV_VOF,-1,SV_VOF_RG,NULL);
Scalar_Derivatives(pDomain,SV_VOF,-1,SV_VOF_G,SV_VOF_RG,Vof_Deriv_Accumulate);
mp_thread_loop_c (t,domain,pt)
if (FLUID_THREAD_P(t))
{
Thread *tp = pt[1];
begin_c_loop (c0,t)
{
C_UDMI(c0,t,0) =
Ctd*C_R(c0,pt[0])*C_K(c0,t)*C_VOF_G(c0,tp)[0] ;
C_UDMI(c0,t,1) =
Ctd*C_R(c0,pt[0])*C_K(c0,t)*C_VOF_G(c0,tp)[1] ;
#if RP_3D
C_UDMI(c0,t,2) = Ctd*C_R(c0,pt[0])*C_K(c0,t)*C_VOF_G(c0,tp)[2] ;
#endif
}
end_c_loop (c0,t)
}
Free_Storage_Vars(pDomain,SV_VOF_RG,SV_VOF_G,SV_NULL);
}
代码的大致含义我明白了,但是
Alloc_Storage_Vars(pDomain,SV_VOF_RG,SV_VOF_G,SV_NULL);
Scalar_Reconstruction(pDomain, SV_VOF,-1,SV_VOF_RG,NULL);
Scalar_Derivatives(pDomain,SV_VOF,-1,SV_VOF_G,SV_VOF_RG,Vof_Deriv_Accumulate);
这一段代码,在UDF手册和网络上都没有找到相关的介绍,所以特地再次求教一下,还请各位赐教
@刘腾炼 @胡坤 @仿真小刘
请问楼主问题解决了吗