| 6 | 1/1 | 返回列表 |
| 查看: 2258 | 回復(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ā)表 | |
|---|---|---|---|---|
|
[考研] A區(qū)一本交叉課題組,低分調(diào)劑,招收機(jī)械電子信息通信等交叉方向 +4 | lisimayy 2026-03-04 | 10/500 |
|
|---|---|---|---|---|
|
[考研] 歡迎211本科同學(xué),過A區(qū)國家線,A區(qū)非偏遠(yuǎn)一本,交叉學(xué)科課題組 +11 | lisimayy 2026-03-04 | 21/1050 |
|
|
[基金申請]
|
xhuama 2026-03-02 | 16/800 |
|
|
[考研] 一志愿清華深研院材料專碩294分,專業(yè)課111分,本科中南大學(xué)材料,有六級,有工作經(jīng)驗(yàn) +3 | H14528 2026-03-04 | 3/150 |
|
|
[考研] 0703 東華大學(xué) 理學(xué)化學(xué)均過 a 線,總分 281 求調(diào)劑 +4 | 香香 Lu 2026-03-03 | 7/350 |
|
|
[考研] 293求調(diào)劑 +3 | 是樂渝哇 2026-03-04 | 3/150 |
|
|
[考研] 一志愿985材料與化工 326分求調(diào)劑 +3 | Hz795795 2026-03-04 | 3/150 |
|
|
[考研] 307求調(diào)劑 +4 | xuyuan111 2026-03-04 | 5/250 |
|
|
[考研] 274求調(diào)劑 +8 | 一個(gè)學(xué)習(xí)者 2026-03-04 | 8/400 |
|
|
[考研] 一志愿西交大材料學(xué)碩 346 求調(diào)劑 +3 | zju51 2026-03-04 | 3/150 |
|
|
[碩博家園] 2025屆雙非化工碩士畢業(yè),申博 +4 | 更多的是 2026-02-27 | 5/250 |
|
|
[考研] 268求調(diào)劑 +10 | 簡單點(diǎn)0 2026-03-02 | 14/700 |
|
|
[考研] 278求調(diào)劑 +3 | 滿天星11_22 2026-03-02 | 3/150 |
|
|
[考研] 化學(xué)0703求調(diào)劑 學(xué)碩 理/工科均可 總分279 +3 | 1一11 2026-03-03 | 5/250 |
|
|
[考博] 博士自薦 +4 | kkluvs 2026-02-28 | 5/250 |
|
|
[考研] 一志愿中石油(華東)本科齊魯工業(yè)大學(xué) +3 | 石能偉 2026-03-02 | 3/150 |
|
|
[考研] 調(diào)劑 +3 | 13853210211 2026-03-02 | 4/200 |
|
|
[考研] 272求調(diào)劑 +6 | 田智友 2026-02-28 | 6/300 |
|
|
[考研] 291分工科求調(diào)劑 +9 | science餓餓 2026-03-01 | 10/500 |
|
|
[基金申請]
剛錄用,沒有期刊號,但是在線可看的論文可以放為代表作嗎
10+3
|
arang1 2026-03-01 | 3/150 |
|