In this work, a numerical study of turbulent flow and heat transfer in a plane channel was carried out. The features of secondary flows of Prandtl's 2nd kind, which arise in the vicinity of longitudinal ribs on the channel walls, are studied under conditions of spatial inhomogeneity of the flow. Simulations of four turbulent flows were carried out: flows in a smooth channel uniform in length, a uniform ribbed channel, as well as flows in a smooth and ribbed channel with an average velocity varying along the length. It is found that the presence of a rib in a homogeneous channel in the considered case significantly changes the distribution of turbulent flow characteristics over the channel section. These changes are due to the action of the emerging secondary flow with a maximum velocity of 5.2% of the average flow rate. In this case, changes in the velocity and thermal characteristics are similar. Both friction and heat transfer increase by about 10% due to the increased wetted surface area. The inhomogeneity of the flow, which is provided by the organization of blowing and suction through the upper wall of the channel, leads to more noticeable changes. In areas where the flow slows down, the fluid moves under conditions of an unfavorable pressure gradient. The intensity of turbulent pulsations in these places increases noticeably. In the presence of ribs, this leads to a significant increase in secondary flows. Both in the smooth and in the ribbed channel, an increase in the Reynolds analogy coefficient to a value of 1.07 was recorded, which is 6% higher than the uniform flow index. In general, based on the results of this work, we can conclude that the longitudinal ribbing is hardly capable of significantly changing the thermal-hydraulic properties of a flat surface in a turbulent flow, at least without taking special optimization measures. The spatial inhomogeneity of the flow, on the contrary, due to the different effects on the velocity and temperature profiles, has a certain potential for designing heat exchange devices with more suitable thermal-hydraulic properties.