| 24小時(shí)熱門(mén)版塊排行榜 |
| 5 | 1/1 | 返回列表 |
| 查看: 4239 | 回復(fù): 4 | ||
[求助]
質(zhì)量源項(xiàng)、動(dòng)量源項(xiàng)
|
|
source = -mass/C_VOLUME(cell_gas,thread_gas)/CURRENT_TIMESTEP; /* 傳質(zhì)源項(xiàng),單位 kg/m3-s */ mass具體是如何定義的?相減符號(hào)如何? 還有,誰(shuí)有動(dòng)量源項(xiàng),我已經(jīng)在UDF里面寫(xiě)好質(zhì)量源項(xiàng),怎樣加動(dòng)量源項(xiàng)?在UDF里面 |

至尊木蟲(chóng) (知名作家)
新蟲(chóng) (小有名氣)
|
source = -mass/C_VOLUME(cell_gas,thread_gas)/CURRENT_TIMESTEP 你沒(méi)有寫(xiě)出全部,根據(jù)你寫(xiě)的來(lái)看mass除以單元體積和時(shí)間步。根據(jù)源項(xiàng)的定義單位是kg/m3,所以mass單位是kg。負(fù)號(hào)我的理解應(yīng)該表示消失源項(xiàng),至于動(dòng)量源fluent udf help里面的例子就是動(dòng)量源,你可以看看。 |
|
DEFINE_SOURCE(gas_source, cell_gas, thread_gas, dS, eqn) /* gas相o2組分的傳質(zhì)源項(xiàng) */ { real source; Domain *domain_liquid = Get_Domain(3); /* liquid相domain指針 */ Thread *thread_mix = THREAD_SUPER_THREAD(thread_gas); /* mixture的fluid-air區(qū)域指針 */ Thread *thread_liquid = Lookup_Thread(domain_liquid, 2); /* liquid相的fluid-water區(qū)域指針 */ cell_t cell_liquid; real m0_gas, m0_liquid, m1_gas, m1_liquid; if(C_UDMI(cell_gas, thread_mix, 0 ) == -1) /* 非相界面cell */ { source = 0.0; /* 傳質(zhì)源項(xiàng)為0 */ } else /* 相界面cell */ { cell_liquid = C_UDMI(cell_gas, thread_mix, 0); /* 獲取相界面另一側(cè)的cell編號(hào) */ /* 下面就可通過(guò)thread_mix, cell_gas, thread_gas, cell_liquid, thread_liquid五個(gè)變量獲取需要的數(shù)據(jù)計(jì)算傳質(zhì)源項(xiàng) */ m0_gas = C_YI(cell_gas, thread_gas, 0)*C_R(cell_gas, thread_gas)*C_VOLUME(cell_gas, thread_gas); /* 氣相中o2組分質(zhì)量,單位 kg */ m0_liquid = C_YI(cell_liquid, thread_liquid, 0)*C_R(cell_liquid, thread_liquid)*C_VOLUME(cell_liquid, thread_liquid); /* 液相中o2組分質(zhì)量,單位 kg */ m1_liquid = (m0_gas+m0_liquid)*kc*C_R(cell_liquid, thread_liquid)*C_VOLUME(cell_liquid, thread_liquid)/(kc*C_R(cell_liquid, thread_liquid)*C_VOLUME(cell_liquid, thread_liquid)+C_R(cell_gas, thread_gas)*C_VOLUME(cell_gas, thread_gas));/* 分配后液相中o2組分質(zhì)量,單位 kg */ m1_gas = m1_liquid*C_R(cell_gas, thread_gas)*C_VOLUME(cell_gas, thread_gas)/(C_R(cell_liquid, thread_liquid)*C_VOLUME(cell_liquid, thread_liquid)*kc); /* 分配后氣相中o2組分質(zhì)量,單位 kg */ source = (m1_gas-m0_gas)/C_VOLUME(cell_gas, thread_gas)/(CURRENT_TIMESTEP+0.023); /* 傳質(zhì)源項(xiàng),單位 kg/m3-s */ } dS[eqn] = 0.0; return source; } DEFINE_SOURCE(liquid_source, cell_liquid, thread_liquid, dS, eqn) /* liquid相o2組分的傳質(zhì)源項(xiàng) */ { real source; Domain *domain_gas = Get_Domain(2); /* gas相domain指針 */ Thread *thread_mix = THREAD_SUPER_THREAD(thread_liquid); /* mixture的fluid-water區(qū)域指針 */ Thread *thread_gas = Lookup_Thread(domain_gas, 3); /* gas相的fluid-air區(qū)域指針 */ cell_t cell_gas; real m0_gas, m0_liquid, m1_gas, m1_liquid; if(C_UDMI(cell_liquid, thread_mix, 0 ) == -1) /* 非相界面cell */ { source = 0.0; /* 傳質(zhì)源項(xiàng)為0 */ } else /* 相界面cell */ { cell_gas = C_UDMI(cell_liquid, thread_mix, 0); /* 獲取相界面另一側(cè)的cell編號(hào) */ /* 下面就可通過(guò)thread_mix, cell_gas, thread_gas, cell_liquid, thread_liquid五個(gè)變量獲取需要的數(shù)據(jù)計(jì)算傳質(zhì)源項(xiàng) */ m0_gas = C_YI(cell_gas, thread_gas, 0)*C_R(cell_gas, thread_gas)*C_VOLUME(cell_gas, thread_gas); /* 氣相中o2組分質(zhì)量,單位 kg */ m0_liquid = C_YI(cell_liquid, thread_liquid, 0)*C_R(cell_liquid, thread_liquid)*C_VOLUME(cell_liquid, thread_liquid); /* 液相中o2組分質(zhì)量,單位 kg */ m1_liquid = (m0_gas+m0_liquid)*kc*C_R(cell_liquid, thread_liquid)*C_VOLUME(cell_liquid, thread_liquid)/(kc*C_R(cell_liquid, thread_liquid)*C_VOLUME(cell_liquid, thread_liquid)+C_R(cell_gas, thread_gas)*C_VOLUME(cell_gas, thread_gas));/* 分配后液相中o2組分質(zhì)量,單位 kg */ m1_gas = m1_liquid*C_R(cell_gas, thread_gas)*C_VOLUME(cell_gas, thread_gas)/(C_R(cell_liquid, thread_liquid)*C_VOLUME(cell_liquid, thread_liquid)*kc); /* 分配后氣相中o2組分質(zhì)量,單位 kg */ source = (m1_liquid-m0_liquid)/C_VOLUME(cell_liquid, thread_liquid)/(CURRENT_TIMESTEP+0.023); /* 傳質(zhì)源項(xiàng),單位 kg/m3-s */ } dS[eqn] = 0.0; return source; } DEFINE_SOURCE(gas_source1, cell_gas, thread_gas, dS, eqn) /* gas相o2組分的傳質(zhì)源項(xiàng) */ { real source; Domain *domain_liquid = Get_Domain(3); /* liquid相domain指針 */ Thread *thread_mix = THREAD_SUPER_THREAD(thread_gas); /* mixture的fluid-air區(qū)域指針 */ Thread *thread_liquid = Lookup_Thread(domain_liquid, 2); /* liquid相的fluid-water區(qū)域指針 */ cell_t cell_liquid; real m0_gas, m0_liquid, m1_gas, m1_liquid; if(C_UDMI(cell_gas, thread_mix, 1 ) == -1) /* 非相界面cell */ { source = 0.0; /* 傳質(zhì)源項(xiàng)為0 */ } else /* 相界面cell */ { cell_liquid = C_UDMI(cell_gas, thread_mix, 1); /* 獲取相界面另一側(cè)的cell編號(hào) */ /* 下面就可通過(guò)thread_mix, cell_gas, thread_gas, cell_liquid, thread_liquid五個(gè)變量獲取需要的數(shù)據(jù)計(jì)算傳質(zhì)源項(xiàng) */ m0_gas = C_YI(cell_gas, thread_gas, 0)*C_R(cell_gas, thread_gas)*C_VOLUME(cell_gas, thread_gas); /* 氣相中o2組分質(zhì)量,單位 kg */ m0_liquid = C_YI(cell_liquid, thread_liquid, 0)*C_R(cell_liquid, thread_liquid)*C_VOLUME(cell_liquid, thread_liquid); /* 液相中o2組分質(zhì)量,單位 kg */ m1_liquid = (m0_gas+m0_liquid)*kc*C_R(cell_liquid, thread_liquid)*C_VOLUME(cell_liquid, thread_liquid)/(kc*C_R(cell_liquid, thread_liquid)*C_VOLUME(cell_liquid, thread_liquid)+C_R(cell_gas, thread_gas)*C_VOLUME(cell_gas, thread_gas));/* 分配后液相中o2組分質(zhì)量,單位 kg */ m1_gas = m1_liquid*C_R(cell_gas, thread_gas)*C_VOLUME(cell_gas, thread_gas)/(C_R(cell_liquid, thread_liquid)*C_VOLUME(cell_liquid, thread_liquid)*kc); /* 分配后氣相中o2組分質(zhì)量,單位 kg */ source = (m1_gas-m0_gas)/C_VOLUME(cell_gas, thread_gas)/CURRENT_TIMESTEP; /* 傳質(zhì)源項(xiàng),單位 kg/m3-s */ } dS[eqn] = 0.0; return source; } 這是我寫(xiě)的源項(xiàng) -----但是我覺(jué)得我的周期性濃度變化沒(méi)有寫(xiě)進(jìn)來(lái)----求助啊 |

