| 2 | 1/1 | 返回列表 |
| 查看: 2242 | 回復(fù): 1 | ||
| 【懸賞金幣】回答本帖問題,作者矢志不渝……將贈送您 10 個金幣 | ||
矢志不渝……新蟲 (初入文壇)
|
[求助]
fluent udf message宏的使用問題 已有1人參與
|
|
|
程序如下,用于獲取并顯示計算域最小溫度,最大溫度和平均溫度(來源于udf manual文檔DEFINE_ON_DEMAND一節(jié)的示例) #include "udf.h" #include "math.h" #include "sg.h" DEFINE_ON_DEMAND(ex) { Domain *d; real tavg = 0.; real tmax = 0.; real tmin = 0.; real temp,volume,vol_tot; real i = 0; Thread *t; cell_t c; d = Get_Domain(1); thread_loop_c(t,d) { begin_c_loop(c,t) { volume = C_VOLUME(c,t); temp = C_T(c,t); if (temp < tmin || tmin == 0.) tmin = temp; if (temp > tmax || tmax == 0.) tmax = temp; vol_tot += volume; tavg += temp*volume; } end_c_loop(c,t) tavg /= vol_tot; i = i+1; Message0("\n Tmin = %g; Tmax = %g ;Tavg = %g; i= %g\n",tmin,tmax,tavg,i); } } 然而,在fluent中execute后,顯示結(jié)果如下: Tmin = 2589.32; Tmax = 3136.66; Tavg = 3057.71; i= 1 Tmin = 300; Tmax = 3136.66; Tavg = 3.70544e+07; i= 2 Tmin = 300; Tmax = 3136.6;6 Tavg = 4.45858e+11; i= 3 實際情況是,計算域最小溫度為300K,最高溫度應(yīng)該沒錯。也就是說,一次execute輸出了三行的錯誤信息,請問問題出在哪里? |
| 2 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 295求調(diào)劑 +6 | 等春來, 2026-03-04 | 6/300 |
|
|---|---|---|---|---|
|
[考研] 080500材料科學(xué)與工程 +6 | 202114020319 2026-03-03 | 6/300 |
|
|
[考研] 281求調(diào)劑 +3 | Y?l?h 2026-03-04 | 3/150 |
|
|
[考博] 26申博 +5 | north, 2026-02-28 | 5/250 |
|
|
[考研] 291求調(diào)劑 +3 | 咕嚕咕嚕123123 2026-03-02 | 4/200 |
|
|
[論文投稿]
EST拒稿重投
5+3
|
15102603076 2026-03-02 | 3/150 |
|
|
[考研] 接收調(diào)劑 +15 | 津萌津萌 2026-03-02 | 23/1150 |
|
|
[考研] 0703化學(xué) 學(xué)碩 理工科均可 不區(qū)分研究方向 總分279求調(diào)劑 +5 | 1一11 2026-03-03 | 5/250 |
|
|
[考研] 中國林科院林化所(南京)2026年招收化學(xué)/材料/環(huán)境工程等背景碩士研究生3名 +3 | realstar2006 2026-02-27 | 3/150 |
|
|
[考研] 化工專碩調(diào)劑 +4 | 利好利好. 2026-03-03 | 7/350 |
|
|
[考研] 276求調(diào)劑 +8 | 路lyh123 2026-02-28 | 10/500 |
|
|
[考研] 求調(diào)劑 +4 | Guo_yuxuan 2026-03-02 | 5/250 |
|
|
[考研] 環(huán)境工程專碩307 一志愿211 四六級已過 求調(diào)劑 +3 | ccc! 2026-03-03 | 3/150 |
|
|
[考研] 沒上岸的看過來 +3 | tangxiaotian 2026-03-01 | 3/150 |
|
|
[考研] 11408,學(xué)碩276求調(diào)劑 +3 | 崔wj 2026-03-02 | 5/250 |
|
|
[考研] 275求調(diào)劑 +7 | 明遠求學(xué) 2026-03-01 | 7/350 |
|
|
[考博] 博士自薦 +4 | kkluvs 2026-02-28 | 5/250 |
|
|
[考研] 材料085601調(diào)劑 +5 | 多多子. 2026-03-02 | 5/250 |
|
|
[基金申請] 成果系統(tǒng)訪問量大,請一小時后再嘗試。---NSFC啥時候好哦,已經(jīng)兩天這樣了 +4 | NSFC2026我來了 2026-02-28 | 4/200 |
|
|
[考研] 304求調(diào)劑 +3 | 52hz~~ 2026-02-28 | 5/250 |
|