| 5 | 1/1 | 返回列表 |
| 查看: 4266 | 回復(fù): 11 | ||||
| 當(dāng)前只顯示滿足指定條件的回帖,點(diǎn)擊這里查看本話題的所有回帖 | ||||
塵積銀蟲 (小有名氣)
|
[交流]
【求助】fluent計(jì)算中,udf編譯通過,初始化出錯(cuò) 已有2人參與
|
|||
|
麻煩達(dá)人老兄們救急,這個(gè)程序是用來定義出口處的壓力的,編譯成功,但是在邊界條件里選中此UDF后,在初始化時(shí)報(bào)錯(cuò),不知是何緣故,請各位不吝賜教,拜謝! 程序?yàn)椋?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) } 錯(cuò)誤提示為: 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 |
|
試了一下編輯可以通過:程序應(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) } |
銀蟲 (小有名氣)
新蟲 (初入文壇)
|
我也遇到了這情況啊!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; } 錯(cuò)誤提示: 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: () |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 346求調(diào)劑 +5 | 鄭誠樂 2026-04-02 | 5/250 |
|
|---|---|---|---|---|
|
[考研] 285求調(diào)劑 +14 | AZMK 2026-04-02 | 14/700 |
|
|
[考研] 298求調(diào)劑 +3 | zzz,,r 2026-04-02 | 6/300 |
|
|
[考研] 309求調(diào)劑 +8 | 呆菇不是戴夫 2026-04-02 | 8/400 |
|
|
[考研] 總分328生物與醫(yī)藥考數(shù)學(xué)求調(diào)劑 +3 | aaadim 2026-04-02 | 3/150 |
|
|
[考研] 安全工程 285 求調(diào)劑 +3 | Xinyu56 2026-04-01 | 4/200 |
|
|
[考研] 303分 0807學(xué)碩求調(diào)劑 +3 | TYC3632 2026-04-01 | 3/150 |
|
|
[考研] 362求調(diào)劑 +13 | 西南交材料專碩3 2026-03-31 | 13/650 |
|
|
[考研] 調(diào)劑 +5 | 好好讀書。 2026-03-28 | 7/350 |
|
|
[考研] 材料專碩306英一數(shù)二 +7 | z1z2z3879 2026-03-31 | 7/350 |
|
|
[考研] 一志愿:西北大學(xué),英一數(shù)一408-284分求調(diào)劑 +7 | 12.27 2026-03-27 | 7/350 |
|
|
[考研] 375求調(diào)劑 +7 | 雨夏整夜 2026-03-29 | 7/350 |
|
|
[考研] 考研調(diào)劑求助 +7 | 13287130938 2026-03-31 | 7/350 |
|
|
[考研] 085600材料與化工調(diào)劑 +16 | kikiki7 2026-03-30 | 16/800 |
|
|
[考研] 083000環(huán)境科學(xué)與工程調(diào)劑,總分281 +4 | 橙子(勝意) 2026-03-30 | 4/200 |
|
|
[考研] 材料專碩 085600求調(diào)劑 +7 | BBQ233 2026-03-30 | 7/350 |
|
|
[考研] 0703 化學(xué) 求調(diào)劑,一志愿山東大學(xué) 342 分 +7 | Shern—- 2026-03-28 | 7/350 |
|
|
[考研] 340求調(diào)劑 +6 | Amber00 2026-03-26 | 6/300 |
|
|
[考研] 調(diào)劑考研 +3 | 王杰一 2026-03-29 | 3/150 |
|
|
[考研] 復(fù)試調(diào)劑 +3 | raojunqi0129 2026-03-28 | 3/150 |
|