| 5 | 1/1 | 返回列表 |
| 查看: 4264 | 回復(fù): 11 | ||||
| 當(dāng)前只顯示滿足指定條件的回帖,點擊這里查看本話題的所有回帖 | ||||
塵積銀蟲 (小有名氣)
|
[交流]
【求助】fluent計算中,udf編譯通過,初始化出錯 已有2人參與
|
|||
|
麻煩達(dá)人老兄們救急,這個程序是用來定義出口處的壓力的,編譯成功,但是在邊界條件里選中此UDF后,在初始化時報錯,不知是何緣故,請各位不吝賜教,拜謝! 程序為:#include "udf.h" DEFINE_PROFILE(pressure_outlet,thread,position) { real x[ND_ND]; real y; real a; face_t f; cell_t c; begin_f_loop(f,thread) { F_CENTROID(x,f,thread); y=x[1]; a=F_U(f,thread); F_PROFILE(f,thread,position)=1000*9.81*(1-y/1000)-0.5*1000*a*a; } end_f_loop(f,thread) } 錯誤提示為: Error: FLUENT received fatal signal (ACCESS_VIOLATION) 1. Note exact events leading to error. 2. Save case/data under new name. 3. Exit program and restart to continue. 4. Report error to your distributor. Error Object: () |
多相流UDF |
新蟲 (初入文壇)
|
我也遇到了這情況!lz大哥你就絕了沒有,我是自定義的密度和粘度,編譯沒問題,初始化通不過,附上我的程序,求指導(dǎo)~ #include "udf.h" #define TC 305.25 #define PC 7380000 #define W 0.225 #define R 8.314 #define tc 305.25 #define pc 7375000 #define w 0.225 #define r 8.314 #define pc1 73.75 #define dc 468 #define m 44.01 #define v0 150 DEFINE_PROPERTY(cell_density, cell, thread) { real dd; real temp = C_T(cell, thread); real pres = C_P(cell, thread); real tr,k,a1,a2,a,b,a3,a4,a5,a6,b1,b2,b3,y1,y2,y3,x; tr = temp/TC; k = 0.37464+1.54226*W-0.26992*W*W; a1 = (1+k*(1-sqrt(tr)))*(1+k*(1-sqrt(tr))); a2 = 0.45724*R*R*TC*TC/PC; a = a1*a2; b=0.0778*R*TC/PC; a3=pres; a4=pres*b-R*temp; a5=a-3*pres*b*b-2*R*temp*b; a6=pres*b*b*b+R*temp*b*b-a*b; b1 = a4*a4-3*a3*a5; b2 = a4*a5-9*a3*a6; b3 = a5*a5-3*a4*a6; y1 = b1*a4+3*a3*(-b2+sqrt(b2*b2-4*b1*b3))/2; y2 = b1*a4+3*a3*(-b2-sqrt(b2*b2-4*b1*b3))/2; if (y1<0) {y3=-y1;} else {y3=y1;} x = (-a4-(pow(y3,0.33333)-pow(-y2,0.33333)))/(3*a3); dd =44/(1000*x); return dd; } DEFINE_PROPERTY(cell_viscosity, cell, thread) { real v; real temp = C_T(cell, thread); real pres = C_P(cell, thread); real tr,k,a1,a2,a,b,a3,a4,a5,a6,b1,b2,b3,y1,y2,y3,x,dd,b4,b5,dr; tr=temp/tc; k=0.37464+1.54226*w-0.26992*w*w; a1=(1+k*(1-sqrt(tr)))*(1+k*(1-sqrt(tr))); a2=0.45724*r*r*tc*tc/pc; a=a1*a2; b=0.0778*r*tc/pc; a3=pres; a4=pres*b-r*temp; a5=a-3*pres*b*b-2*r*temp*b; a6=pres*b*b*b+r*temp*b*b-a*b; b1=a4*a4-3*a3*a5; b2=a4*a5-9*a3*a6; b3=a5*a5-3*a4*a6; y1=b1*a4+3*a3*(-b2+sqrt(b2*b2-4*b1*b3))/2; y2=b1*a4+3*a3*(-b2-sqrt(b2*b2-4*b1*b3))/2; if (y1<0) {y3=-y1;} else {y3=y1;} x=(-a4-(pow(y3,0.333333)-pow(-y2,0.333333)))/(3*a3); dd=44/(1000*x); b4=pow(tc,0.166666)/(sqrt(m)*pow(pc1,0.666666)); dr=dd/dc; b5=1.0230+0.23364*dr+0.058533*pow(dr,2)-0.40758*(dr,3)+0.093324*pow(dr,4); v=(((pow(b5,4)-1)/b4)+v0)*0.000001; return v; } 錯誤提示: Error: FLUENT received fatal signal (ACCESS_VIOLATION) 1. Note exact events leading to error. 2. Save case/data under new name. 3. Exit program and restart to continue. 4. Report error to your distributor. Error Object: () |
銀蟲 (小有名氣)
|
試了一下編輯可以通過:程序應(yīng)該為 #include "udf.h" DEFINE_PROFILE(pressure_outlet,thread,position) { real x[ND_ND]; real y; real a; face_t f; begin_f_loop(f,thread) { F_CENTROID(x,f,thread); y=x[1]; a=F_U(f,thread); F_PROFILE(f,thread,position)=1000.*9.81*(1-y/1000.)-0.5*1000.*a*a; } end_f_loop(f,thread) } |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 找調(diào)劑 +6 | 楚喬喬 2026-04-01 | 6/300 |
|
|---|---|---|---|---|
|
[考研] 071000生物學(xué)調(diào)劑 +3 | 知昭蔓 2026-04-02 | 3/150 |
|
|
[考研] 計算機(jī)265跨調(diào)環(huán)境 +5 | Yumeng_6 2026-03-27 | 5/250 |
|
|
[考研] 材料專碩322分 +11 | 哈哈哈吼吼吼哈 2026-04-01 | 11/550 |
|
|
[考研] 367求調(diào)劑 +8 | 芋泥啵啵… 2026-03-28 | 8/400 |
|
|
[考研] 材料調(diào)劑 +12 | 一樣YWY 2026-04-01 | 12/600 |
|
|
[考研] 292求調(diào)劑 +17 | 木蟲er12138 2026-04-01 | 17/850 |
|
|
[考研] 070300化學(xué)279求調(diào)劑 +15 | 哈哈哈^_^ 2026-03-31 | 17/850 |
|
|
[考研] 339求調(diào)劑,想調(diào)回江蘇 +7 | 烤麥芽 2026-03-27 | 10/500 |
|
|
[考研] 318求調(diào)劑 +3 | 篤行致遠(yuǎn). 2026-03-31 | 3/150 |
|
|
[考研] 考研調(diào)劑 +9 | 小蠟新筆 2026-03-29 | 10/500 |
|
|
[考研] 一志愿華東師范大學(xué)有機(jī)化學(xué)專業(yè),初試351分,復(fù)試被刷求調(diào)劑! +9 | 真名有冰 2026-03-29 | 10/500 |
|
|
[考研] 346求調(diào)劑 一志愿070303有機(jī)化學(xué) +11 | 蘿卜燉青菜 2026-03-28 | 12/600 |
|
|
[考研] 322求調(diào)劑 +10 | 宋明欣 2026-03-27 | 10/500 |
|
|
[考研] 340求調(diào)劑 +6 | Amber00 2026-03-26 | 6/300 |
|
|
[考研] 332求92調(diào)劑 +8 | 蕉蕉123 2026-03-28 | 8/400 |
|
|
[考研] 308求調(diào)劑 +7 | 墨墨漠 2026-03-27 | 7/350 |
|
|
[考研] 08開頭275求調(diào)劑 +4 | 拉誰不重要 2026-03-26 | 4/200 |
|
|
[考研] 調(diào)劑 +3 | 李嘉圖·S·路 2026-03-27 | 3/150 |
|
|
[考研] 292求調(diào)劑 +4 | 求求了收下我吧?/a> 2026-03-26 | 4/200 |
|