| 5 | 1/1 | 返回列表 |
| 查看: 1983 | 回復(fù): 2 | |||
| 當(dāng)前只顯示滿足指定條件的回帖,點(diǎn)擊這里查看本話題的所有回帖 | |||
桐樹花開A新蟲 (初入文壇)
|
[交流]
fluent中降膜蒸發(fā)的氣液交界面動(dòng)力剪切力源項(xiàng)udf,導(dǎo)入出錯(cuò),求指導(dǎo)。 已有2人參與
|
||
|
本人在做的管內(nèi)液膜氣液界面的剪切力動(dòng)量源項(xiàng)udf,導(dǎo)入fluent中提示出錯(cuò),不知道原因在哪,我是用VOF模型,剪切力計(jì)算中應(yīng)用體積分?jǐn)?shù)梯度,和氣液兩相相對速度,我采用DEFINE_ON_DEMAND來分配存儲(chǔ)空間計(jì)算體積分?jǐn)?shù)梯度,現(xiàn)在出錯(cuò),本人是udf新手,想請教一下懂udf的人我這個(gè)程序的問題,十分感謝! #include "udf.h" #include "sg_mphase.h" #define domain_ID 2 #define gas_volume_fraction 0.5 #define volume_fraction 0.99999 #define surface_force 0.6 #define g 9.8 #define d_tube 0.038 DEFINE_ADJUST(adjust_gradient,domain) { Thread *t; cell_t c; face_t f; domain=Get_Domain(domain_ID); /*Fill UDS with the variable.*/ thread_loop_c(t,domain) { begin_c_loop(c,t) { C_UDSI(c,t,0)=C_VOF(c,t); } end_c_loop(c,t) } thread_loop_f(t,domain) { if(THREAD_STORAGE(t,SV_UDS_I(0))!=NULL) begin_f_loop(f,t) { F_UDSI(f,t,0)=F_VOF(f,t); } end_f_loop(f,t) } } DEFINE_ON_DEMAND(store_gradient) { Domain *domain; cell_t c; Thread *t; domain=Get_Domain(domain_ID); /*Fill the UDM with magnitude of gradient.*/ thread_loop_c(t,domain) { begin_c_loop(c,t) { C_UDMI(c,t,0)=NV_MAG(C_UDSI_G(c,t,0)); } end_c_loop(c,t) } } DEFINE_ON_DEMAND(store_liquid_velocity) { Domain *domain; cell_t c; Thread *t; domain=Get_Domain(domain_ID); /*Fill the UDM with magnitude of velocity.*/ thread_loop_c(c,t) { begin_c_loop(c,t) { if(C_VOF(c,t)==gas_volume_fraction) C_UDMI(c,t,1)=C_U(c,t); } end_c_loop(c,t) } } DEFINE_ON_DEMAND(store_vapor_velocity) { Domain *domain; cell_t c; Thread *t; domain=Get_Domain(domain_ID); /*Fill the UDM with magnitude of velocity.*/ thread_loop_c(c,t) { begin_c_loop(c,t) { if(C_VOF(c,t)==volume_fraction) C_UDMI(c,t,2)=C_U(c,t); } end_c_loop(c,t) } } DEFINE_ON_DEMAND(thickness_liquid) { Domain *domain; cell_t c; Thread *t; real x[ND_ND],y; domain=Get_Domain(3); /*Fill the UDM with magnitude of thickness.*/ thread_loop_c(c,t) { begin_c_loop(c,t) { if(C_VOF(c,t)==gas_volume_fraction) C_CENTROID(x,c,t); y=x[1]; C_UDMI(c,t,3)=y; } end_c_loop(c,t) } } DEFINE_SOURCE(shear_source_y,c,t,mix_th,dS,eqn) { Thread *pri_th,*sec_th; real source_y,fi,ll,p1,d0,d1,th1,re_gas,n; pri_th=THREAD_SUB_THREAD(mix_th,0); sec_th=THREAD_SUB_THREAD(mix_th,1); p1=surface_force/(C_R(c,sec_th)-C_R(c,pri_th))/g; ll=pow(p1,0.5); th1=C_UDMI(c,t,3)/ll; d0=2*C_UDMI(c,t,3); d1=d0/ll; re_gas=C_R(c,pri_th)*C_UDMI(c,t,2)*(d_tube-2*C_UDMI(c,t,3))/C_MU_T(c,pri_th); n=(1.8+3/d1)*3.95; fi=0.079*pow(re_gas,-0.25)*(1+pow(th1,n)*115); if(C_VOF(c,pri_th)>=0.5&&C_VOF(c,pri_th)<=1.0) { source_y=C_UDMI(c,t,0)*fi*C_R(c,pri_th)*(C_UDMI(c,t,2)-C_UDMI(c,t,1))*fabs(C_UDMI(c,t,2)-C_UDMI(c,t,1)); return source_y; } |
木蟲 (小有名氣)

| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 一志愿華理,數(shù)一英一285求A區(qū)調(diào)劑 +8 | AZMK 2026-03-25 | 12/600 |
|
|---|---|---|---|---|
|
[考研] 085600,材料與化工321分求調(diào)劑 +9 | 大饞小子 2026-03-28 | 9/450 |
|
|
[考研] 一志愿中南大學(xué)化學(xué)0703總分337求調(diào)劑 +5 | niko- 2026-03-27 | 5/250 |
|
|
[考研] 346求調(diào)劑 一志愿070303有機(jī)化學(xué) +3 | 蘿卜燉青菜 2026-03-28 | 3/150 |
|
|
[考研] 材料與化工(0856)304求B區(qū)調(diào)劑 +8 | 邱gl 2026-03-27 | 8/400 |
|
|
[考研] 085405 考的11408求各位老師帶走 +3 | Qiu學(xué)ing 2026-03-28 | 3/150 |
|
|
[考研] 265求調(diào)劑 +8 | 小木蟲085600 2026-03-27 | 8/400 |
|
|
[考研] 求調(diào)劑 +4 | 零八# 2026-03-27 | 4/200 |
|
|
[考研] 化學(xué)調(diào)劑 +4 | 愛吃番茄的旭 2026-03-24 | 5/250 |
|
|
[考研] 283求調(diào)劑(080500) +4 | A child 2026-03-27 | 4/200 |
|
|
[考研] 348求調(diào)劑 +4 | 小懶蟲不懶了 2026-03-27 | 5/250 |
|
|
[考研] 調(diào)劑 +3 | 李嘉圖·S·路 2026-03-27 | 3/150 |
|
|
[考研]
|
鐘llll 2026-03-26 | 4/200 |
|
|
[考研] 342求調(diào)劑 +3 | 加油a李zs 2026-03-26 | 3/150 |
|
|
[考研] 求調(diào)劑 +8 | Auroracx 2026-03-22 | 8/400 |
|
|
[考研] 299求調(diào)劑 +4 | 15188958825 2026-03-25 | 4/200 |
|
|
[考研] 284求調(diào)劑 +15 | Zhao anqi 2026-03-22 | 15/750 |
|
|
[考研] 277分求調(diào)劑,跨調(diào)材料 +3 | 考研調(diào)劑lxh 2026-03-24 | 3/150 |
|
|
[基金申請] 請教下大家 2026年國家基金申請是雙盲審嗎? +3 | lishucheng1 2026-03-22 | 5/250 |
|
|
[考研] 308求調(diào)劑 +3 | 墨墨漠 2026-03-21 | 3/150 |
|