| 查看: 1415 | 回復: 11 | ||
[求助]
UDF加載到Fluent中出現錯誤,希望各位蟲友們幫忙分析一下 已有3人參與
|
||
|
這是我編寫的一個二維邊界,y方向的速度是時間的余弦函數。 #include "udf.h" DEFINE_PROFILE(wallz_y_velocity, thread, index) { real x[ND_ND]; real y; real t=RP_Get_Real("flow-time" ;cell_t c; Thread*c_thread; begin_c_loop(c,c_thread) { y=x[1]; C_PROFILE(c,thread,index)=0.77*cos(15.708*t); } end_c_loop(c,c_thread) } 加載到Fluent中出現錯誤,大家?guī)臀曳治鲆幌拢恢x謝了! 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: () |
木蟲 (正式寫手)
|
#include "udf.h" DEFINE_PROFILE(inlet_pressure, thread, position) { real t,p; face_t f; begin_f_loop(f, thread) { t=RP_Get_Real("flow-time" ;if (t>0 && t<=0.001) { p=1000000000*t+100; } if (t>0.001&&t<=0.003) { p=1000000+100; } if(t>=0.003&&t<=0.004) { p=1000000000*(0.004-t)+100; } else if(t>0.004) { p=100; } { F_PROFILE(f,thread,position)=p; } end_f_loop(f,thread) } } 這是我之前做二維模擬時用到的壓力入口邊界條件的UDF。親測可用。 |
木蟲 (正式寫手)
木蟲 (正式寫手)
木蟲 (正式寫手)
|
上貼中少加入的一句后少了“;”。你也可以試試下面這個: #include "udf.h" DEFINE_PROFILE(wallz_y_velocity, thread, index) { real x[ND_ND]; real y; real t=RP_Get_Real("flow-time" ;face_t f; begin_f_loop(f,thread) { F_CENTROID(x,f,thread) y=x[1]; F_PROFILE(f,thread,index)=0.77*cos(15.708*t); } end_f_loop(f,thread) } |
木蟲 (正式寫手)

| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 295求調劑 +4 | wei-5 2026-03-26 | 4/200 |
|
|---|---|---|---|---|
|
[考研] 22408 359分調劑 +4 | Qshers 2026-03-27 | 5/250 |
|
|
[考研] 315求調劑 +4 | akie... 2026-03-28 | 5/250 |
|
|
[考研] 275求調劑 +10 | Micky11223 2026-03-25 | 14/700 |
|
|
[考研] 0856求調劑 +11 | zhn03 2026-03-25 | 12/600 |
|
|
[考研] 277跪求調劑 +5 | 1915668 2026-03-27 | 9/450 |
|
|
[考研] 295求調劑 +5 | 1428151015 2026-03-27 | 6/300 |
|
|
[考研] 266分求材料化工冶金礦業(yè)等專業(yè)的調劑 +4 | 哇呼哼呼哼 2026-03-26 | 4/200 |
|
|
[考研] 一志愿北京化工大學 070300 學碩 336分 求調劑 +9 | vv迷 2026-03-22 | 9/450 |
|
|
[考研] 274求調劑 +17 | 顧九笙要謙虛 2026-03-24 | 23/1150 |
|
|
[考研] 348求調劑 +4 | 小懶蟲不懶了 2026-03-27 | 5/250 |
|
|
[考研] 276求調劑。有半年電池和半年高分子實習經歷 +10 | 材料學257求調劑 2026-03-23 | 11/550 |
|
|
[考研] 調劑求收留 +7 | 果然有我 2026-03-26 | 7/350 |
|
|
[考研] 336材料求調劑 +7 | 陳瀅瑩 2026-03-26 | 9/450 |
|
|
[考研] 07化學303求調劑 +5 | 睿08 2026-03-25 | 5/250 |
|
|
[考研] 材料與化工304求B區(qū)調劑 +3 | 邱gl 2026-03-25 | 3/150 |
|
|
[考研] 求b區(qū)院校調劑 +4 | 周56 2026-03-24 | 5/250 |
|
|
[考研] 一志愿武理085500機械專業(yè)總分300求調劑 +3 | an10101 2026-03-24 | 7/350 |
|
|
[考博] 26申博自薦 +3 | whh869393 2026-03-24 | 3/150 |
|
|
[考研] 328求調劑 +4 | LHHL66 2026-03-23 | 4/200 |
|