做热管仿真,想记录热管启动过程中蒸发冷凝传输质量,使用的mass_transfer宏定义的相变过程,在其中用UDM2 和UDM3 记录了蒸发量和冷凝量,然后在另外一个宏中报告出来,同时在fluent中,用内置的报告也报告了UDM2 和UDM3的值,发现程序报告是没有蒸发质量,只有冷凝质量,而fluent自己算的是有蒸发质量,没有冷凝质量,不知道是哪里的问题,希望能帮忙看下,代码如下
#include "udf.h"
DEFINE_MASS_TRANSFER(liq_gas_source, cell, thread, from_index, from_species_index, to_index, to_species_index)
{
real m_lg = 0.0;
real T_SAT = 373;
real p = 0.0;
Thread *gas, *liq;
gas = THREAD_SUB_THREAD(thread, from_index);
liq = THREAD_SUB_THREAD(thread, to_index);
if (C_T(cell, liq) > T_SAT)
{
m_lg = -0.1*C_VOF(cell,liq)*C_R(cell,liq)*(C_T(cell, liq) - T_SAT) / T_SAT;
C_UDMI(cell, thread, 2) = m_lg;
}
else if (C_T(cell, gas) < T_SAT)
{
m_lg = 0.1*C_VOF(cell,gas)*C_R(cell,gas)*(T_SAT - C_T(cell, gas)) / T_SAT;
C_UDMI(cell, thread, 3) = m_lg;
}
return (m_lg);
}
DEFINE_EXECUTE_AT_END(time_step_update)
{
real zf,ln;
#if !RP_HOST
Domain *domain;
Thread *thread;
cell_t cell;
domain = Get_Domain(1);
#endif
#if !RP_HOST
thread_loop_c(thread, domain)
{
begin_c_loop(cell, thread)
{
zf = C_UDMI(cell, thread, 2);
ln = C_UDMI(cell, thread, 3);
}
end_c_loop(cell, thread);
}
#endif
#if RP_NODE
zf = PRF_GRSUM1(zf);
ln = PRF_GRSUM1(ln);
#endif
node_to_host_real_2( zf, ln);
#if !RP_NODE
Message("zf is : %g\n", zf);
Message("ln is : %g\n", ln);
#endif
}@wuming524 |