| 5 | 1/1 | 返回列表 |
| 查看: 4237 | 回復(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ā)表 | |
|---|---|---|---|---|
|
[考研] 284求調(diào)劑 +5 | 小熊~~ 2026-03-31 | 5/250 |
|
|---|---|---|---|---|
|
[考研] 070300一志愿211,312分求調(diào)劑院校 +7 | 小黃鴨寶 2026-03-30 | 7/350 |
|
|
[考研] 求調(diào)劑:085600材料與化工,考材科基,總分319 +8 | 678lucky 2026-03-31 | 8/400 |
|
|
[考研] 環(huán)境工程 085701,267求調(diào)劑 +11 | minht 2026-03-29 | 11/550 |
|
|
[考研] 367求調(diào)劑 +5 | 芋泥啵! 2026-03-28 | 5/250 |
|
|
[考研]
|
鐘llll 2026-03-26 | 5/250 |
|
|
[考研] 311求調(diào)劑 +7 | 藍月亮亮 2026-03-30 | 7/350 |
|
|
[考研] 282求調(diào)劑 +4 | wcq131415 2026-03-24 | 4/200 |
|
|
[考研] 調(diào)劑求院校招收 +6 | 鶴鯨鴿 2026-03-28 | 6/300 |
|
|
[考研] 081200-11408-276學(xué)碩求調(diào)劑 +6 | 崔wj 2026-03-26 | 6/300 |
|
|
[考研] 本科新能源科學(xué)與工程,一志愿華理能動285求調(diào)劑 +3 | AZMK 2026-03-27 | 5/250 |
|
|
[考研] 085701環(huán)境工程,267求調(diào)劑 +16 | minht 2026-03-26 | 16/800 |
|
|
[考研] 295求調(diào)劑 +5 | 1428151015 2026-03-27 | 6/300 |
|
|
[考研] 070300化學(xué)求調(diào)劑 +4 | 起個名咋這么難 2026-03-27 | 4/200 |
|
|
[考研] 08開頭275求調(diào)劑 +4 | 拉誰不重要 2026-03-26 | 4/200 |
|
|
[考研] 考研調(diào)劑 +10 | 呼呼?~+123456 2026-03-24 | 10/500 |
|
|
[考研] 314求調(diào)劑 +3 | 溪云珂 2026-03-26 | 3/150 |
|
|
[考研] 一志愿吉大071010,316分求調(diào)劑 +3 | xgbiknn 2026-03-27 | 3/150 |
|
|
[碩博家園] 北京林業(yè)大學(xué)碩導(dǎo)招生廣告 +6 | kongweilin 2026-03-26 | 8/400 |
|
|
[考研] 309求調(diào)劑 +4 | gajsj 2026-03-25 | 5/250 |
|