|
DEFINE_SOURCE(gas_source, cell_gas, thread_gas, dS, eqn) /* gas相o2組分的傳質(zhì)源項(xiàng) */ { real source; Domain *domain_liquid = Get_Domain(3); /* liquid相domain指針 */ Thread *thread_mix = THREAD_SUPER_THREAD(thread_gas); /* mixture的fluid-air區(qū)域指針 */ Thread *thread_liquid = Lookup_Thread(domain_liquid, 2); /* liquid相的fluid-water區(qū)域指針 */ cell_t cell_liquid; real m0_gas, m0_liquid, m1_gas, m1_liquid; if(C_UDMI(cell_gas, thread_mix, 0 ) == -1) /* 非相界面cell */ { source = 0.0; /* 傳質(zhì)源項(xiàng)為0 */ } else /* 相界面cell */ { cell_liquid = C_UDMI(cell_gas, thread_mix, 0); /* 獲取相界面另一側(cè)的cell編號(hào) */ /* 下面就可通過(guò)thread_mix, cell_gas, thread_gas, cell_liquid, thread_liquid五個(gè)變量獲取需要的數(shù)據(jù)計(jì)算傳質(zhì)源項(xiàng) */ m0_gas = C_YI(cell_gas, thread_gas, 0)*C_R(cell_gas, thread_gas)*C_VOLUME(cell_gas, thread_gas); /* 氣相中o2組分質(zhì)量,單位 kg */ m0_liquid = C_YI(cell_liquid, thread_liquid, 0)*C_R(cell_liquid, thread_liquid)*C_VOLUME(cell_liquid, thread_liquid); /* 液相中o2組分質(zhì)量,單位 kg */ m1_liquid = (m0_gas+m0_liquid)*kc*C_R(cell_liquid, thread_liquid)*C_VOLUME(cell_liquid, thread_liquid)/(kc*C_R(cell_liquid, thread_liquid)*C_VOLUME(cell_liquid, thread_liquid)+C_R(cell_gas, thread_gas)*C_VOLUME(cell_gas, thread_gas));/* 分配后液相中o2組分質(zhì)量,單位 kg */ m1_gas = m1_liquid*C_R(cell_gas, thread_gas)*C_VOLUME(cell_gas, thread_gas)/(C_R(cell_liquid, thread_liquid)*C_VOLUME(cell_liquid, thread_liquid)*kc); /* 分配后氣相中o2組分質(zhì)量,單位 kg */ source = (m1_gas-m0_gas)/C_VOLUME(cell_gas, thread_gas)/(CURRENT_TIMESTEP+0.023); /* 傳質(zhì)源項(xiàng),單位 kg/m3-s */ } dS[eqn] = 0.0; return source; } 我這個(gè)因?yàn)槭侵芷谛蛡髻|(zhì)---兩邊都傳---然后右邊的傳質(zhì)實(shí)際上是下一個(gè)長(zhǎng)度周期的呀---所以我不知道怎樣弄啊---我的udf 關(guān)于質(zhì)量分?jǐn)?shù)哪兒寫(xiě)的不對(duì)啊 |

