The inflow velocities in various components of many engineering systems often display variations in time (fluctuations) during the operation cycle, which may substantially affect the flow-induced vibrations and instabilities of these systems. For this reason, the aeroelasticity study of these systems should include the effect of the inflow velocity variations, which until now has not been taken into account. This paper presents a fluid-dynamic analysis of the unsteady confined viscous flows generated by the variations in time of the inflow velocities and by oscillating walls, which is required for the study of flow-induced vibration and instability of various engineering systems. The time-accurate solutions of the Navier–Stokes equations for these unsteady flows are obtained with a finite-difference method using artificial compressibility on a stretched staggered grid, which is a second-order method in space and time. A special decoupling procedure, based on the utilization of the continuity equation, is used in conjunction with a factored alternate direction scheme to substantially enhance the computational efficiency of the method by reducing the problem to the solution of scalar tridiagonal systems of equations. This method is applied to obtain solutions for the benchmark unsteady confined flow past a downstream-facing step, generated by harmonic variations in time of the inflow velocity and by an oscillating wall, which display multiple flow separation regions on the upper and lower walls. The influence of the Reynolds number and of the oscillation frequency and the amplitudes of the inflow velocity and oscillating wall on the formation of the flow separation regions are thoroughly analyzed in this paper. It was found that for certain values of the Reynolds number and oscillation frequency and amplitudes, the flow separation at the upper wall is present only during a portion of the oscillatory cycle and disappears for the rest of the cycle, and that for other values of these parameters secondary flow separations may also be formed.