The penalty immersed boundary method and its application to aerodynamics