| 5 | 1/1 | 返回列表 |
| 查看: 1966 | 回復: 8 | ||
| 當前只顯示滿足指定條件的回帖,點擊這里查看本話題的所有回帖 | ||
zhoufu1989銀蟲 (小有名氣)
|
[求助]
fluent udf compile失敗
|
|
|
才接觸udf不久的新人,希望各位前輩指點迷津。 模型如圖示: ,要對紅色的圓柱壁面添加熱流。http://bcs.duapp.com/emuchnet/20 ... _1369793765_108.png,熱流隨角度的關(guān)系如圖所示,采用分段多項式擬合。 由于我采用的是直角坐標,所以上面擬合的關(guān)系式,要將角度(圓柱面半徑25mm)轉(zhuǎn)換成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 |

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

銀蟲 (小有名氣)

銀蟲 (小有名氣)

木蟲 (正式寫手)
| 粗略掃了一下程序,沒細究,發(fā)現(xiàn)你都把邏輯與(&&)寫成了按位與(&),這個對你判斷有影響沒? |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 352分 化工與材料 +3 | 海納百川Ly 2026-03-27 | 3/150 |
|
|---|---|---|---|---|
|
[考研] 287求調(diào)劑 +10 | land xuxu 2026-03-26 | 10/500 |
|
|
[考研] 085600材料與化工調(diào)劑 +10 | A-哆啦Z夢 2026-03-23 | 16/800 |
|
|
[考研] 269專碩求調(diào)劑 +10 | 金恩貝 2026-03-21 | 10/500 |
|
|
[考研] 085600,材料與化工321分調(diào)劑 +4 | 大饞小子 2026-03-27 | 6/300 |
|
|
[考研] 材料求調(diào)劑 +8 | @taotao 2026-03-21 | 8/400 |
|
|
[考研] 325求調(diào)劑 +5 | 李嘉圖·S·路 2026-03-23 | 5/250 |
|
|
[考研] 342求調(diào)劑 +3 | 加油a李zs 2026-03-26 | 3/150 |
|
|
[考研]
|
平樂樂樂 2026-03-26 | 4/200 |
|
|
[考研] 材料考研求調(diào)劑 +3 | Dendel 2026-03-23 | 6/300 |
|
|
[考研] 309求調(diào)劑 +4 | gajsj 2026-03-25 | 5/250 |
|
|
[考研] 332求調(diào)劑 +6 | 032500 2026-03-25 | 6/300 |
|
|
[考研] 生物技術(shù)與工程 +3 | 1294608413 2026-03-25 | 4/200 |
|
|
[考研] 284求調(diào)劑 +15 | Zhao anqi 2026-03-22 | 15/750 |
|
|
[考研] 318求調(diào)劑 +3 | plum李子 2026-03-23 | 3/150 |
|
|
[考博] 26申博自薦 +3 | whh869393 2026-03-24 | 3/150 |
|
|
[考研] 環(huán)境學碩288求調(diào)劑 +8 | 皮皮皮123456 2026-03-22 | 8/400 |
|
|
[考研] 341求調(diào)劑(一志愿湖南大學070300) +5 | 番茄頭--- 2026-03-22 | 6/300 |
|
|
[考研] 284求調(diào)劑 +3 | yanzhixue111 2026-03-23 | 6/300 |
|
|
[考研]
|
2117205181 2026-03-21 | 8/400 |
|