坐標(biāo)原點(diǎn)為體熱源中心,加載高斯旋轉(zhuǎn)體熱源;程序如下,但是熱源加載不上,求指點(diǎn)
#include "udf.h"
DEFINE_SOURCE(heat_flux,cell,thread,ds,eqn)
{
real x[ND_ND];
real oq,t0,v0,Q,time,cs,hh;
real r,rh;
real source_heat;
cell_t c;
C_CENTROID(x,c,thread);
Q=100000; /*槍功率*/
cs=3/pow(oq,2); /*形狀因子*/
hh=150e-3; /*熱源高度*/
oq=60e-3; /*熱源半徑*/
r=sqrt(pow(x[0]-0.35,2)+pow(x[1]+0.35,2)); /*坐標(biāo)與熱源中心的距離*/
rh=sqrt(log(hh/x[2])/3.)*oq; /*一定熱源高度對應(yīng)的半徑rh*/
if (x[2]==0)
{
source_heat=3.*cs*Q/(3.14*hh*(1.-1./exp(3)));
ds[eqn] =0;
}
else if (x[2]>0&&x[2]<=hh&&r<=rh)
{
source_heat=3.*cs*Q/(3.14*hh*(1.-1./exp(3)))*exp(-3.*cs/log10(hh/x[2])*pow(r,2.));
ds[eqn] =0;
}
else
{
source_heat= ds[eqn] =0;
}
return source_heat;
}
參考信息:http://www.gaoyang168.com/bbs/viewthread.php?tid=4198673 |