| 5 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 本科211生物醫(yī)學(xué)工程085409求調(diào)劑339分 +5 | 里子木yy 2026-03-29 | 5/250 |
|
|---|---|---|---|---|
|
[考研] 262求調(diào)劑 +7 | ZZ..000 2026-03-30 | 8/400 |
|
|
[考研] 食品工程專(zhuān)碩一志愿中海洋309求調(diào)劑 +5 | 小張zxy張 2026-03-26 | 10/500 |
|
|
[考研] 哈爾濱工業(yè)大學(xué)材料與化工專(zhuān)碩378求調(diào)劑 +3 | 塔比烏斯 2026-03-30 | 3/150 |
|
|
[考研] 求調(diào)劑,一志愿 南京航空航天大學(xué) ,080500材料科學(xué)與工程學(xué)碩,總分289分 +9 | @taotao 2026-03-29 | 9/450 |
|
|
[考研] 286分調(diào)劑 +10 | Faune 2026-03-30 | 11/550 |
|
|
[考研] 346求調(diào)劑 一志愿070303有機(jī)化學(xué) +7 | 蘿卜燉青菜 2026-03-28 | 8/400 |
|
|
[考研] 359求調(diào)劑 +5 | 王了個(gè)楠 2026-03-25 | 5/250 |
|
|
[考研] 材料化工340求調(diào)劑 +3 | jhx777 2026-03-30 | 3/150 |
|
|
[考研] 0856求調(diào)劑 +8 | 楒桉 2026-03-28 | 8/400 |
|
|
[考研] 一志愿南昌大學(xué)324求調(diào)劑 +5 | hanamiko 2026-03-29 | 5/250 |
|
|
[考研] 356求調(diào)劑 +4 | gysy?s?a 2026-03-28 | 4/200 |
|
|
[考研] 0856材料化工調(diào)劑 總分330 +14 | zhubinhao 2026-03-27 | 14/700 |
|
|
[考研] 數(shù)一英一271專(zhuān)碩(085401)求調(diào)劑,可跨 +7 | 前行必有光 2026-03-28 | 8/400 |
|
|
[考研] 復(fù)試調(diào)劑 +3 | raojunqi0129 2026-03-28 | 3/150 |
|
|
[考研] 085701環(huán)境工程,267求調(diào)劑 +16 | minht 2026-03-26 | 16/800 |
|
|
[考研] 0856,材料與化工321分求調(diào)劑 +12 | 大饞小子 2026-03-27 | 13/650 |
|
|
[考研] 086000調(diào)劑 +3 | 7901117076 2026-03-26 | 3/150 |
|
|
[考研] 調(diào)劑求收留 +7 | 果然有我 2026-03-26 | 7/350 |
|
|
[考研] 材料與化工304求B區(qū)調(diào)劑 +3 | 邱gl 2026-03-25 | 3/150 |
|