| 3 | 1/1 | 返回列表 |
| 查看: 1975 | 回復(fù): 2 | |||
桐樹花開A新蟲 (初入文壇)
|
[交流]
fluent中降膜蒸發(fā)的氣液交界面動力剪切力源項udf,導(dǎo)入出錯,求指導(dǎo)。 已有2人參與
|
|
本人在做的管內(nèi)液膜氣液界面的剪切力動量源項udf,導(dǎo)入fluent中提示出錯,不知道原因在哪,我是用VOF模型,剪切力計算中應(yīng)用體積分?jǐn)?shù)梯度,和氣液兩相相對速度,我采用DEFINE_ON_DEMAND來分配存儲空間計算體積分?jǐn)?shù)梯度,現(xiàn)在出錯,本人是udf新手,想請教一下懂udf的人我這個程序的問題,十分感謝! #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; } |
木蟲 (小有名氣)

| 3 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 招收調(diào)劑碩士 +3 | lidianxing 2026-03-19 | 9/450 |
|
|---|---|---|---|---|
|
[考研] 0703化學(xué)調(diào)劑,求各位老師收留 +10 | 秋有木北 2026-03-14 | 10/500 |
|
|
[考研] 一志愿中國海洋大學(xué),生物學(xué),301分,求調(diào)劑 +4 | 1孫悟空 2026-03-17 | 4/200 |
|
|
[考研] 295求調(diào)劑 +3 | 一志愿京區(qū)211 2026-03-18 | 5/250 |
|
|
[考研] 085601專碩,總分342求調(diào)劑,地區(qū)不限 +5 | share_joy 2026-03-16 | 5/250 |
|
|
[考研] 297求調(diào)劑 +8 | 戲精丹丹丹 2026-03-17 | 8/400 |
|
|
[考研] 材料專碩274一志愿陜西師范大學(xué)求調(diào)劑 +6 | 薛云鵬 2026-03-13 | 6/300 |
|
|
[考研] 304求調(diào)劑 +12 | 小熊joy 2026-03-14 | 13/650 |
|
|
[考博] 環(huán)境領(lǐng)域全國重點實驗室招收博士1-2名 +3 | QGZDSYS 2026-03-13 | 5/250 |
|
|
[考研] 265求調(diào)劑 +3 | 梁梁校校 2026-03-17 | 3/150 |
|
|
[考研] 293求調(diào)劑 +11 | zjl的號 2026-03-16 | 16/800 |
|
|
[考研] 296求調(diào)劑 +5 | 大口吃飯 身體健 2026-03-13 | 5/250 |
|
|
[考研] 268求調(diào)劑 +8 | 一定有學(xué)上- 2026-03-14 | 9/450 |
|
|
[考研] 材料專碩326求調(diào)劑 +6 | 墨煜姒莘 2026-03-15 | 7/350 |
|
|
[考研] 290求調(diào)劑 +3 | p asserby. 2026-03-15 | 4/200 |
|
|
[考研] 機(jī)械專碩325,尋找調(diào)劑院校 +3 | y9999 2026-03-15 | 5/250 |
|
|
[考研] 277材料科學(xué)與工程080500求調(diào)劑 +3 | 自由煎餅果子 2026-03-16 | 3/150 |
|
|
[考研] 一志愿哈工大材料324分求調(diào)劑 +5 | 閆旭東 2026-03-14 | 5/250 |
|
|
[考研] 學(xué)碩285求調(diào)劑 +13 | Wisjxn 2026-03-12 | 46/2300 |
|
|
[考研] 工科材料085601 279求調(diào)劑 +8 | 困于星晨 2026-03-12 | 10/500 |
|