1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
| #include "udf.h" #include "sg_mphase.h" #define T_SAT 30.27 #define LAT_HT 1.e3
DEFINE_SOURCE(liq_src, cell, pri_th, dS, eqn) { Thread *mix_th, *sec_th; real m_dot_l; mix_th = THREAD_SUPER_THREAD(pri_th); sec_th = THREAD_SUB_THREAD(mix_th, 1); thi_th = THREAD_SUB_THREAD(mix_th, 2); if (C_T(cell, sec_th) >= T_SAT) { m_dot_l = -0.25 * C_VOF(cell, sec_th) * C_R(cell, sec_th) * fabs(C_T(cell, sec_th) - T_SAT) / T_SAT; dS[eqn] = -0.25 * C_R(cell, sec_th) * fabs(C_T(cell, sec_th) - T_SAT) / T_SAT; } else { m_dot_l = 0.1 * C_VOF(cell, sec_th) * C_R(cell, sec_th) * fabs(T_SAT - C_T(cell, sec_th)) / T_SAT; dS[eqn] = 0.; } return m_dot_l; }
DEFINE_SOURCE(vap_src, cell, sec_th, dS, eqn) { Thread *mix_th, *pri_th; real m_dot_v; mix_th = THREAD_SUPER_THREAD(pri_th); sec_th = THREAD_SUB_THREAD(mix_th, 1); thi_th = THREAD_SUB_THREAD(mix_th, 2); if (C_T(cell, thi_th) <= T_SAT) { m_dot_v = 0.1 * C_VOF(cell,thi_th) * C_R(cell, thi_th) * fabs(C_T(cell, thi_th) - T_SAT) / T_SAT; dS[eqn] = 0.; } else { m_dot_v = -0.1 * C_VOF(cell, thi_th) * C_R(cell, thi_th) * fabs(T_SAT - C_T(cell, thi_th)) / T_SAT; dS[eqn] = -0.1 * C_R(cell, thi_th) * fabs(C_T(cell, thi_th) - T_SAT) / T_SAT; } return m_dot_v; }
DEFINE_SOURCE(enrg_src, cell, mix_th, dS, eqn) { Thread *pri_th, *sec_th, *thi_th; real m_dot; pri_th = THREAD_SUB_THREAD(mix_th, 0); sec_th = THREAD_SUB_THREAD(mix_th, 1); thi_th = THREAD_SUB_THREAD(mix_th, 2); if (C_T(cell, mix_th) >= T_SAT) { m_dot = -0.25 * C_VOF(cell, sec_th) * C_R(cell, sec_th) * fabs(C_T(cell, sec_th) - T_SAT) / T_SAT; dS[eqn] = -0.1 * C_VOF(cell, sec_th) * C_R(cell, sec_th) / T_SAT; } else { m_dot = 0.1 * C_VOF(cell, thi_th) * C_R(cell, thi_th) * fabs(T_SAT - C_T(cell, thi_th)) / T_SAT; dS[eqn] = -0.1 * C_VOF(cell, thi_th) * C_R(cell, thi_th) / T_SAT; }
return LAT_HT * m_dot; }
|