|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
大家好,我想用UDF把一个新的蒸发相变模型加入VOF模型中来计算液滴蒸发,液滴直径为100微米,初始温度为500K,周围空气初始温度为800K。网格尺寸1微米,步长0.1微秒。
公式中需要用到volume fraction的梯度。我用的C_VOF_G(cell, gas),编译能通过,也可以进行计算。但是计算结果中mass transfer rate 始终为0,然后我加入了printf来查看公式中的中间值,发现用C_VOF_G(cell, gas)获取的界面上的梯度值始终为0,而后处理中界面上的VOF gradient不是0。
UDF如下:
- /* UDF to define a simple mass transfer based on SunDongliang's equation. */
-
- #include "udf.h"
- #include "sg_mphase.h"
- DEFINE_MASS_TRANSFER(liq_gas_source_Sun, cell, thread, from_index, from_species_index, to_index, to_species_index)
- {
- real m_lg; // mass transfer rate on the interface, kg/s/m3 ;
- real T_SAT = 373.15; // saturated temperature, K
- real h_lg = 2257600; // evaporation enthalpy, J/kg
- real vof_cutoff = 0.05;
- real vpVofT; // dot product of temperature gradient and volume fraction gradient
- real v_sx; // volume fraction gradient dx
- real v_sy; // volume fraction gradient dy
- Thread *liq, *gas;
- liq = THREAD_SUB_THREAD(thread, from_index);
- gas = THREAD_SUB_THREAD(thread, to_index); // from_index and to_index are defined in the Mass panel of Phase interaction.
- m_lg = 0.0; // Initial value of m_lg.
-
- if (NULL != THREAD_STORAGE(gas,SV_VOF_G))
- {
- v_sx = C_VOF_G(cell, gas)[0];
- v_sy = C_VOF_G(cell, gas)[1];
- }
-
- if ((C_VOF(cell, liq) > vof_cutoff) && (C_VOF(cell, liq) < (1-vof_cutoff)))
- { // Evaporating, and it will be added to vapor phase governing equation
- vpVofT = v_sx*C_T_G(cell, thread)[0] + v_sy*C_T_G(cell, thread)[1];
- printf("v_sy: %f \n", v_sy);
- printf("TempGradx: %f \n", C_T_G(cell, thread)[0]);
- printf("dot product of TempGrad and VOFGrad: %f \n", vpVofT);
- m_lg = 2/h_lg*C_K_L(cell, gas)*vpVofT; //NV_DOT(C_VOF_G(cell, gas), C_T_G(cell, thread));
- }
- return (m_lg);
- }
复制代码
麻烦各位给分析下,先行谢过! |
|