Cooling of electrical machines is nowadays of high interest in order to improve their efficiency. In railway applications, electrical motors can be shrouded in order to avoid particles to be deposited inside. To ensure a satisfactory cooling, pipes are placed inside the rotor and are thus rotating. Improvements in convective heat transfer inside the rotating pipes were numerically investigated. Model was first validated against experimental data and after that several geometry modifications were tested. Influence of the angle of attack of the fluid at the inlet to the pipe was discussed and it was shown that heat transfer can be significantly increased near the pipe inlet. In addition to that changing a circular pipe with an elliptical pipe was investigated in two ways: fixing the same hydraulic diameter or the same equivalent diameter. It was shown that the cooling efficiency can be significantly increased. The best overall heat transfer enhancement of about 45% exhibited elliptic pipes located orthogonal to the rotation radius and having the same cross-section as the reference circular pipes. Results can be used by designers of electrical machines in order to choose the best cooling strategy.