The numerical simulation of nonisothermal effects during the filling stage of injection molding is investigated here. Generalized Newtonian fluid flows are simulated within thin cavities of arbitrary shape. The numerical scheme is based on a hybrid spatial discretization: classical low-order Lagrangian interpolants are used in the midsurface directions, while full polynomials constitute the approximation in the gapwise direction. Discrete equations are obtained by use of the Galerkin finite element method combined with a collocation procedure. Special attention is devoted to the influence of the fountain flow (occurring at the front) on the temperature field. A correct writing of the front thermal boundary condition is derived in agreement with the Hele-Shaw simplified form of the equations. Some illustrative results are presented.