| 6 | 1/1 | 返回列表 |
| 查看: 1075 | 回復(fù): 5 | |||
[交流]
udf小程序的求助 已有5人參與
|
|
#include"udf.h" #include"mem.h" #define p_pretotal 350000 #define pcr 185000 #define R 287.06 #define k 1.4 #define T 300 DEFINE_ADJUST(on_demamd_avg,d) { real p_sum = 0; real p; real v = 0; real r = 0,tem; real V; real xc[ND_ND]; Thread *t; face_t f; Domain *d; d = Get_Domain(1); /*獲取液態(tài)區(qū)域的網(wǎng)格 */ t=Lookup_Thread(d,12);/* 找到出口截面的線指針(ID在fluent中的phase找的) */ /* 單元循環(huán) */ begin_f_loop(f,t) { F_CENTROID(xc,f,t); /* 將網(wǎng)格坐標(biāo)存入數(shù)組xc中 */ p_sum = F_P(f, t); if(p_sum<=p_pretotal) { if(p_sum>=pcr) { F_U(f,t)=sqrt((2*k*R*T/(k-1))*pow((1-(p_sum/p_pretotal)),(k-1)/k)); } else F_U(f,t)=sqrt(k*R*T*pow((p_sum/p_pretotal),(k-1)/k)); } else F_U(f,t)=0; } end_f_loop(f,t); } 求高人指點(diǎn)一下udf 啊 主要功能就是獲取某個(gè)區(qū)域網(wǎng)格上的壓力,通過壓力的比較得到相應(yīng)的速度表達(dá)式 |
新蟲 (小有名氣)
|
adjust 函數(shù)中的數(shù)字不能直接寫成整數(shù),應(yīng)該寫成0.0,1.0…… 發(fā)自小木蟲Android客戶端 |

新蟲 (初入文壇)
金蟲 (職業(yè)作家)
捐助貴賓 (小有名氣)
|
Domain *d Pointer to the domain over which the adjust function is to be applied. The domain argument provides access to all cell and face threads in the mesh. For multiphase flows, the pointer that is passed to the function by the solver is the mixture-level domain. 上面是FLuent幫助,這個(gè)d指向的是mixture-level domain,你的程序里面又將液態(tài)的賦給d,這個(gè)不對吧,你再好好看看多相流的udf幫助。我沒編過DEFINE_ADJUST,就當(dāng)是提個(gè)醒,可能也不太對 |

| 6 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 315分求調(diào)劑 +7 | 26考研上岸版26 2026-03-26 | 7/350 |
|
|---|---|---|---|---|
|
[考研] 295求調(diào)劑 +5 | 1428151015 2026-03-27 | 6/300 |
|
|
[考研] 295材料工程專碩求調(diào)劑 +6 | 1428151015 2026-03-27 | 6/300 |
|
|
[考研] 一志愿南師大0703化學(xué) 275求調(diào)劑 +4 | Ripcord上岸 2026-03-27 | 4/200 |
|
|
[考研] 348求調(diào)劑 +4 | 小懶蟲不懶了 2026-03-27 | 5/250 |
|
|
[考研] 316求調(diào)劑 +5 | Pigcasso 2026-03-24 | 5/250 |
|
|
[考研] 336材料求調(diào)劑 +7 | 陳瀅瑩 2026-03-26 | 9/450 |
|
|
[考研] 求調(diào)劑 +8 | Auroracx 2026-03-22 | 8/400 |
|
|
[考研]
|
平樂樂樂 2026-03-26 | 4/200 |
|
|
[考研] 材料考研求調(diào)劑 +3 | Dendel 2026-03-23 | 6/300 |
|
|
[考研]
|
WWW西西弗斯 2026-03-24 | 8/400 |
|
|
[考研] 297求調(diào)劑 +6 | 田洪有 2026-03-26 | 6/300 |
|
|
[考研] 085600 材料與化工 329分求調(diào)劑 +9 | Mr. Z 2026-03-25 | 9/450 |
|
|
[考研] 考研一志愿蘇州大學(xué)初始315(英一)求調(diào)劑 +3 | sbdksD 2026-03-24 | 4/200 |
|
|
[考研] 285求調(diào)劑 +3 | AZMK 2026-03-24 | 3/150 |
|
|
[考研] 300分,材料,求調(diào)劑,英一數(shù)二 +5 | 超贊的 2026-03-24 | 5/250 |
|
|
[考研]
|
黃粱一夢千年 2026-03-24 | 3/150 |
|
|
[考研] 277分求調(diào)劑,跨調(diào)材料 +3 | 考研調(diào)劑lxh 2026-03-24 | 3/150 |
|
|
[考研] 336化工調(diào)劑 +4 | 王大坦1 2026-03-23 | 5/250 |
|
|
[考研] 275求調(diào)劑 +6 | shansx 2026-03-22 | 8/400 |
|