The principle of superposition is commonly utilized in the analysis of current transport under dark and light conditions for several different types of solar cells. However, this principle assumes that the photocurrent is voltage independent and that the diode injection current is generation independent, which restricts its validity. Indeed, the superposition principle cannot be applied to most thin-film solar cells because the above mentioned assumptions are not generally valid. In order to address this issue, a novel numerical modeling approach is described that allows independent computation of the photocurrent and of the diode injection current as components of the total current under illumination. Then, using several test cases, where the principle of superposition breaks down, the usefulness of this modeling approach is demonstrated.