| 6 | 1/1 | 返回列表 |
| 查看: 2264 | 回復(fù): 5 | ||
[求助]
DPM宏命令Begin_particle_cell_loop(p,c,t)的使用問題 已有1人參與
|
|
各位同學(xué) 有沒有使用Fluent中 這個(gè) begin_particle_cell_loop(p,c,t)宏呢,該宏出現(xiàn)在DEFINE_DPM_SPRAY_COLLIDE中,看幫助上的解釋,該宏應(yīng)該是遍歷單元中所有的顆粒。我想用該宏求出單元中 顆粒的體積分?jǐn)?shù),命令如下。 該命令在編譯中沒問題,計(jì)算時(shí)崩潰。我調(diào)試過多次,最后發(fā)現(xiàn) begin_particle_cell_loop(pi,c,t)不能再DEFINE_DPM_DRAG中使用,一旦使用,求解就沒辦法進(jìn)行,我也嘗試在其他宏 如DEFINE_DPM_SCALE_UPDATA 和DEFINE_DPM_BODY_FORCE中調(diào)用均失敗。有沒有大牛使用過該宏,求指點(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); } |


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

送紅花一朵 |
膜拜大神。請問大神,你所說的particle bin如何創(chuàng)建,或者如何得到?在fluent UDF 手冊中關(guān)于這個(gè)宏我只發(fā)現(xiàn)在DEFINE_DPM_SPRAY_COLLIDE中存在,關(guān)于這個(gè)宏的介紹也是一筆帶過。大神,你能詳細(xì)說下,或則推薦個(gè)資料嗎,udf手冊中的介紹很不詳細(xì),有很多都需要自己結(jié)合程序推出是什么意思。。我udf的目的是想遍歷每個(gè)流體單元中所有的氣泡,通過累加其體積然后求得氣相的體積分?jǐn)?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)劑 +18 | 津萌津萌 2026-03-02 | 27/1350 |
|
|---|---|---|---|---|
|
[考研] 347求調(diào)劑 +6 | 啊歐歐歐 2026-03-03 | 8/400 |
|
|
[考研] 080500材料科學(xué)與工程 +10 | 202114020319 2026-03-03 | 10/500 |
|
|
[考研] 304求調(diào)劑 +3 | 曼殊2266 2026-03-04 | 3/150 |
|
|
[考研] 085701環(huán)境工程 求調(diào)劑 +7 | xiiiia 2026-03-04 | 7/350 |
|
|
[考研] 304分材料專碩求調(diào)劑 +11 | qiuzhigril 2026-03-03 | 14/700 |
|
|
[考研] 材料277分求調(diào)劑 +9 | 飯飯星球 2026-03-04 | 9/450 |
|
|
[考研] 一志愿武漢理工大學(xué)-085602-總分296分-求調(diào)劑 +7 | 紫川葡柚 2026-03-04 | 7/350 |
|
|
[考研] 求調(diào)劑 +7 | 博斯特525 2026-03-04 | 7/350 |
|
|
[考研]
|
15779376950 2026-03-01 | 8/400 |
|
|
[考研] 環(huán)境調(diào)劑 +8 | chenhanheng 2026-03-02 | 8/400 |
|
|
[考研] 085600材料與化工調(diào)劑 280分 +10 | yyqqhh 2026-03-03 | 10/500 |
|
|
[考研] 290求調(diào)劑 +9 | ErMiao1020 2026-03-02 | 9/450 |
|
|
[考研] 化工京區(qū)271求調(diào)劑 +7 | 11ing 2026-03-02 | 7/350 |
|
|
[考研] 290分材料工程085601求調(diào)劑 數(shù)二英一 +8 | llx0610 2026-03-02 | 9/450 |
|
|
[考研] 295求調(diào)劑。一志愿報(bào)考鄭州大學(xué)化學(xué)工藝學(xué)碩,總分295分 +8 | yl1 2026-03-02 | 9/450 |
|
|
[考研] 261求調(diào)劑 +3 | 陸lh 2026-03-01 | 3/150 |
|
|
[考研] 一志愿東北大學(xué)材料專碩328,求調(diào)劑 +3 | shs1083 2026-03-02 | 3/150 |
|
|
[基金申請] 此成果不能導(dǎo)入原因:元數(shù)據(jù)必填信息不完整,可 進(jìn)行補(bǔ)充。 +4 | Kittylucky 2026-03-02 | 5/250 |
|
|
[考研] 化工專碩342,一志愿大連理工大學(xué),求調(diào)劑 +6 | kyf化工 2026-02-28 | 7/350 |
|