A modification of the computational fluid dynamics code KIVA-II is presented that allows computations to be made in complex engine geometries. An example application is given in which three versions of KIVA-II are run simultaneously. Each version considers a separate block of the computational domain, and the blocks exchange boundary condition information with each other at their common interfaces. The use of separate blocks permits the connectedness of the overall computational domain to change with time. The scavenging flow in the cylinder, transfer pipes (ports), and exhaust pipe of a ported two-stroke engine with a moving piston was modeled in this way. Results are presented for three engine designs that differ only in the angle of their boost ports. The calculated flow fields and the resulting fuel distributions are shown to be markedly different with the different geometries. The calculated results indicate that: velocity profiles vary with time and are not uniform across the ports; boost port flow at high boost angles breaks up the toroidal vortices in the cylinder that are generated by the side ports and puts more fuel into the cylinder head dome and; trapping efficiency increases with increased boost angle. These results suggest that the computational methods developed in this work will be useful as a design tool for assessing the influence of engine design parameters on scavenging efficiencies in two-stroke engines.