| 查看: 1105 | 回复: 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); } |
» 猜你喜欢
中国科学院东莞材料科学与技术研究所-2026年博士招生-吴昊研究员-磁学与自旋电子学
已经有0人回复
《电磁学》教材推荐
已经有1人回复
物理学I论文润色/翻译怎么收费?
已经有188人回复
【急招】合肥工大核聚变材料计算方向2026级工程博士生
已经有4人回复
大豆异黄酮分离
已经有0人回复
湖南大学材料学院急招2026年博士生,临时增加一名博士联培指标
已经有10人回复
天津理工大学晶体材料全国重点实验室刘红军教授课题组招收博士生1-2名
已经有1人回复
中国科学院物理研究所谌志国研究员团队招收2027年博士研究生
已经有3人回复
2026年中德博士后交流项目 - 新型量子和磁性材料:材料制备表征和中子散射研究
已经有12人回复
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












回复此楼
10