The heat transfer in a square cavity filled with clear fluid or porous medium is numerically investigated in the present study. To change the heat transfer in the cavity a rotating circular cylinder is placed at the centre of the cavity. The ratio of cylinder diameter to cavity height is chosen as 0.8. Depending on the angular velocity of the cylinder the convection phenomena inside the cavity becomes natural, mixed, and forced. To keep the number of data low the Grashof number, Gr, is set to 10(6), while the parameter defining the convection regime in the cavity, Gr/Re-2, is changing from 0.0625 to 10(2). The Darcy number in the cavity is set to 10(-2), 10(-3), and 10(-4). Galerkin finite element method is used to solve the Navier-Stokes equations with Brinkman-Forcheimer extended Darcy's law, and energy equation in 2-D non-dimensional form. The solution methodology is compared and validated with the literature for a similar problem, and good agreement is achieved. The results are presented in terms of Nusselt numbers, velocity profiles and temperature contours. The results show that rotation is more effective in the forced convection regime than in mixed and natural convection regimes, and at high spin velocities the heat transfer is almost independent from the Darcy number. (c) 2006 Elsevier Ltd. All rights reserved.