場協(xié)同角UDF,熵產(chǎn)UDF
#include "udf.h"
DEFINE_ON_DEMAND(synergy)
{
Domain *domain;
cell_t c;
Thread *t;
real lamdaf=0.6;
real tf=320;
real vel=0.;
real miu=0.001003;
domain=Get_Domain(1);
thread_loop_c(t,domain)
{
begin_c_loop(c,t)
{
? ? vel=sqrt(C_U(c,t)*C_U(c,t)+C_V(c,t)*C_V(c,t)+C_W(c,t)*C_W(c,t));
C_UDMI(c,t,0) = acos((C_U(c,t)*C_T_G(c,t)[0]+C_V(c,t)*C_T_G(c,t)[1]+C_W(c,t)*C_T_G(c,t)[2])/vel/NV_MAG(C_T_G(c,t)));/*acos*/
C_UDMI(c, t, 1) = lamdaf/tf/tf*NV_MAG2(C_T_G(c,t));/*St*/
C_UDMI(c, t, 2) = miu/tf*(2*(C_U_G(c,t)[0]*C_U_G(c,t)[0]+C_V_G(c,t)[1]*C_V_G(c,t)[1]+C_W_G(c,t)[2]*C_W_G(c,t)[2])+(C_U_G(c,t)[1]+C_V_G(c,t)[0])*(C_U_G(c,t)[1]+C_V_G(c,t)[0])+(C_U_G(c,t)[2]+C_W_G(c,t)[0])*(C_U_G(c,t)[2]+C_W_G(c,t)[0])+(C_V_G(c,t)[2]+C_W_G(c,t)[1])*(C_V_G(c,t)[2]+C_W_G(c,t)[1]));/*Sp*/
C_UDMI(c, t, 3) =C_UDMI(c, t, 2) +C_UDMI(c, t, 1) ;
}
end_c_loop(c,t)
}
}