Aerodynamics of smooth and turbulent flows past stationary and oscillating square cylinders