| 5 | 1/1 | 返回列表 |
| 查看: 4238 | 回復(fù): 4 | ||
| 當(dāng)前只顯示滿足指定條件的回帖,點擊這里查看本話題的所有回帖 | ||
[求助]
質(zhì)量源項、動量源項
|
||
|
source = -mass/C_VOLUME(cell_gas,thread_gas)/CURRENT_TIMESTEP; /* 傳質(zhì)源項,單位 kg/m3-s */ mass具體是如何定義的?相減符號如何? 還有,誰有動量源項,我已經(jīng)在UDF里面寫好質(zhì)量源項,怎樣加動量源項?在UDF里面 |

新蟲 (小有名氣)
|
DEFINE_SOURCE(gas_source, cell_gas, thread_gas, dS, eqn) /* gas相o2組分的傳質(zhì)源項 */ { 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ì)源項為0 */ } else /* 相界面cell */ { cell_liquid = C_UDMI(cell_gas, thread_mix, 0); /* 獲取相界面另一側(cè)的cell編號 */ /* 下面就可通過thread_mix, cell_gas, thread_gas, cell_liquid, thread_liquid五個變量獲取需要的數(shù)據(jù)計算傳質(zhì)源項 */ 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ì)源項,單位 kg/m3-s */ } dS[eqn] = 0.0; return source; } DEFINE_SOURCE(liquid_source, cell_liquid, thread_liquid, dS, eqn) /* liquid相o2組分的傳質(zhì)源項 */ { 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ì)源項為0 */ } else /* 相界面cell */ { cell_gas = C_UDMI(cell_liquid, thread_mix, 0); /* 獲取相界面另一側(cè)的cell編號 */ /* 下面就可通過thread_mix, cell_gas, thread_gas, cell_liquid, thread_liquid五個變量獲取需要的數(shù)據(jù)計算傳質(zhì)源項 */ 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ì)源項,單位 kg/m3-s */ } dS[eqn] = 0.0; return source; } DEFINE_SOURCE(gas_source1, cell_gas, thread_gas, dS, eqn) /* gas相o2組分的傳質(zhì)源項 */ { 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ì)源項為0 */ } else /* 相界面cell */ { cell_liquid = C_UDMI(cell_gas, thread_mix, 1); /* 獲取相界面另一側(cè)的cell編號 */ /* 下面就可通過thread_mix, cell_gas, thread_gas, cell_liquid, thread_liquid五個變量獲取需要的數(shù)據(jù)計算傳質(zhì)源項 */ 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ì)源項,單位 kg/m3-s */ } dS[eqn] = 0.0; return source; } 這是我寫的源項 -----但是我覺得我的周期性濃度變化沒有寫進來----求助啊 |

|
DEFINE_SOURCE(gas_source, cell_gas, thread_gas, dS, eqn) /* gas相o2組分的傳質(zhì)源項 */ { 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ì)源項為0 */ } else /* 相界面cell */ { cell_liquid = C_UDMI(cell_gas, thread_mix, 0); /* 獲取相界面另一側(cè)的cell編號 */ /* 下面就可通過thread_mix, cell_gas, thread_gas, cell_liquid, thread_liquid五個變量獲取需要的數(shù)據(jù)計算傳質(zhì)源項 */ 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ì)源項,單位 kg/m3-s */ } dS[eqn] = 0.0; return source; } 我這個因為是周期型傳質(zhì)---兩邊都傳---然后右邊的傳質(zhì)實際上是下一個長度周期的呀---所以我不知道怎樣弄啊---我的udf 關(guān)于質(zhì)量分數(shù)哪兒寫的不對啊 |

| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 總分322求生物學(xué)/生化與分子/生物信息學(xué)相關(guān)調(diào)劑 +6 | 星沉uu 2026-03-26 | 7/350 |
|
|---|---|---|---|---|
|
[考研] 0856調(diào)劑 +6 | 曲聽筠 2026-03-30 | 6/300 |
|
|
[考研] 291求調(diào)劑 +12 | Y-cap 2026-03-29 | 15/750 |
|
|
[考研] 材料化工340求調(diào)劑 +3 | jhx777 2026-03-30 | 3/150 |
|
|
[考研] 071010 323 分求調(diào)劑 +3 | Baekzhy 2026-03-27 | 3/150 |
|
|
[考研] 284求調(diào)劑 +14 | junqihahaha 2026-03-26 | 15/750 |
|
|
[考研] 化學(xué)308分調(diào)劑 +7 | 你好明天你好 2026-03-30 | 8/400 |
|
|
[考研] 環(huán)境科學(xué)與工程334分求調(diào)劑 +6 | 王一一依依 2026-03-30 | 8/400 |
|
|
[考研] 295求調(diào)劑 +5 | wei-5 2026-03-26 | 5/250 |
|
|
[考研] 294分080500材料科學(xué)與工程求調(diào)劑 +8 | 柳溪邊 2026-03-26 | 8/400 |
|
|
[考研] 298求調(diào)劑 +3 | 種圣賜 2026-03-29 | 3/150 |
|
|
[考研] 279求調(diào)劑 +4 | 蝶舞輕繞 2026-03-29 | 4/200 |
|
|
[考研] 298求調(diào)劑 +4 | 種圣賜 2026-03-28 | 4/200 |
|
|
[考研] 調(diào)劑考研 +3 | 王杰一 2026-03-29 | 3/150 |
|
|
[考研] 356求調(diào)劑 +3 | gysy?s?a 2026-03-28 | 3/150 |
|
|
[考研] 343求調(diào)劑 +5 | 愛羈絆 2026-03-28 | 5/250 |
|
|
[考研] 339求調(diào)劑,想調(diào)回江蘇 +6 | 烤麥芽 2026-03-27 | 8/400 |
|
|
[考研] 352分 化工與材料 +5 | 海納百川Ly 2026-03-27 | 5/250 |
|
|
[考研] 材料求調(diào)劑 +5 | .m.. 2026-03-25 | 5/250 |
|
|
[考研] 340求調(diào)劑 +5 | 話梅糖111 2026-03-24 | 5/250 |
|