案例简介
本案例对二维容器内水的蒸发相变过程进行模拟分析,容器底部被持续加热,容器内装满水,液面为自由液面,与底部接触的水蒸发形成水蒸汽气泡,并逐渐上窜至液面逸出,属于动态变化过程。
本案例通过udf来定义了水与水蒸汽之间的转换。
水蒸汽质量分数动画
水和水蒸汽速度分布云图
udf-vapor水和水蒸汽
#include "udf.h"
#include "sg_mphase.h"
#define T_SAT 373
#define LAT_HT 3.e3
real a;
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);
a=C_T(cell, mix_th);
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;
dS[eqn] = 0.;
}
return m_dot_l;
}
DEFINE_SOURCE(vap_src, cell, sec_th, dS, eqn)
{
Thread * mix_th, *pri_th;
real m_dot_v;
mix_th = THREAD_SUPER_THREAD(sec_th);
pri_th = THREAD_SUB_THREAD(mix_th, 0);
if(C_T(cell, mix_th)>=T_SAT){
m_dot_v = 0.1*C_VOF(cell, pri_th)*C_R(cell, pri_th)*
fabs(C_T(cell, mix_th) - T_SAT)/T_SAT;
dS[eqn] = 0.;
}
else {
m_dot_v = -0.1*C_VOF(cell, sec_th)*C_R(cell, sec_th)*
fabs(T_SAT-C_T(cell,mix_th))/T_SAT;
dS[eqn] = -0.1*C_R(cell, sec_th)*
fabs(C_T(cell, sec_th) - T_SAT)/T_SAT;
}
return m_dot_v;
}
DEFINE_SOURCE(enrg_src, cell, mix_th, dS, eqn)
{
Thread *pri_th, *sec_th;
real m_dot;
pri_th = THREAD_SUB_THREAD(mix_th, 0);
sec_th = THREAD_SUB_THREAD(mix_th, 1);
if(C_T(cell, mix_th)>=T_SAT){
m_dot = -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_VOF(cell, pri_th)*C_R(cell, pri_th)/T_SAT;
}
else {
m_dot = 0.1*C_VOF(cell, sec_th)*C_R(cell, sec_th)*
fabs(T_SAT-C_T(cell,mix_th))/T_SAT;
dS[eqn] = -0.1*C_VOF(cell, sec_th)*C_R(cell, sec_th)/T_SAT;}
return LAT_HT*m_dot;
}
udf-进口速度
#include "udf.h"
DEFINE_PROFILE(inlet_x_velocity, thread, index)
{
real x[ND_ND];
real y, h;
face_t f;
h=1; /*inlet height in m*/
begin_f_loop(f, thread)
{
F_CENTROID(x, f, thread);
y=1.-x[1]/h;
F_PROFILE(f, thread, index)=2*(1.0-y*y);
}
end_f_loop(f, thread)
}
免责声明:本文系网络转载或改编,未找到原创作者,版权归原作者所有。如涉及版权,请联系删