For steady-state simulation, I want to assign the outlet temperature of one computing domain to the inlet temperature of another computing domain. I write the following code, but the simulation results show that the inlet temperature is always zero. I don’t know why. I hope you all Take a look at my UDF, thank you. UDF: #include“udf.h" DEFINE_ADJUST(T_out_in, d) { real NV_VEC(A); real sum_T_A = 0.0; real sum_A = 0.0; real outlet_temp; int i; #if !RP_HOST Domain *domain; Thread *threadOutlet1; Thread *threadInlet2; domain = Get_Domain(1); threadOutlet1 = Lookup_Thread(domain, 44); threadInlet2 = Lookup_Thread(domain, 43); for(i = 0; i < THREAD_N_ELEMENTS_INT(threadOutlet1); i++) { F_AREA(A,i,threadOutlet1); sum_A+=NV_MAG(A); sum_T_A+=NV_MAG(A)*F_T(i,threadOutlet1); } #endif
#if RP_NODE sum_A = PRF_GRSUM1(sum_A); sum_T_A = PRF_GRSUM1(sum_T_A); #endif node_to_host_real_2(sum_A, sum_T_A); #if !RP_NODE outlet_temp = sum_T_A/sum_A; Message("\n temp of outlet2 is %g\n", outlet_temp); #endif host_to_node_real_1(outlet_temp); #if !RP_HOST for(i = 0; i