Fluent專家-udf-1 (液體的蒸發(fā)相變模擬)
evaporation and condensation.rar
Fluent專家-udf-1
(液體的蒸發(fā)相變模擬)
案例簡(jiǎn)介
本案例對(duì)二維容器內(nèi)水的蒸發(fā)相變過(guò)程進(jìn)行模擬分析,容器底部被持續(xù)加熱,容器內(nèi)裝滿水,液面為自由液面,與底部接觸的水蒸發(fā)形成水蒸汽氣泡,并逐漸上竄至液面逸出,屬于動(dòng)態(tài)變化過(guò)程。
本案例通過(guò)udf來(lái)定義了水與水蒸汽之間的轉(zhuǎn)換。
視頻教程播放地址:http://www.yqgqt.org.cn/college/video/c10217
水蒸汽質(zhì)量分?jǐn)?shù)動(dòng)畫(huà)

水和水蒸汽速度分布云圖

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-進(jìn)口速度
#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)
}
視頻教程播放地址:http://www.yqgqt.org.cn/college/video/c10217
工程師必備
- 項(xiàng)目客服
- 培訓(xùn)客服
- 平臺(tái)客服
TOP




















