The oil cooling method has been widely used in the permanent magnet synchronous motor with hairpin winding. Because of the irregular shape of the hairpin end winding, there are complex oil circuits in the fluid domain, resulting in a large number of grids and a high computational cost. It is still a challenge to calculate the oil‐cooling performance of the hairpin end winding. Therefore, the porous medium model (PMM) is first proposed to replace the real hairpin end winding to analyse the oil‐cooling performance. By comparing oil volume fraction and velocity at different oil‐supplied conditions using three methods: experiments, real model (the non‐equivalent fluid domain model based on the real hairpin end winding) and PMM, the feasibility of using the PMM to calculate the oil‐cooling performance on the end winding is verified. The oil distribution of three methods is the same. The use of the PMM saves 80% of the number of grids, which improves the simulation efficiency. Relationships between the porosity, permeability and resistance coefficient and the geometry parameters of windings are determined. The results show that the flow field changes greatly with changes in porosity, permeability and resistance coefficient.