[1] A two-dimensional model of magnetosphere-ionosphere coupling is presented. It includes Alfvén wave dynamics, ion motion along the geomagnetic field, chemical reactions between ions and neutrals, collisions between different species, and a parametric model of electron precipitation. Representative simulations are presented, along with a discussion of the physical mechanisms that are important in forming oxygen ion field-aligned plasma flows. In particular, it is demonstrated that ion upwelling is strongly affected by the ponderomotive force of standing Alfvén waves in the ionospheric Alfvén resonator, and by enhanced electric fields that are produced when electrons are heated by soft electron precipitation. It is verified that the simulations are in qualitative agreement with available theoretical predictions. In the resonator, in addition to the ponderomotive force, a contribution to the upflow comes from centrifugal acceleration. Heating by the current of standing waves increases parallel electric fields and ion pressure gradients only at low altitudes where they are easily balanced by friction with neutrals. This prevents development of fast field-aligned ion flows in the E-layer and lower F-layer.