| 6 | 1/1 | 返回列表 |
| 查看: 2269 | 回復: 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 手冊中關(guān)于這個宏我只發(fā)現(xiàn)在DEFINE_DPM_SPRAY_COLLIDE中存在,關(guān)于這個宏的介紹也是一筆帶過。大神,你能詳細說下,或則推薦個資料嗎,udf手冊中的介紹很不詳細,有很多都需要自己結(jié)合程序推出是什么意思 。。大神,我udf的目的是想遍歷每個流體單元中所有的氣泡,通過累加其體積然后求得氣相的體積分數(shù)。大神,你能推薦下簡單的方法嗎?不勝感激。。還有金幣奉上發(fā)自小木蟲Android客戶端 |

送紅花一朵 |
膜拜大神。請問大神,你所說的particle bin如何創(chuàng)建,或者如何得到?在fluent UDF 手冊中關(guān)于這個宏我只發(fā)現(xiàn)在DEFINE_DPM_SPRAY_COLLIDE中存在,關(guān)于這個宏的介紹也是一筆帶過。大神,你能詳細說下,或則推薦個資料嗎,udf手冊中的介紹很不詳細,有很多都需要自己結(jié)合程序推出是什么意思。。我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ā)表 | |
|---|---|---|---|---|
|
[考研] 考研求調(diào)劑,工科,總分304 +3 | 矮子不想長高了 2026-03-08 | 4/200 |
|
|---|---|---|---|---|
|
[考研] 【求調(diào)劑】293分環(huán)境工程求調(diào)劑材料/化工,服從調(diào)劑,抗壓能力強! +11 | xiiiia 2026-03-04 | 11/550 |
|
|
[考研] 22408 275分求調(diào)劑 +3 | 宇智波比 2026-03-03 | 4/200 |
|
|
[考研] 085701環(huán)境工程專業(yè),初試305,均過國家A區(qū)線 +7 | 卡卡來了@ 2026-03-07 | 8/400 |
|
|
[基金申請]
|
xhuama 2026-03-02 | 19/950 |
|
|
[考研] 306求調(diào)劑 +7 | Bahati 2026-03-05 | 7/350 |
|
|
[考研] 273求調(diào)劑 +5 | 星星111222 2026-03-02 | 7/350 |
|
|
[考研] 085602高分子方向求調(diào)劑 +7 | tlgudy 2026-03-04 | 7/350 |
|
|
[考研] 332材料求調(diào)劑 +6 | zjy101327 2026-03-05 | 7/350 |
|
|
[考研] 334求調(diào)劑 +3 | Trying] 2026-03-03 | 4/200 |
|
|
[考研] 紡織、生物、化學、材料等專業(yè) +3 | Eember. 2026-03-05 | 7/350 |
|
|
[考研] 一志愿西交化工專碩288專業(yè)課93求調(diào)劑 +6 | 好運好運接接 2026-03-04 | 6/300 |
|
|
[考研] 化學 0703求調(diào)劑 總分293 一志愿211 +9 | 土土小蟲 2026-03-03 | 11/550 |
|
|
[考研] 環(huán)境調(diào)劑 +7 | 柒槿levana 2026-03-01 | 7/350 |
|
|
[考研]
|
旅行中的紫葡萄 2026-03-03 | 4/200 |
|
|
[考研] 306求調(diào)劑 +7 | 張張張張oo 2026-03-03 | 7/350 |
|
|
[考研] 0856材料工程,初試313調(diào)劑 +7 | 賣個關(guān)子吧 2026-03-03 | 7/350 |
|
|
[考研]
材料270求調(diào)劑
6+6
|
Eiiiio 2026-03-01 | 11/550 |
|
|
[論文投稿]
通訊作者寫誰,問題是你意想不到的問題
15+3
|
阿爾法啊 2026-03-01 | 3/150 |
|
|
[考研] 一志愿山東大學材料與化工325求調(diào)劑 +5 | 半截的詩0927 2026-03-02 | 5/250 |
|