| 3 | 1/1 | 返回列表 |
| 查看: 1057 | 回復(fù): 2 | |||
| 【懸賞金幣】回答本帖問(wèn)題,作者113745685將贈(zèng)送您 50 個(gè)金幣 | |||
113745685金蟲 (正式寫手)
|
[求助]
求助:UDF的MASS_TRANSFER并行運(yùn)算的問(wèn)題!。
|
||
|
請(qǐng)問(wèn)各位大佬,我想用UDF實(shí)現(xiàn)fluent的一個(gè)蒸發(fā)冷凝模型,以替代現(xiàn)有的Lee模型(復(fù)現(xiàn)論文10.1016/j.ijheatmasstransfer.2019.118763的工作)。程序如下,串行的程序我弄出來(lái)了,但是并行的程序我不會(huì)搞,每次初始化都提示:MPI Application rank 0 exited before MPI_Finalize() with status 2. The fl process could not be started. UDM的內(nèi)存位置也指定了,但是不知道為什么還是有這個(gè)問(wèn)題,是程序哪里錯(cuò)了嗎?如果有大佬能指出問(wèn)題所在,在下愿意獻(xiàn)上50個(gè)金幣。 ----------------------------------------------------------------------------------------------------------------------------------------------------------------- #include "udf.h" DEFINE_MASS_TRANSFER(liq_gas_source, cell, thread, from_index, from_species_index, to_index, to_species_index) { real m_lg=0.0; real T_SAT = 318.0; real T_Ti = 16.2; real be = 0.1; real bc = 10; #if !RP_HOST Thread *gas, *liq; liq = THREAD_SUB_THREAD(thread, from_index); gas = THREAD_SUB_THREAD(thread, to_index); C_UDMI(cell, thread, 1) = 0.; C_UDMI(cell, thread, 2) = 0.; if (C_T(cell, liq) > T_SAT + T_Ti) { m_lg = be*C_VOF(cell, liq)*C_R(cell, liq)*(C_T(cell, liq) - T_SAT) / T_SAT; /*Evaporation*/ C_UDMI(cell, thread, 1) = m_lg * 2455.e3; } else if (C_T(cell, liq) > T_SAT&&C_T(cell, liq) < T_SAT + T_Ti) { if (C_VOF(cell, liq) == 1) { m_lg = 0.0; /*Neither evaporation nor condensing*/ } else if (C_VOF(cell, liq) != 1) { m_lg = be*C_VOF(cell, liq)*C_R(cell, liq)*(C_T(cell, liq) - T_SAT) / T_SAT; /*Evaporation*/ C_UDMI(cell, thread, 1) = m_lg * 2455.e3; } } else if (C_T(cell, gas) < T_SAT) { m_lg = bc*C_VOF(cell, gas)*C_R(cell, gas)*(C_T(cell, gas) - T_SAT) / T_SAT; /*Condensing*/ C_UDMI(cell, thread, 2) = -m_lg * 2455.e3; } #if RP_NODE m_lg = PRF_GRSUM1(m_lg); #endif node_to_host_real_1(m_lg); #endif return(m_lg); } |
金蟲 (正式寫手)
|
更新,我改了一下程序。注釋掉了和C_UDMI有關(guān)的程序,結(jié)果就能并行運(yùn)算了,問(wèn)題是我在fluent里已經(jīng)定義了C_UDMI的位置了,為什么還會(huì)報(bào)錯(cuò),有沒(méi)有大佬能解答一下? ---------------------------------------------------------------------------------------------------------------------------------- #include "udf.h" DEFINE_MASS_TRANSFER(liq_gas_source, cell, thread, from_index, from_species_index, to_index, to_species_index) { real m_lg; real T_SAT = 318.0; real T_Ti = 16.2; real be = 0.1; real bc = 10; Thread *gas, *liq; liq = THREAD_SUB_THREAD(thread, from_index); gas = THREAD_SUB_THREAD(thread, to_index); m_lg = 0.0; /*C_UDMI(cell, thread, 1) = 0.;*/ /*C_UDMI(cell, thread, 2) = 0.;*/ if (C_T(cell, liq) > T_SAT + T_Ti) { m_lg = be*C_VOF(cell, liq)*C_R(cell, liq)*(C_T(cell, liq) - T_SAT) / T_SAT; /*Evaporation*/ C_UDMI(cell, thread, 1) = m_lg * 2455.e3; } else if (C_T(cell, liq) > T_SAT&&C_T(cell, liq) < T_SAT + T_Ti) { if (C_VOF(cell, liq) == 1) { m_lg = 0.0; /*Neither evaporation nor condensing*/ } else if (C_VOF(cell, liq) != 1) { m_lg = be*C_VOF(cell, liq)*C_R(cell, liq)*(C_T(cell, liq) - T_SAT) / T_SAT; /*Evaporation*/ /*C_UDMI(cell, thread, 1) = m_lg * 2455.e3;*/ } } else if (C_T(cell, gas) < T_SAT) { m_lg = bc*C_VOF(cell, gas)*C_R(cell, gas)*(C_T(cell, gas) - T_SAT) / T_SAT; /*Condensing*/ /*C_UDMI(cell, thread, 2) = -m_lg * 2455.e3;*/ } return(m_lg); } |
金蟲 (正式寫手)
| 3 | 1/1 | 返回列表 |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 327分求調(diào)劑086 +4 | 西紅柿?小帥 2026-03-09 | 7/350 |
|
|---|---|---|---|---|
|
[考研] 0817一志愿蘇州大學(xué)280復(fù)試調(diào)劑 +9 | kk扛 2026-03-07 | 9/450 |
|
|
[考研] 288求調(diào)劑 +10 | 王曉陽(yáng)- 2026-03-09 | 15/750 |
|
|
[考研] 歡迎211本科同學(xué),過(guò)A區(qū)國(guó)家線,A區(qū)非偏遠(yuǎn)一本,交叉學(xué)科課題組 +22 | lisimayy 2026-03-04 | 35/1750 |
|
|
[考研] 293求調(diào)劑 +4 | 上班不著吉 2026-03-09 | 4/200 |
|
|
[考研] 320材料與化工,求調(diào)劑 +11 | 鶴遨予卿 2026-03-04 | 13/650 |
|
|
[考研] 一志愿南大化學(xué)339分求調(diào)劑,四六級(jí)已過(guò),有比賽,有文章 +7 | Gallantzhou 2026-03-07 | 7/350 |
|
|
[考研] 337求調(diào)劑 +3 | 睡醒,。 2026-03-09 | 3/150 |
|
|
[考博] 26申博自薦 +9 | 烷基八氮- 2026-03-06 | 11/550 |
|
|
[考研] 安徽農(nóng)業(yè)大學(xué)材料與化學(xué)學(xué)院0856材料招收調(diào)劑 +3 | akakk47 2026-03-05 | 9/450 |
|
|
[考研] 材料調(diào)劑 +7 | ounce. 2026-03-05 | 15/750 |
|
|
[考研] 0703化學(xué)調(diào)劑 +5 | G212 2026-03-03 | 6/300 |
|
|
[考研] 一志愿哈爾濱工業(yè)大學(xué)0856材料與化工,前三科206,總分283,求調(diào)劑 +7 | 26考研求調(diào)劑 2026-03-06 | 7/350 |
|
|
[考研] 304求調(diào)劑 +4 | 曼殊2266 2026-03-05 | 4/200 |
|
|
[考研] 334求調(diào)劑 +3 | Trying] 2026-03-03 | 4/200 |
|
|
[考研] 求調(diào)劑 +3 | 泡了個(gè)椒 2026-03-04 | 4/200 |
|
|
[考研] 一志愿西交化工專碩288專業(yè)課93求調(diào)劑 +6 | 好運(yùn)好運(yùn)接接 2026-03-04 | 6/300 |
|
|
[考研] 0856材料專碩274能調(diào)劑去哪里? +3 | 22735 2026-03-04 | 4/200 |
|
|
[考研] 0703化學(xué)求調(diào)劑 +3 | 將未有期 2026-03-04 | 3/150 |
|
|
[考研] 281求調(diào)劑 +3 | Y?l?h 2026-03-04 | 3/150 |
|