| 24小時熱門版塊排行榜 |
| 9 | 1/1 | 返回列表 |
| 查看: 1957 | 回復: 8 | ||
zhoufu1989銀蟲 (小有名氣)
|
[求助]
fluent udf compile失敗
|
|
|
才接觸udf不久的新人,希望各位前輩指點迷津! 模型如圖示: ,要對紅色的圓柱壁面添加熱流。http://bcs.duapp.com/emuchnet/20 ... _1369793765_108.png,熱流隨角度的關系如圖所示,采用分段多項式擬合。 由于我采用的是直角坐標,所以上面擬合的關系式,要將角度(圓柱面半徑25mm)轉換成x、y坐標,編寫的udf如下: #include "udf.h" #define A 57.295709 #define R 25.000 DEFINE_PROFILE(heat_flux,thread,index) { real x[ND_ND]; real a,b,temp1,temp2,temp3,temp4,temp5,temp6,temp7,temp8; face_t f; begin_f_loop(f,thread) { F_CENTROID(x,f,thread); a=x[0]; b=x[1]; if(a>=0&b>=0) { temp1=A*asin(b/R); F_PROFILE(f,thread,index)=773.08579+6.5979*temp1-0.01532*temp1*temp1-0.00467*temp1*temp1*temp1+0.000033032*temp1*temp1*temp1*temp1; } else if(b>0&-16.8897<=a<0) { temp2=180-A*asin(b/R); F_PROFILE(f,thread,index)=1310690.000-37867.31033*temp2+353.99224*temp2*temp2-1.0564*temp2*temp2*temp2; } else if(b>0&-24.0908<=a<-16.8897) { temp3=180-A*asin(b/R); F_PROFILE(f,thread,index)=485341.70814-7575.60803*temp3+43.67718*temp3*temp3-0.08533*temp3*temp3*temp3; } else if(b>=0&-25.0<=a<-24.0908) { temp4=180-A*asin(b/R); F_PROFILE(f,thread,index)=-21122000.000+492125.95098*temp4-4243.96404*temp4*temp4+16.09596*temp4*temp4*temp4-0.02267*temp4*temp4*temp4*temp4; } else if(b>=0&-23.7081<=a<-25.0) { temp5=180-A*asin(b/R); F_PROFILE(f,thread,index)=-21122000.000+492125.95098*temp5-4243.96404*temp5*temp5+16.09596*temp5*temp5*temp5-0.02267*temp5*temp5*temp5*temp5; } else if(b<0&-23.7081<a<=-16.5655) { temp6=180-A*asin(b/R); F_PROFILE(f,thread,index)=164115.58656-971.46727*temp6-0.07801*temp6*temp6+0.0094*temp6*temp6*temp6; } else if(b<0&-16.5655<a<=0) { temp7=180-A*asin(b/R); F_PROFILE(f,thread,index)=-15203500.000+187415.08644*temp7-761.84536*temp7*temp7+1.0232*temp7*temp7*temp7; } else { temp8=360+A*asin(b/R); F_PROFILE(f,thread,index)=337883.03869-4342.70635*temp8+20.62194*temp8*temp8-0.04289*temp8*temp8*temp8+0.000033032*temp8*temp8*temp8*temp8; } } end_f_loop(f,thread) } interpret不報錯,但是算了一下,最后熱流沒加上去。 compile出現(xiàn)如下錯誤: 已復制 1 個文件。 (system "copy D:\software\fluent\fluent\Fluent.Inc\fluent6.3.26\src\makefile_nt.udf libudf\ntx86\3d\makefile" ![]() 已復制 1 個文件。 (chdir "libudf" ()(chdir "ntx86\3d" ()Done. "f:/gambit/sample" Opening library "libudf"... Error: open_udf_library: 系統(tǒng)找不到指定的文件。 Error Object: () 謝謝大家了! 模型圖.png b.png |

木蟲 (正式寫手)
| 粗略掃了一下程序,沒細究,發(fā)現(xiàn)你都把邏輯與(&&)寫成了按位與(&),這個對你判斷有影響沒? |
木蟲 (正式寫手)
銀蟲 (小有名氣)

木蟲 (小有名氣)
| 如果確定正確的udf是可以編譯的,那么else if(b>=0&-23.7081<=a<-25.0)a的范圍有問題,改一下試試…… |

銀蟲 (小有名氣)

銀蟲 (小有名氣)

木蟲 (著名寫手)
科研小蟲
| 9 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 295求調劑 +4 | 一志愿京區(qū)211 2026-03-18 | 6/300 |
|
|---|---|---|---|---|
|
[考研] 求調劑一志愿南京航空航天大學289分 +3 | @taotao 2026-03-19 | 3/150 |
|
|
[考研] 260求調劑 +3 | 朱芷琳 2026-03-20 | 3/150 |
|
|
[考研] 材料學求調劑 +4 | Stella_Yao 2026-03-20 | 4/200 |
|
|
[基金申請]
學校已經(jīng)提交到NSFC,還能修改嗎?
40+4
|
babangida 2026-03-19 | 8/400 |
|
|
[考研] 08工學調劑 +5 | 用戶573181 2026-03-20 | 5/250 |
|
|
[考研] 0703化學調劑 +10 | 妮妮ninicgb 2026-03-15 | 14/700 |
|
|
[考研] 梁成偉老師課題組歡迎你的加入 +9 | 一鴨鴨喲 2026-03-14 | 11/550 |
|
|
[考研] 一志愿福大288有機化學,求調劑 +3 | 小木蟲200408204 2026-03-18 | 3/150 |
|
|
[考研] 328求調劑,英語六級551,有科研經(jīng)歷 +4 | 生物工程調劑 2026-03-16 | 12/600 |
|
|
[考研] 材料工程專碩調劑 +5 | 204818@lcx 2026-03-17 | 6/300 |
|
|
[考研] 材料專業(yè)求調劑 +5 | hanamiko 2026-03-18 | 5/250 |
|
|
[考研] 344求調劑 +6 | knight344 2026-03-16 | 7/350 |
|
|
[考研] 311求調劑 +6 | 26研0 2026-03-15 | 6/300 |
|
|
[考研] 一志愿西南交大,求調劑 +4 | 材化逐夢人 2026-03-18 | 4/200 |
|
|
[考研] 268求調劑 +8 | 一定有學上- 2026-03-14 | 9/450 |
|
|
[碩博家園] 湖北工業(yè)大學 生命科學與健康學院-課題組招收2026級食品/生物方向碩士 +3 | 1喜春8 2026-03-17 | 5/250 |
|
|
[考研] 283求調劑 +3 | 聽風就是雨; 2026-03-16 | 3/150 |
|
|
[考研] 304求調劑 +5 | 素年祭語 2026-03-15 | 5/250 |
|
|
[考研] 321求調劑 +5 | 大米飯! 2026-03-15 | 5/250 |
|