| 5 | 1/1 | 返回列表 |
| 查看: 2273 | 回復(fù): 5 | |||
| 當(dāng)前只顯示滿足指定條件的回帖,點(diǎn)擊這里查看本話題的所有回帖 | |||
[求助]
DPM宏命令Begin_particle_cell_loop(p,c,t)的使用問(wèn)題 已有1人參與
|
|||
|
各位同學(xué) 有沒(méi)有使用Fluent中 這個(gè) begin_particle_cell_loop(p,c,t)宏呢,該宏出現(xiàn)在DEFINE_DPM_SPRAY_COLLIDE中,看幫助上的解釋?zhuān)摵陸?yīng)該是遍歷單元中所有的顆粒。我想用該宏求出單元中 顆粒的體積分?jǐn)?shù),命令如下。 該命令在編譯中沒(méi)問(wèn)題,計(jì)算時(shí)崩潰。我調(diào)試過(guò)多次,最后發(fā)現(xiàn) begin_particle_cell_loop(pi,c,t)不能再DEFINE_DPM_DRAG中使用,一旦使用,求解就沒(méi)辦法進(jìn)行,我也嘗試在其他宏 如DEFINE_DPM_SCALE_UPDATA 和DEFINE_DPM_BODY_FORCE中調(diào)用均失敗。有沒(méi)有大牛使用過(guò)該宏,求指點(diǎn)迷津,被折磨了好久了。 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); //求體相積分?jǐn)?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); } |

新蟲(chóng) (初入文壇)
|
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); } |

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

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

| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 0817化學(xué)工程319求調(diào)劑 +7 | lv945 2026-03-08 | 9/450 |
|
|---|---|---|---|---|
|
[考研] 304求調(diào)劑(085602一志愿985) +6 | 化工人999 2026-03-09 | 6/300 |
|
|
[考研] 材料與化工求調(diào)劑 +10 | 與冬清寧 2026-03-07 | 13/650 |
|
|
[考研] 數(shù)二英二309分請(qǐng)求調(diào)劑 +3 | dtdxzxx 2026-03-09 | 4/200 |
|
|
[考研] 293一志愿華東理工 0817化學(xué)工程與技術(shù) 調(diào)劑 +5 | fjj0912 2026-03-07 | 5/250 |
|
|
[考研] 求0856調(diào)劑 +5 | 小力氣珂珂 2026-03-08 | 5/250 |
|
|
[考博] 26申博自薦 +9 | 烷基八氮- 2026-03-06 | 11/550 |
|
|
[考研] 085701環(huán)境工程317分求調(diào)劑 +9 | 6汆尼9 2026-03-07 | 9/450 |
|
|
[考研] 材料專(zhuān)碩調(diào)劑 +5 | 慕辰123 2026-03-05 | 8/400 |
|
|
[考研]
|
程晴之 2026-03-06 | 6/300 |
|
|
[考研] 材料調(diào)劑 +10 | ounce. 2026-03-04 | 12/600 |
|
|
[考研] 308求調(diào)劑 +7 | 倘若起風(fēng)了呢 2026-03-05 | 9/450 |
|
|
[考研] 復(fù)試調(diào)劑 +7 | 呼呼?~+123456 2026-03-05 | 10/500 |
|
|
[考研] 316求調(diào)劑 +3 | 林小星發(fā)大財(cái) 2026-03-05 | 5/250 |
|
|
[考研] 334求調(diào)劑 +6 | Trying] 2026-03-05 | 8/400 |
|
|
[考研] 304求調(diào)劑 +4 | 曼殊2266 2026-03-05 | 4/200 |
|
|
[考研] 347求調(diào)劑 +6 | 啊歐歐歐 2026-03-03 | 8/400 |
|
|
[考研] 22408-273求調(diào)劑-擔(dān)任3個(gè)項(xiàng)目的負(fù)責(zé)人-1篇國(guó)際期刊論文(一作)1篇核心期刊論文在投。 +3 | 沒(méi)想好取什么名 2026-03-03 | 3/150 |
|
|
[考研] 085600 材料與化工 298 +14 | 小西笑嘻嘻 2026-03-03 | 14/700 |
|
|
[考研] 0703化學(xué)306調(diào)劑 +4 | 26要上岸 2026-03-03 | 4/200 |
|