| 3 | 1/1 | 返回列表 |
| 查看: 1976 | 回復(fù): 2 | |||
桐樹花開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ù)梯度,和氣液兩相相對(duì)速度,我采用DEFINE_ON_DEMAND來分配存儲(chǔ)空間計(jì)算體積分?jǐn)?shù)梯度,現(xiàn)在出錯(cuò),本人是udf新手,想請(qǐng)教一下懂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; } |
木蟲 (小有名氣)

| 3 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 材料專碩274一志愿陜西師范大學(xué)求調(diào)劑 +8 | 薛云鵬 2026-03-13 | 8/400 |
|
|---|---|---|---|---|
|
[考研] 化學(xué)求調(diào)劑 +3 | 臨澤境llllll 2026-03-17 | 4/200 |
|
|
[考研] 一志愿985,本科211,0817化學(xué)工程與技術(shù)319求調(diào)劑 +10 | Liwangman 2026-03-15 | 10/500 |
|
|
[考研] 0703化學(xué)調(diào)劑 +8 | 妮妮ninicgb 2026-03-15 | 12/600 |
|
|
[考研] 0703化學(xué) 305求調(diào)劑 +4 | FY_yy 2026-03-14 | 4/200 |
|
|
[考研] 【同濟(jì)軟件】軟件(085405)考研求調(diào)劑 +3 | 2026eternal 2026-03-18 | 3/150 |
|
|
[考研] 化學(xué)工程321分求調(diào)劑 +15 | 大米飯! 2026-03-15 | 18/900 |
|
|
[考研] 311求調(diào)劑 +11 | 冬十三 2026-03-15 | 12/600 |
|
|
[考研] 材料專碩306英一數(shù)二 +10 | z1z2z3879 2026-03-16 | 13/650 |
|
|
[考研] 070300化學(xué)319求調(diào)劑 +6 | 錦鯉0909 2026-03-17 | 6/300 |
|
|
[考研] 材料,紡織,生物(0856、0710),化學(xué)招生啦 +3 | Eember. 2026-03-17 | 9/450 |
|
|
[考研] 301求調(diào)劑 +9 | yy要上岸呀 2026-03-17 | 9/450 |
|
|
[考研] 278求調(diào)劑 +5 | 煙火先于春 2026-03-17 | 5/250 |
|
|
[考研] 268求調(diào)劑 +8 | 一定有學(xué)上- 2026-03-14 | 9/450 |
|
|
[考研] 材料與化工專碩調(diào)劑 +5 | heming3743 2026-03-16 | 5/250 |
|
|
[考研] 275求調(diào)劑 +4 | 太陽花天天開心 2026-03-16 | 4/200 |
|
|
[考研] 333求調(diào)劑 +3 | 文思客 2026-03-16 | 7/350 |
|
|
[考研] 中科院材料273求調(diào)劑 +4 | yzydy 2026-03-15 | 4/200 |
|
|
[考研] 26考研一志愿中國石油大學(xué)(華東)305分求調(diào)劑 +3 | 嘉年新程 2026-03-15 | 3/150 |
|
|
[考研] 297求調(diào)劑 +4 | 學(xué)海漂泊 2026-03-13 | 4/200 |
|