fluent模擬流化床傳熱傳質(zhì),編程設(shè)定初始的顆粒濕度,并計算求得空氣的相對濕度,但是一導(dǎo)進去一點初始化就出現(xiàn)錯誤,DEFINE_INIT去掉以后可以初始化,求高手幫忙解決這個問題...
#include "udf.h"
/* Heat and moisture transfer in bulks of grains */
/* Graham Thorpe */
/* Victoria University, Melbourne, Australia */
/* Chung-Pfost constants */
#define ACP 921.69
#define BCP 18.077
#define CCP 112.35
#define RHOB 639.2
#define PATM 101325
/* Define ambient temperature conditions */
#define TMEAN 288.15
/* Define a global variable that acts as a comparitor in DEFINE_ADJUST */
int last_ts = -1;
DEFINE_INIT(moisure_init,d)
/* The initial solids moisture content, W, is set */
/* and the corresponding humidity, w, of the intergranular air is calculated */
{
cell_t c;
Thread *t;
real W,Tabs,TC,r,psat,p,w;
/* Loop over all of the cell threads in the bulk of grain */
thread_loop_c(t,d)
{
begin_c_loop(c,t)
{
C_UDMI(c,t,0) = 0.1364;
W = C_UDMI(c,t,0);
Tabs = C_T(c,t);
TC = Tabs-273.15;
/* Calculate relative humidity of intergranular air */
r = exp(-ACP/(TC+CCP)*exp(-BCP*W));
/* Ensure the air does not become supersaturated */
if (r>0.99)
{r = 0.99;}
psat = 6.0e25/pow(Tabs,5) *exp(-6800/Tabs);
p = r*psat;
w = 0.622*p/(PATM-p); /* Eqn 12 */
C_UDSI(c,t,0) = w;
}
end_c_loop(c,t);
}
}
![FLUENT DUF DEFINE_INIT 導(dǎo)入不能初始化]()
_ISCN{O85`GZ`[81Y69R~}M.jpg |