| 6 | 1/1 | 返回列表 |
| 查看: 1556 | 回復: 5 | |||
[求助]
UDF大俠請進,想定義一個表達式儲存到UDM中,用云圖顯示? 已有2人參與
|
|
程序用兩塊,第一塊求最大、最小速度,這一塊沒問題;第二塊是想把一個變量儲存到UDM中顯示,我先把C_UDMI(c,t,0) = C_U(c,t)是可以顯示出云圖的,可是 C_UDMI(c,t,0)=C_DUDX(c,t) * C_DVDY(c,t) - C_DVDX(c,t) * C_DUDY(c,t)存儲到UDM中進行云圖顯示,值都是0,請指教?C_DUDX(c,t)使用“mem.h”頭文件聲明嗎?該如何使用?完整的程序如下: #include "udf.h" #include "mem.h" DEFINE_ON_DEMAND(on_demand_calc) { Domain *d; /* declare domain pointer since it is not passed as an argument to the DEFINE macro */ real uavg = 0.; real umax = 0.; real umin = 0.; real temp,volume,vol_tot; Thread *t; cell_t c; d = Get_Domain(1); /* Get the domain using ANSYS Fluent utility */ /* Loop over all cell threads in the domain */ thread_loop_c(t,d) { begin_c_loop(c,t) { volume = C_VOLUME(c,t); /* get cell volume */ temp = C_U(c,t); /* get cell temperature */ if (temp < umin || umin == 0.) umin = temp; if (temp > umax || umax == 0.) umax = temp; vol_tot += volume; uavg += temp*volume; } end_c_loop(c,t) uavg /= vol_tot; printf("\n Umin = %g Umax = %g Uavg = %g\n",umin,umax,uavg); /* Compute user's function and store in user-defined memory*/ /*(location index 0) */ begin_c_loop(c,t) { C_UDMI(c,t,0) = C_DUDX(c,t) * C_DVDY(c,t) - C_DVDX(c,t) * C_DUDY(c,t); } end_c_loop(c,t) } } |
用戶注銷 (小有名氣)
專家顧問 (正式寫手)
![]() |
專家經(jīng)驗: +181 |

| 6 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 286求調(diào)劑 +6 | lemonzzn 2026-03-16 | 9/450 |
|
|---|---|---|---|---|
|
[考研] 0703化學調(diào)劑 ,六級已過,有科研經(jīng)歷 +10 | 曦熙兮 2026-03-15 | 10/500 |
|
|
[考研] 299求調(diào)劑 +5 | △小透明* 2026-03-17 | 5/250 |
|
|
[考研] 280求調(diào)劑 +6 | 咕嚕曉曉 2026-03-18 | 7/350 |
|
|
[考研] 307求調(diào)劑 +3 | 冷笙123 2026-03-17 | 3/150 |
|
|
[考研] 301求調(diào)劑 +9 | yy要上岸呀 2026-03-17 | 9/450 |
|
|
[考研] 材料與化工求調(diào)劑 +6 | 為學666 2026-03-16 | 6/300 |
|
|
[考研] 一志愿南京大學,080500材料科學與工程,調(diào)劑 +4 | Jy? 2026-03-16 | 4/200 |
|
|
[考研] 275求調(diào)劑 +4 | 太陽花天天開心 2026-03-16 | 4/200 |
|
|
[考研] 302求調(diào)劑 +4 | 小賈同學123 2026-03-15 | 8/400 |
|
|
[考研] 278求調(diào)劑 +3 | Yy7400 2026-03-13 | 3/150 |
|
|
[考研] 283求調(diào)劑 +3 | 聽風就是雨; 2026-03-16 | 3/150 |
|
|
[考研] [導師推薦]西南科技大學國防/材料導師推薦 +3 | 尖角小荷 2026-03-16 | 6/300 |
|
|
[基金申請]
今年的國基金是打分制嗎?
50+3
|
zhanghaozhu 2026-03-14 | 3/150 |
|
|
[考博] 東華理工大學化材專業(yè)26屆碩士博士申請 +6 | zlingli 2026-03-13 | 6/300 |
|
|
[考研] [0860]321分求調(diào)劑,ab區(qū)皆可 +4 | 寶貴熱 2026-03-13 | 4/200 |
|
|
[考研] 329求調(diào)劑 +3 | miaodesi 2026-03-12 | 4/200 |
|
|
[考研] 工科材料085601 279求調(diào)劑 +8 | 困于星晨 2026-03-12 | 10/500 |
|
|
[考研] 328化工專碩求調(diào)劑 +4 | 。,。,。,。i 2026-03-12 | 4/200 |
|
|
[考研] 一志愿山大07化學 332分 四六級已過 本科山東雙非 求調(diào)劑! +3 | 不想理你 2026-03-12 | 3/150 |
|