Inside the pipe, the internal fluid volume temperature, T, increases due to the heat transfer from the temperature sources to the pipe wall. Since the direction of the mass flow rate through the pipe is from port A to port B, the fluid thermal energy also propagates in the direction of the mass flow rate, i.e., from the internal node to port B. Based on the upwind energy scheme, if the flow at port B is leaving the pipe, the specific internal energy at port B is equal to that in the pipe's internal fluid volume (u=u_B) and therefore the temperature at port B becomes equal to the internal fluid volume temperature (upstream of port B).
If you change the direction of the mass flow rate in the Mass Flow Rate Source (TL), the temperature at port A now becomes equal to its upstream temperature, i.e., the temperature of the internal fluid volume inside the pipe (T_A=T).
For more details on the upwind energy scheme implementation in the Thermal Liquid domain, please follow the documentation link provided below: