| 24小時(shí)熱門(mén)版塊排行榜 |
| 查看: 4263 | 回復(fù): 11 | ||||
塵積銀蟲(chóng) (小有名氣)
|
[交流]
【求助】fluent計(jì)算中,udf編譯通過(guò),初始化出錯(cuò) 已有2人參與
|
|||
|
麻煩達(dá)人老兄們救急,這個(gè)程序是用來(lái)定義出口處的壓力的,編譯成功,但是在邊界條件里選中此UDF后,在初始化時(shí)報(bào)錯(cuò),不知是何緣故,請(qǐng)各位不吝賜教,拜謝! 程序?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 |
金蟲(chóng) (正式寫(xiě)手)
Dr.

銅蟲(chóng) (小有名氣)
銀蟲(chóng) (小有名氣)
|
試了一下編輯可以通過(guò):程序應(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) } |
新蟲(chóng) (初入文壇)
|
我也遇到了這情況啊!lz大哥你就絕了沒(méi)有,我是自定義的密度和粘度,編譯沒(méi)問(wèn)題,初始化通不過(guò),附上我的程序,求指導(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: () |
銀蟲(chóng) (正式寫(xiě)手)

金蟲(chóng) (初入文壇)
金蟲(chóng) (初入文壇)
專家顧問(wèn) (著名寫(xiě)手)
![]() |
專家經(jīng)驗(yàn): +60 |
新蟲(chóng) (初入文壇)
|
我也遇到了一樣的問(wèn)題,我要把回水口的溫度加上2℃,然后賦值給入口。程序如下: #include "udf.h" DEFINE_PROFILE(inlet_t_1, inlet, index) { Domain *d=Get_Domain(1); Thread *out = Lookup_Thread(d, 18); face_t face; real t_out=0.0, area_out=0.0; real NV_VEC(area); begin_f_loop(face, out) { F_AREA(area, face, out); t_out += F_T(face, out)*NV_MAG(area); area_out += NV_MAG(area); } end_f_loop(face, out) t_out = t_out/area_out+2.0; begin_f_loop(face, inlet) { F_PROFILE(face, inlet, index) = t_out; } end_f_loop(face, inlet) } 然后設(shè)置邊界條件的時(shí)候選中這個(gè)udf,就出現(xiàn)跟樓主一樣的error,你是怎么解決的啊 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 085601一志愿中山大學(xué)深圳材料工程330求調(diào)劑 +8 | pipiver 2026-03-30 | 8/400 |
|
|---|---|---|---|---|
|
[考研] 求調(diào)劑!生物與醫(yī)藥專碩 +4 | 逆轉(zhuǎn)陸先生 2026-04-01 | 4/200 |
|
|
[考研] 材料考研調(diào)劑 +9 | Gs大王 2026-04-02 | 9/450 |
|
|
[考研] 材料調(diào)劑 +12 | 一樣YWY 2026-04-01 | 12/600 |
|
|
[考研] 302求調(diào)劑一志愿北航070300,本科鄭大化學(xué) +8 | 圣日耳曼條 2026-04-01 | 11/550 |
|
|
[考研] 284求調(diào)劑 +12 | 小熊~~ 2026-03-31 | 12/600 |
|
|
[考研] 材料科學(xué)與工程339求調(diào)劑 +11 | hyz0119 2026-03-31 | 12/600 |
|
|
[考研] 291求調(diào)劑 +3 | 迷蒙木木 2026-04-01 | 4/200 |
|
|
[考研] 322求調(diào)劑 +8 | 三水sss 2026-04-01 | 8/400 |
|
|
[考研] 環(huán)境工程 085701,267求調(diào)劑 +15 | minht 2026-03-29 | 16/800 |
|
|
[考研] 0856求調(diào)劑 +9 | 楒桉 2026-03-28 | 9/450 |
|
|
[考研] 322求調(diào)劑:一志愿湖南大學(xué) 材料與化工(085600),已過(guò)六級(jí)。 +10 | XX小鄧 2026-03-29 | 10/500 |
|
|
[考研]
|
小羊36 2026-03-30 | 4/200 |
|
|
[考研] 085601 329分調(diào)劑 +6 | yzsa12 2026-03-31 | 6/300 |
|
|
[考研] 081200-11408-276學(xué)碩求調(diào)劑 +4 | 崔wj 2026-03-31 | 4/200 |
|
|
[考研] 08工科求調(diào)劑286 +5 | tgs_001 2026-03-28 | 5/250 |
|
|
[考研] 085701環(huán)境工程求調(diào)劑 +11 | 多久上課 2026-03-27 | 12/600 |
|
|
[考研] 295求調(diào)劑 +5 | wei-5 2026-03-26 | 5/250 |
|
|
[考研] 11408軟件工程求調(diào)劑 +3 | Qiu學(xué)ing 2026-03-28 | 3/150 |
|
|
[考研] 求調(diào)劑 +7 | 爭(zhēng)取九點(diǎn)睡 2026-03-28 | 8/400 |
|