|
|
发表于 2010-11-29 17:28:09
|
显示全部楼层
回复 1# slz361 的帖子
二、传热
#include "udf.h" /*包括常规宏*/
#include "sg_mphase.h" /*包括体积分数宏*/
#define T_SAT 373 /*定义饱和温度*/
#define LAT_HT 1.e3 /*定义水蒸汽潜热*/
DEFINE_SOURCE(liq_src, cell, pri_th, dS, eqn) /*定义液相源项*/
{
Thread *mix_th, *sec_th; /*混合相、第二相 定义计算区域指针*/
real m_dot_l; /*蒸发冷凝速率 定义液相质量转移*/
mix_th = THREAD_SUPER_THREAD(pri_th); /*指向混合区的主相即液相的指针*/
sec_th = THREAD_SUB_THREAD(mix_th, 1); /* 指向单相控制区的气相的指针*/
if(C_T(cell, mix_th)>=T_SAT){
m_dot_l = -0.1*C_VOF(cell, pri_th)*C_R(cell, pri_th)*
fabs(C_T(cell, pri_th) - T_SAT)/T_SAT; /*如果液相单元的温度高于蒸发温度,液相向气相的质量转移*/
dS[eqn] = -0.1*C_R(cell, pri_th)*
fabs(C_T(cell, pri_th) - T_SAT)/T_SAT; /*定义源项对质量转移偏导*/
}
else {
m_dot_l = 0.1*C_VOF(cell, sec_th)*C_R(cell, sec_th)*
fabs(T_SAT-C_T(cell,mix_th))/T_SAT; |
|