|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
#include "udf.h"
#include "sg_mphase.h"
#define A1_P 58042
#define A2_P 273
#define A3_P 2.963
#define A4_P 58660
#define A5_P 0.0151
#define A6_P 4.273
#define A7_P 2.963
#define A8_P 0.0151
#define A9_P 4.237
#define C1_DOT 2.022
#define C2_DOT -0.498
#define C3_DOT 0.666
#define C4_DOT 3.471
#define C5_DOT -2.223
#define C6_DOT 0.114
#define VOF_RY 6.278e-05
#define A10_P 101325
#define A11_P 0.662
#define LAT_HT 2260
DEFINE_SOURCE(liq_src, cell, pri_th, dS, eqn)
{
Thread *mix_th, *sec_th, *thi_th;
real m_dot_l;
real nd_liq;
real tem_liq,rot_liq,rot_vap,rot_air,tem_air;
real d,pp_liq,pp_vap;
real vof_liq,vof_vap,vof_air;
mix_th = THREAD_SUPER_THREAD(pri_th);
sec_th = THREAD_SUB_THREAD(mix_th, 1);
vof_liq = C_VOF(cell,pri_th);
vof_vap = C_VOF(cell,sec_th);
vof_air = C_VOF(cell,thi_th);
tem_liq = C_T(cell,pri_th);
rot_liq = C_R(cell,pri_th);
rot_vap = C_R(cell,sec_th);
rot_air = C_R(cell,thi_th);
tem_air = C_T(cell,thi_th);
nd_liq =(7/13)*0.005/(vof_liq+(7/13)*0.005);
d = (rot_vap*vof_vap)/(rot_air*vof_air);
pp_liq = A1_P+A9_P*pow((tem_liq-A2_P),A3_P)-A4_P*pow(nd_liq,A8_P)-A6_P*pow((tem_liq-A2_P),A3_P)*pow(nd_liq,A8_P);
pp_vap = (d*A10_P)/(d+A11_P);
if(pp_vap > pp_liq){
m_dot_l = 0.001*3697*pow(d,C1_DOT)*pow(tem_air,C2_DOT)*pow(1.1*(rot_vap+rot_air)*0.04,C3_DOT)*pow(nd_liq,C4_DOT)*pow(tem_liq,C5_DOT)*pow(VOF_RY,C6_DOT);
dS[eqn] = -0.001*3697*pow(d,C1_DOT)*pow(tem_air,C2_DOT)*pow(1.1*(rot_vap+rot_air)*0.04,C3_DOT)*C4_DOT*pow(nd_liq,(C4_DOT-1))*(-(7/13)*0.005/pow((vof_liq+(7/13)*0.005),2))*pow(tem_liq,C5_DOT)*pow(VOF_RY,C6_DOT);
}
else{
m_dot_l = -0.001*3697*pow(d,C1_DOT)*pow(tem_air,C2_DOT)*pow(1.1*(rot_vap+rot_air)*0.04,C3_DOT)*pow(nd_liq,C4_DOT)*pow(tem_liq,C5_DOT)*pow(VOF_RY,C6_DOT);
dS[eqn] = -0.001*3697*pow(d,C1_DOT)*pow(tem_air,C2_DOT)*pow(1.1*(rot_vap+rot_air)*0.04,C3_DOT)*C4_DOT*pow(nd_liq,(C4_DOT-1))*(-(7/13)*0.005/pow((vof_liq+(7/13)*0.005),2))*pow(tem_liq,C5_DOT)*pow(VOF_RY,C6_DOT);
}
return m_dot_l;
}
DEFINE_SOURCE(vap_src, cell, sec_th, dS, eqn)
{
Thread *mix_th, *pri_th, *thi_th;
real m_dot_v;
real nd_liq;
real tem_liq,rot_liq,rot_vap,rot_air,tem_air;
real d,pp_liq,pp_vap;
real vof_liq,vof_vap,vof_air;
mix_th = THREAD_SUPER_THREAD(sec_th);
pri_th = THREAD_SUB_THREAD(mix_th, 0);
vof_liq = C_VOF(cell,pri_th);
vof_vap = C_VOF(cell,sec_th);
vof_air = C_VOF(cell,thi_th);
tem_liq = C_T(cell,pri_th);
rot_liq = C_R(cell,pri_th);
rot_vap = C_R(cell,sec_th);
rot_air = C_R(cell,thi_th);
tem_air = C_T(cell,thi_th);
nd_liq = (7/13)*0.005/(vof_liq+(7/13)*0.005);
d = (rot_vap*vof_vap)/(rot_air*vof_air);
pp_liq = A1_P+A9_P*pow((tem_liq-A2_P),A3_P)-A4_P*pow(nd_liq,A8_P)-A6_P*pow((tem_liq-A2_P),A3_P)*pow(nd_liq,A8_P);
pp_vap = (d*A10_P)/(d+A11_P);
if(pp_vap > pp_liq){
m_dot_v = -0.001*3697*pow(d,C1_DOT)*pow(tem_air,C2_DOT)*pow(1.1*(rot_vap+rot_air)*0.04,C3_DOT)*pow(nd_liq,C4_DOT)*pow(tem_liq,C5_DOT)*pow(VOF_RY,C6_DOT);
dS[eqn] = -0.001*3697*C1_DOT*pow(d,(C1_DOT-1))*(rot_vap)/(rot_air*vof_air)*pow(tem_air,C2_DOT)*pow(1.1*(rot_vap+rot_air)*0.04,C3_DOT)*pow(nd_liq,C4_DOT)*pow(tem_liq,C5_DOT)*pow(VOF_RY,C6_DOT);
}
else{
m_dot_v = 0.001*3697*pow(d,C1_DOT)*pow(tem_air,C2_DOT)*pow(1.1*(rot_vap+rot_air)*0.04,C3_DOT)*pow(nd_liq,C4_DOT)*pow(tem_liq,C5_DOT)*pow(VOF_RY,C6_DOT);
dS[eqn] = -0.001*3697*C1_DOT*pow(d,(C1_DOT-1))*(rot_vap)/(rot_air*vof_air)*pow(tem_air,C2_DOT)*pow(1.1*(rot_vap+rot_air)*0.04,C3_DOT)*pow(nd_liq,C4_DOT)*pow(tem_liq,C5_DOT)*pow(VOF_RY,C6_DOT);
}
return m_dot_v;
}
DEFINE_SOURCE(enrg_src, cell, mix_th, dS, eqn)
{
Thread *pri_th , *sec_th, *thi_th;
real m_dot, m_dot_e;
real nd_liq;
real tem_liq,rot_liq,rot_vap,rot_air,tem_air,tem_vap;
real d,pp_liq,pp_vap;
real vof_liq,vof_vap,vof_air;
pri_th = THREAD_SUB_THREAD(mix_th, 0);
sec_th = THREAD_SUB_THREAD(mix_th, 1);
thi_th = THREAD_SUB_THREAD(mix_th, 2);
vof_liq = C_VOF(cell,pri_th);
vof_vap = C_VOF(cell,sec_th);
vof_air = C_VOF(cell,thi_th);
tem_liq = C_T(cell,pri_th);
tem_vap = C_T(cell,sec_th);
rot_liq = C_R(cell,pri_th);
rot_vap = C_R(cell,sec_th);
rot_air = C_R(cell,thi_th);
tem_air = C_T(cell,thi_th);
nd_liq = (7/13)*0.005/(vof_liq+(7/13)*0.005);
d = (rot_vap*vof_vap)/(rot_air*vof_air);
pp_liq = A1_P+A9_P*pow((tem_liq-A2_P),A3_P)-A4_P*pow(nd_liq,A8_P)-A6_P*pow((tem_liq-A2_P),A3_P)*pow(nd_liq,A8_P);
pp_vap = (d*A10_P)/(d+A11_P);
if(pp_vap > pp_liq){
m_dot = 0.001*3697*pow(d,C1_DOT)*pow(tem_air,C2_DOT)*pow(1.1*(rot_vap+rot_air)*0.04,C3_DOT)*pow(nd_liq,C4_DOT)*pow(tem_liq,C5_DOT)*pow(VOF_RY,C6_DOT);
dS[eqn] = -0.001*3697*pow(d,C1_DOT)*pow(tem_air,C2_DOT)*pow(1.1*(rot_vap+rot_air)*0.04,C3_DOT)*pow(nd_liq,C4_DOT)*C5_DOT*pow(tem_liq,(C5_DOT-1))*pow(VOF_RY,C6_DOT);
}
else {
m_dot = -0.001*3697*pow(d,C1_DOT)*pow(tem_air,C2_DOT)*pow(1.1*(rot_vap+rot_air)*0.04,C3_DOT)*pow(nd_liq,C4_DOT)*pow(tem_liq,C5_DOT)*pow(VOF_RY,C6_DOT);
dS[eqn] = -0.001*3697*pow(d,C1_DOT)*C2_DOT*pow(tem_air,(C2_DOT-1))*pow(1.1*(rot_vap+rot_air)*0.04,C3_DOT)*pow(nd_liq,C4_DOT)*pow(tem_liq,C5_DOT)*pow(VOF_RY,C6_DOT);
}
return m_dot_e = m_dot*LAT_HT;
}
求助:我做的是三相的传热传质,水、水蒸汽、干空气,水蒸汽发生冷凝凝结成水,水蒸汽放出汽化潜热!
我用的混合模型!可是还是在初始化的过程中出现问题了
Error:
FLUENT received fatal signal (ACCESS_VIOLATION)
1. Note exact events leading to error.
2. Save case/data under new name.
3. Exit program and restart to continue.
4. Report error to your distributor.
Error Object: ()
编译通过,但是初始化不行,求助:我查了好久法相网上人都说是变量御值方面出了问题,请大家给些意见和讨论,谢谢 |
|