| 查看: 991 | 回复: 2 | ||
| 【悬赏金币】回答本帖问题,作者113745685将赠送您 50 个金币 | ||
113745685金虫 (正式写手)
|
[求助]
求助:UDF的MASS_TRANSFER并行运算的问题!!!
|
|
|
请问各位大佬,我想用UDF实现fluent的一个蒸发冷凝模型,以替代现有的Lee模型(复现论文10.1016/j.ijheatmasstransfer.2019.118763的工作)。程序如下,串行的程序我弄出来了,但是并行的程序我不会搞,每次初始化都提示:MPI Application rank 0 exited before MPI_Finalize() with status 2. The fl process could not be started. UDM的内存位置也指定了,但是不知道为什么还是有这个问题,是程序哪里错了吗?如果有大佬能指出问题所在,在下愿意献上50个金币。 ----------------------------------------------------------------------------------------------------------------------------------------------------------------- #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); } |
» 猜你喜欢
求国际会议网站
已经有1人回复
求取一些关于纳米材料和纳米技术相关的英文PPT。
已经有0人回复
物理学I论文润色/翻译怎么收费?
已经有206人回复
【复旦大学】二维材料方向招收2026年博士研究生1名
已经有0人回复
北京纳米能源与系统研究所 王中林院士/曹南颖研究员课题组2026级硕/博/博后招生
已经有10人回复
荷兰Utrecht University超快太赫兹光谱王海教授课题招收2026 CSC博士生
已经有21人回复
反铁磁体中的磁性切换:两种不同的机制已成功可视化
已经有0人回复
26申博推荐:南京航空航天大学国际前沿科学研究院光学方向招收博士生!
已经有0人回复
求标准粉末衍射卡号 ICDD 01-076-1802
已经有0人回复
113745685
金虫 (正式写手)
- 应助: 0 (幼儿园)
- 金币: 996.7
- 散金: 80
- 帖子: 405
- 在线: 37.4小时
- 虫号: 12576352
- 注册: 2018-11-14
- 专业: 多相流热物理学
|
更新,我改了一下程序。注释掉了和C_UDMI有关的程序,结果就能并行运算了,问题是我在fluent里已经定义了C_UDMI的位置了,为什么还会报错,有没有大佬能解答一下? ---------------------------------------------------------------------------------------------------------------------------------- #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); } |
2楼2022-12-05 22:39:40
113745685
金虫 (正式写手)
- 应助: 0 (幼儿园)
- 金币: 996.7
- 散金: 80
- 帖子: 405
- 在线: 37.4小时
- 虫号: 12576352
- 注册: 2018-11-14
- 专业: 多相流热物理学
3楼2022-12-06 22:06:37













回复此楼