| 6 | 1/1 | 返回列表 |
| 查看: 2257 | 回復: 5 | ||
[求助]
DPM宏命令Begin_particle_cell_loop(p,c,t)的使用問題 已有1人參與
|
|
各位同學 有沒有使用Fluent中 這個 begin_particle_cell_loop(p,c,t)宏呢,該宏出現(xiàn)在DEFINE_DPM_SPRAY_COLLIDE中,看幫助上的解釋,該宏應該是遍歷單元中所有的顆粒。我想用該宏求出單元中 顆粒的體積分數(shù),命令如下。 該命令在編譯中沒問題,計算時崩潰。我調(diào)試過多次,最后發(fā)現(xiàn) begin_particle_cell_loop(pi,c,t)不能再DEFINE_DPM_DRAG中使用,一旦使用,求解就沒辦法進行,我也嘗試在其他宏 如DEFINE_DPM_SCALE_UPDATA 和DEFINE_DPM_BODY_FORCE中調(diào)用均失敗。有沒有大牛使用過該宏,求指點迷津,被折磨了好久了。 DEFINE_DPM_DRAG(particle_drag_force,Re,p) { real dd,Vsum=0.0; cell_t c=P_CELL(p); Thread *t =P_CELL_THREAD(p); Particle *pi; begin_particle_cell_loop(pi,c,t) { Vsum+=M_PI*pow(P_DIAM(pi),3.0)/6.0; }end_particle_cell_loop(pi,c,t) C_UDMI(c,t,0)=Vsum/C_VOLUME(c,t); //求體相積分數(shù);// if(C_UDMI(c,t,0)>1) C_UDMI(c,t,0)=1.0; if(Dragsign==1) dd=Cdrag_force1(p,Re); else if(Dragsign==2) dd=Cdrag_force2(p,Re); else if(Dragsign==3) dd=Cdrag_force3(p,Re); else if(Dragsign==4) dd=Cdrag_force4(p,Re); else dd=Cdrag_force5(p,Re); return dd*pow(1-C_UDMI(c,t,0),5.0/3.0)/pow(1-C_UDMI(c,t,0),2.0); } |


膜拜大神。請問大神,你所說的particle bin如何創(chuàng)建,或者如何得到?在fluent UDF 手冊中關于這個宏我只發(fā)現(xiàn)在DEFINE_DPM_SPRAY_COLLIDE中存在,關于這個宏的介紹也是一筆帶過。大神,你能詳細說下,或則推薦個資料嗎,udf手冊中的介紹很不詳細,有很多都需要自己結合程序推出是什么意思 。。大神,我udf的目的是想遍歷每個流體單元中所有的氣泡,通過累加其體積然后求得氣相的體積分數(shù)。大神,你能推薦下簡單的方法嗎?不勝感激。。還有金幣奉上發(fā)自小木蟲Android客戶端 |

送紅花一朵 |
膜拜大神。請問大神,你所說的particle bin如何創(chuàng)建,或者如何得到?在fluent UDF 手冊中關于這個宏我只發(fā)現(xiàn)在DEFINE_DPM_SPRAY_COLLIDE中存在,關于這個宏的介紹也是一筆帶過。大神,你能詳細說下,或則推薦個資料嗎,udf手冊中的介紹很不詳細,有很多都需要自己結合程序推出是什么意思。。我udf的目的是想遍歷每個流體單元中所有的氣泡,通過累加其體積然后求得氣相的體積分數(shù)。大神,你能推薦下簡單的方法嗎?不勝感激。。還有金幣奉上 發(fā)自小木蟲Android客戶端 |

|
There is a loop available for looping over all the particles in a cell. But it does not work if used directly. Actually the array to bin the particles in the cell is not allocated by default. It has to be done before using this loop and then it will run ok. So, at the top of the routine, please put, Alloc_Storage_Vars(domain, SV_DPM_PARTICLE_BIN, SV_NULL); bin_particles_in_cells(domain); and at the botton, free up the memory with, Free_Storage_Vars(domain, SV_DPM_PARTICLE_BIN, SV_NULL); I am attaching my test UDF. It worked nicely for a simple 2d case in Linux. #include "udf.h" #include "surf.h" DEFINE_ON_DEMAND(cell) { Domain *d=Get_Domain(1); cell_t c; int id; Particle *p; Thread *c_thread=Lookup_Thread(d,2); /*In my case 2 was the id of the fluid thread. Please change this number accordingly */ Alloc_Storage_Vars(d, SV_DPM_PARTICLE_BIN, SV_NULL); bin_particles_in_cells(d); begin_c_loop(c, c_thread) { /* Message("Cell_index=%dn",c);*/ begin_particle_cell_loop(p,c,c_thread) { id=p->part_id; Message(" cell index=%d part_id=%d ",c,id); } end_particle_cell_loop(p,c,c_thread) } end_c_loop(c, c_thread) Free_Storage_Vars(d, SV_DPM_PARTICLE_BIN, SV_NULL); } |
| 6 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考博] 申博 +3 | 添菜了哈 2026-03-04 | 4/200 |
|
|---|---|---|---|---|
|
[考研] 一志愿西交化工專碩288專業(yè)課93求調(diào)劑 +6 | 好運好運接接 2026-03-04 | 6/300 |
|
|
[考研] 求調(diào)劑院校 +6 | 云朵452 2026-03-02 | 12/600 |
|
|
[考研] 293求調(diào)劑 +3 | 是樂渝哇 2026-03-04 | 3/150 |
|
|
[考研] 一志愿985材料與化工 326分求調(diào)劑 +3 | Hz795795 2026-03-04 | 3/150 |
|
|
[考研] 能動297求調(diào)劑,本科川大 +4 | 邵11 2026-03-04 | 4/200 |
|
|
[考研] 085600求調(diào)劑 +4 | LRZZZZZZ 2026-03-02 | 6/300 |
|
|
[基金申請] 請問大家,研究風險與應對措施那里, 大家都怎么寫呢 ? +3 | cauasen 2026-03-02 | 3/150 |
|
|
[考研] 283求調(diào)劑 +9 | 鹿沫笙 2026-03-02 | 9/450 |
|
|
[考研] 材料工程求調(diào)劑 +3 | 1431251 2026-03-03 | 3/150 |
|
|
[考研] 清華大學 材料與化工 353分求調(diào)劑 +5 | awaystay 2026-03-02 | 6/300 |
|
|
[考研]
|
好好好1233 2026-02-28 | 16/800 |
|
|
[考研] 298求調(diào)劑 +10 | 人間唯你是清歡 2026-02-28 | 14/700 |
|
|
[考研] 0856材料調(diào)劑 +5 | 沿岸有貝殼OUC 2026-03-02 | 5/250 |
|
|
[考研] 285求調(diào)劑 +9 | 滿頭大汗的學生 2026-02-28 | 9/450 |
|
|
[考研] 0856化工專碩求調(diào)劑 +15 | 董boxing 2026-03-01 | 15/750 |
|
|
[考研] 265分求調(diào)劑不調(diào)專業(yè)和學校有行學上就 +6 | 禮堂丁真258 2026-02-28 | 9/450 |
|
|
[考研] 化工專碩342,一志愿大連理工大學,求調(diào)劑 +6 | kyf化工 2026-02-28 | 7/350 |
|
|
[基金申請] 成果系統(tǒng)訪問量大,請一小時后再嘗試。---NSFC啥時候好哦,已經(jīng)兩天這樣了 +4 | NSFC2026我來了 2026-02-28 | 4/200 |
|
|
[基金申請]
剛錄用,沒有期刊號,但是在線可看的論文可以放為代表作嗎
10+3
|
arang1 2026-03-01 | 3/150 |
|