| 5 | 1/1 | 返回列表 |
| 查看: 4236 | 回復(fù): 4 | ||
[求助]
質(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; } 這是我寫的源項 -----但是我覺得我的周期性濃度變化沒有寫進(jìn)來----求助啊 |

|
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ì)量分?jǐn)?shù)哪兒寫的不對啊 |

| 5 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 一志愿鄭大材料工程290求調(diào)劑 +12 | Youth_ 2026-03-30 | 12/600 |
|
|---|---|---|---|---|
|
[考研] 285求調(diào)劑 +6 | AZMK 2026-03-29 | 9/450 |
|
|
[考研] 材料工程專碩求調(diào)劑 +8 | hyl3153942 2026-03-29 | 8/400 |
|
|
[考研]
|
鐘llll 2026-03-26 | 5/250 |
|
|
[考研] 318一志愿吉林大學(xué)生物與醫(yī)藥 求調(diào)劑 +5 | 篤行致遠(yuǎn). 2026-03-28 | 5/250 |
|
|
[考研] 289求調(diào)劑 +5 | BrightLL 2026-03-29 | 5/250 |
|
|
[考研] 一志愿雙一流機(jī)械285分求調(diào)劑 +4 | 幸運的三木 2026-03-29 | 5/250 |
|
|
[考研] 305求調(diào)劑 +8 | RuiFairyrui 2026-03-28 | 8/400 |
|
|
[考研] 數(shù)一英一271專碩(085401)求調(diào)劑,可跨 +7 | 前行必有光 2026-03-28 | 8/400 |
|
|
[考研] 071000生物學(xué)求調(diào)劑,初試成績343 +7 | 小小甜面團(tuán) 2026-03-25 | 7/350 |
|
|
[考研] 283求調(diào)劑 +7 | A child 2026-03-28 | 7/350 |
|
|
[考研] 材料277求調(diào)劑 +7 | min3 2026-03-24 | 7/350 |
|
|
[考研] 339求調(diào)劑,想調(diào)回江蘇 +6 | 烤麥芽 2026-03-27 | 8/400 |
|
|
[考研] 086502化學(xué)工程342求調(diào)劑 +6 | 阿姨復(fù)古不過 2026-03-27 | 6/300 |
|
|
[考研] 求調(diào)劑推薦 材料 304 +15 | 荷包蛋hyj 2026-03-26 | 15/750 |
|
|
[考研] 292求調(diào)劑 +4 | 求求了收下我吧?/a> 2026-03-26 | 4/200 |
|
|
[考研] 一志愿吉大071010,316分求調(diào)劑 +3 | xgbiknn 2026-03-27 | 3/150 |
|
|
[考研] 調(diào)劑 +4 | 柚柚yoyo 2026-03-26 | 4/200 |
|
|
[考研]
材料調(diào)劑
5+4
|
想要一壺桃花水 2026-03-25 | 10/500 |
|
|
[考研] 293求調(diào)劑 +7 | 加一一九 2026-03-24 | 7/350 |
|