Modeling of nitride-based LEDs and laser diodes requires a fast modular tool for numerical simulation and analysis. It is required that the modeling tool reflects the primary physical processes of current injection, quantum well (QW) bound-state dynamics, QW capture, radiative, and nonradiative transitions. The model must also have the flexibility to incorporate secondary physical effects, such as induced piezoelectric strain fields due to lattice mismatch and spontaneous polarization fields. A 1-D model with a phenomenological well-capture process, similar to that developed by Tessler and Eisenstein, has been implemented. The radiative processes are calculated from first principles, and the material band structures are computed using k/spl middot/p theory. The model also features the incorporation of such effects as thermionic emission at heterojunctions. Shockley-Read-Hall recombination, piezoelectric strain fields, and self-consistent calculation of the QW bound states with dynamic device operation. The set of equations underlying the model is presented, with particular emphasis on the approximations used to achieve the previously stated goals. A sample structure is analyzed, and representative physical parameters are plotted. The model is then used to analyze the effects of incorporation of the strain-induced piezoelectric fields generated by lattice mismatch and the spontaneous polarization fields. It is shown that these built-in fields can accurately account for the blue-shift phenomena observed in a number of different GaN LEDs.