| 5 | 1/1 | 返回列表 |
| 查看: 3584 | 回復: 11 | ||
| 當前只顯示滿足指定條件的回帖,點擊這里查看本話題的所有回帖 | ||
leixiaobo713銀蟲 (正式寫手)
|
[求助]
fluent中UDF編譯的問題!
|
|
|
本人想編的程序是這樣的: 材料是有初始溫度的,而且初始溫度為X(X軸坐標)的函數;模擬開始后,在很短時間內材料的溫度將發(fā)生變化,變化的溫度為初始溫度的函數,在一定時間后(上面提到的很短時間),材料的溫度僅隨流體的流動而自然發(fā)生變化,沒有再生熱源。我變得程序是這樣的,雖然能編譯,但是模擬一開始就出現錯誤,請高手指點,本人是小白,謝謝! #include "udf.h" DEFINE_PROFILE(unsteady_temperature,thread,position) { real t, temperature; face_t f; real x; begin_f_loop(f,thread) { t=RP_Get_Real("flow-time" ;if(t<=0.000000001) {temperature=325.0-0.115*x; F_PROFILE(f,thread,position) =temperature+(297.68625-7.37218/(1+exp((temperature-299.65187)/7.97379))); } else F_PROFILE(f,thread,position) =temperature; } end_f_loop(f,thread); } 模擬出現的錯誤提示: Updating solution at time level N... done. iter continuity x-velocity y-velocity energy time/iter chip-exec: unsteady_temperature: wrong return type: float udf function expectedchip-exec: unsteady_temperature: argument 1: incorrect type (36): int expectedchip-exec: unsteady_temperature: argument 2: incorrect type (5): pointer expected 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: () |


木蟲 (正式寫手)
| 是不是溫度沒有賦初值?如果t<=0.000000001條件達不到temperature等于多少呢??還有,即使?jié)M足t<=0.000000001,那么x值為多少?x不知道的話,溫度也確定不了了啊 |
銀蟲 (正式寫手)

銀蟲 (正式寫手)
|
#include "udf.h" DEFINE_PROFILE(unsteady_temperature,thread,position) { real t, temperature=298.0; face_t f; real x[ND_ND]; F_CENTROID(x,f,thread); begin_f_loop(f,thread) { t=RP_Get_Real("flow-time" ; if(t>0&&t<=0.1) F_PROFILE(f,thread,position)=temperature; else if(t>=0.1&&t<0.4) { temperature=298.0+5*x[1]; F_PROFILE(f,thread,position) =temperature+(297.68625-7.37218/(1+exp((temperature-299.65187)/7.97379))); } else { temperature=F_PROFILE(f,thread,position); F_PROFILE(f,thread,position) =temperature; } } end_f_loop(f,thread); } 我改成這樣,還是上面的問題啊,請指教! 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ā)表 | |
|---|---|---|---|---|
|
[考研] 0856材料專碩353求調劑 +3 | NIFFFfff 2026-03-20 | 3/150 |
|
|---|---|---|---|---|
|
[考研] 材料 271求調劑 +3 | 展信悅_ 2026-03-21 | 3/150 |
|
|
[考研] 310求調劑 +3 | baibai1314 2026-03-16 | 3/150 |
|
|
[考研] 303求調劑 +5 | 睿08 2026-03-17 | 7/350 |
|
|
[考研] 265求調劑 +9 | 梁梁校校 2026-03-17 | 9/450 |
|
|
[考研] 一志愿西南交大,求調劑 +5 | 材化逐夢人 2026-03-18 | 5/250 |
|
|
[考研] 22408 344分 求調劑 一志愿 華電計算機技術 +4 | solanXXX 2026-03-20 | 4/200 |
|
|
[考研] 304求調劑 +7 | 司空. 2026-03-18 | 7/350 |
|
|
[考研] 一志愿蘇州大學材料求調劑,總分315(英一) +5 | sbdksD 2026-03-19 | 5/250 |
|
|
[考研] 一志愿華中農業(yè)071010,總分320求調劑 +3 | 困困困困坤坤 2026-03-20 | 3/150 |
|
|
[考研] 298-一志愿中國農業(yè)大學-求調劑 +9 | 手機用戶 2026-03-17 | 9/450 |
|
|
[論文投稿]
申請回稿延期一個月,編輯同意了。但系統(tǒng)上的時間沒變,給編輯又寫郵件了,沒回復
10+3
|
wangf9518 2026-03-17 | 4/200 |
|
|
[考研] 一志愿中國海洋大學,生物學,301分,求調劑 +5 | 1孫悟空 2026-03-17 | 6/300 |
|
|
[考研] 288求調劑,一志愿華南理工大學071005 +5 | ioodiiij 2026-03-17 | 5/250 |
|
|
[考研] 0854可跨調劑,一作一項核心論文五項專利,省、國級證書40+數一英一287 +8 | 小李0854 2026-03-16 | 8/400 |
|
|
[考研]
|
zhouzhen654 2026-03-16 | 3/150 |
|
|
[考研] 318求調劑 +3 | Yanyali 2026-03-15 | 3/150 |
|
|
[考研] 304求調劑 +3 | 曼殊2266 2026-03-14 | 3/150 |
|
|
[考研] 070303 總分349求調劑 +3 | LJY9966 2026-03-15 | 5/250 |
|
|
[考研] 085601材料工程315分求調劑 +3 | yang_0104 2026-03-15 | 3/150 |
|