| 6 | 1/1 | 返回列表 |
| 查看: 1562 | 回復: 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 | 返回列表 |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
|
百度網(wǎng)盤 |
360云盤 |
千易網(wǎng)盤 |
華為網(wǎng)盤
在新窗口頁面中打開自己喜歡的網(wǎng)盤網(wǎng)站,將文件上傳后,然后將下載鏈接復制到帖子內(nèi)容中就可以了。 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 求調(diào)劑 +3 | 暗涌afhb 2026-03-16 | 3/150 |
|
|---|---|---|---|---|
|
[考研] 一志愿中國海洋大學,生物學,301分,求調(diào)劑 +5 | 1孫悟空 2026-03-17 | 6/300 |
|
|
[考研] 081700化工學碩調(diào)劑 +3 | 【1】 2026-03-16 | 3/150 |
|
|
[考研] 一志愿武漢理工材料工程專碩調(diào)劑 +5 | Doleres 2026-03-19 | 5/250 |
|
|
[考研] 一志愿南京理工大學085701資源與環(huán)境302分求調(diào)劑 +3 | 葵梓衛(wèi)隊 2026-03-18 | 5/250 |
|
|
[考研] 復試調(diào)劑 +4 | z1z2z3879 2026-03-14 | 6/300 |
|
|
[考研] 一志愿 西北大學 ,070300化學學碩,總分287,雙非一本,求調(diào)劑。 +3 | 晨昏線與星海 2026-03-19 | 3/150 |
|
|
[考研] 085600材料與化工求調(diào)劑 +6 | 緒幸與子 2026-03-17 | 6/300 |
|
|
[考研] 274求調(diào)劑 +6 | S.H1 2026-03-18 | 6/300 |
|
|
[考研] 312求調(diào)劑 +8 | 陌宸希 2026-03-16 | 9/450 |
|
|
[考研] 工科材料085601 279求調(diào)劑 +6 | 困于星晨 2026-03-17 | 6/300 |
|
|
[基金申請] 被我言中:新模板不強調(diào)格式了,假專家開始管格式了 +4 | beefly 2026-03-14 | 4/200 |
|
|
[考研] 277調(diào)劑 +5 | 自由煎餅果子 2026-03-16 | 6/300 |
|
|
[碩博家園] 湖北工業(yè)大學 生命科學與健康學院-課題組招收2026級食品/生物方向碩士 +3 | 1喜春8 2026-03-17 | 5/250 |
|
|
[考博] 26申博 +4 | 八6八68 2026-03-16 | 4/200 |
|
|
[考研] 一志愿南京大學,080500材料科學與工程,調(diào)劑 +4 | Jy? 2026-03-16 | 4/200 |
|
|
[考研] 326求調(diào)劑 +4 | 諾貝爾化學獎覬?/a> 2026-03-15 | 7/350 |
|
|
[考研] 304求調(diào)劑 +3 | 曼殊2266 2026-03-14 | 3/150 |
|
|
[考研] 26考研一志愿中國石油大學(華東)305分求調(diào)劑 +3 | 嘉年新程 2026-03-15 | 3/150 |
|
|
[考研] 311求調(diào)劑 +3 | 冬十三 2026-03-13 | 3/150 |
|