| 6 | 1/1 | 返回列表 |
| 查看: 1078 | 回復: 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ū)域的網格 */ t=Lookup_Thread(d,12);/* 找到出口截面的線指針(ID在fluent中的phase找的) */ /* 單元循環(huán) */ begin_f_loop(f,t) { F_CENTROID(xc,f,t); /* 將網格坐標存入數(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); } 求高人指點一下udf 啊 主要功能就是獲取某個區(qū)域網格上的壓力,通過壓力的比較得到相應的速度表達式 |
新蟲 (小有名氣)

金蟲 (職業(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幫助,這個d指向的是mixture-level domain,你的程序里面又將液態(tài)的賦給d,這個不對吧,你再好好看看多相流的udf幫助。我沒編過DEFINE_ADJUST,就當是提個醒,可能也不太對 |

| 6 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 一志愿中南大學化學0703總分337求調劑 +4 | niko- 2026-03-27 | 4/200 |
|
|---|---|---|---|---|
|
[考研] 材料求調劑 一志愿哈工大總分298分,前三科223分 +5 | dongfang59 2026-03-27 | 5/250 |
|
|
[考研] 291求調劑 +13 | hhhhxn.. 2026-03-23 | 19/950 |
|
|
[考研] 286求調劑 +3 | 丟掉懶惰 2026-03-27 | 6/300 |
|
|
[考研] 339求調劑 +4 | 烤麥芽 2026-03-27 | 5/250 |
|
|
[考研] 329求調劑 +4 | 星野? 2026-03-26 | 4/200 |
|
|
[考研] 298調劑 +3 | jiyingjie123 2026-03-27 | 3/150 |
|
|
[考研] 考研調劑 +9 | 小蠟新筆 2026-03-26 | 9/450 |
|
|
[考研] 081200-11408-276學碩求調劑 +4 | 崔wj 2026-03-26 | 4/200 |
|
|
[考研] 一志愿211 初試270分 求調劑 +6 | 谷雨上岸 2026-03-23 | 7/350 |
|
|
[考研] 材料與化工304求B區(qū)調劑 +3 | 邱gl 2026-03-26 | 6/300 |
|
|
[考研]
|
WWW西西弗斯 2026-03-24 | 8/400 |
|
|
[考研] 263求調劑 +6 | yqdszhdap- 2026-03-22 | 10/500 |
|
|
[考研] 化學調劑一志愿上海交通大學336分-本科上海211 +4 | 小魚愛有機 2026-03-25 | 4/200 |
|
|
[考研] 299求調劑 +4 | 15188958825 2026-03-25 | 4/200 |
|
|
[考研] 一志愿南航 335分 | 0856材料化工 | GPA 4.07 | 有科研經歷 +6 | cccchenso 2026-03-23 | 6/300 |
|
|
[考研] 086003食品工程求調劑 +6 | 淼淼111 2026-03-24 | 6/300 |
|
|
[考研] 材料專碩331求調劑 +4 | 鮮當牛 2026-03-24 | 4/200 |
|
|
[考研] 環(huán)境學碩288求調劑 +8 | 皮皮皮123456 2026-03-22 | 8/400 |
|
|
[考研] 333求調劑 +3 | ALULU4408 2026-03-23 | 3/150 |
|