Compared to single-phase heat transfer, two-phase microchannel heat sinks utilize latent heat to reduce the needed flow rate and to maintain a rather uniform temperature close to the boiling temperature. The challenge in the application of cooling for electronic chips is the necessity of modeling a large number of microchannels using large number of meshes and extensive computation time. In the present study, a modified porous media method modeling of two-phase flow in microchannels is performed. Compared with conjugate method, which considers individual channels and walls, it saves computation effort and provides a more convenient means to perform optimization of channel geometry. The porous media simulation is applied to a real chip. The channels of high heat load will have higher qualities, larger flow resistances, and lower flow rates. At a constant available pressure drop over the channels, the low heat load channels show much higher mass flow rates than needed. To avoid this flow maldistribution, the channel widths on a chip are adjusted to ensure that the exit qualities and mass flow rate of channels are more uniform. As a result, the total flow rate on the chip is drastically reduced, and the temperature gradient is also minimized. However, it only gives a relatively small reduction on the maximum surface temperature of chip.