# Temperature updating UDF

 Register Blogs Members List Search Today's Posts Mark Forums Read

 August 21, 2023, 11:24 Temperature updating UDF #1 New Member   Join Date: May 2022 Posts: 3 Rep Power: 4 Greetings everyone. I have made this UDF code that is part of a larger whole, but right now I'm concentrated in this temperature change section. I want to see how the temperature of the inlet, which simulates the evaporation rate of a small pool in a fully diffusive manner (no wind current), changes. Account for the flow rate and convective heat transfer from the surroundings, I have the following code: DEFINE_PROFILE(temperature,t,i) { real T_Face, M_Face,MF_rate, V_mag, A_dish, HTC; face_t f; HTC = K/0.0002; A_dish = 0.003619; begin_f_loop(f,t) { /*Mass flow rate estimation*/ V_mag = pow((pow(F_U(f,t),2)+pow(F_V(f,t),2)+pow(F_W(f,t), 2)),0.5); MF_rate = V_mag*A_dish*F_R(f,t); /*Mass estimation*/ F_UDMI(f,t,1) = F_UDMI(f,t,2)-0.05*MF_rate; /*Current mass value*/ M_Face = F_UDMI(f,t,1); /*Temperature estimation*/ F_UDMI(f,t,3) = F_UDMI(f,t,4); /*Current temperature value*/ T_Face = F_UDMI(f,t,3); F_PROFILE(f,t,i) = T_Face-((DHev*MF_rate*0.05)/(M_Face*Cp))+((HTC*A_dish*0.05*(293.15-T_Face))/(M_Face*Cp)); F_UDMI(f,t,4) = F_T(f,t); /*Save current temperature for the next timestep*/ F_UDMI(f,t,2) = M_Face; /*Save current mass for next timestep*/ Message("M_face= %f", M_Face); } end_f_loop(f,t) As you see, I account for the previous time step temperature and mass reduction from the pool through F_UDMIs, but they don't seem to be updating. Do you think you could help me? Thanks a lot, Fabio.

 August 21, 2023, 12:21 #2 New Member   pavan vemula Join Date: Jun 2022 Posts: 3 Rep Power: 4 Sometimes it can be due to an option in fluent in the run calculation tab called as update profile interval if you set to 1 and try again it might help

 August 22, 2023, 01:42 #3 Senior Member   Alexander Join Date: Apr 2013 Posts: 2,363 Rep Power: 34 Code: `F_UDMI(f,t,1) = F_UDMI(f,t,2)-0.05*MF_rate;` F_UDMI(f,t,2) is not define for the irst times step __________________ best regards ****************************** press LIKE if this message was helpful

 August 29, 2023, 12:50 #4 New Member   Join Date: May 2022 Posts: 3 Rep Power: 4 Right, this value is defined during the initialization step. To tell the truth, the code does work, but results are not what I expected. Due to the nature of diffusive evaporation, not including the temperature change in the simulation while estimating the evaporation is not a big deal, thus I did do some simulations where I can get a mass flow rate with a constant temperature. With this mass flow rate, I can use the data listed in the equation to estimate how the temperature profile SHOULD behave (it would lose 1 K in 12 minutes, which makes sense). Instead, my model loses 10 K (in fluent) in 12 minutes, by evaporating 1 g of liquid in that time. This is very excessive. From the code above, what could lead to this gross overprediction? I have checked all values possible. The only one being actively calculated by the model is the mass flow rate, that is in the order of 10e-6 Kg.

 Tags heat and mass transfer, udf code, udmi.uds