If the well were only open to one layer, the discharge, Q, would be specified in that layer.

Given that this well is defined as open to all the layers, a common approach is to divide the total Q with the Q in each layer proportional to the transmissivity, T, of each layer.

HOWEVER! if the top layer is unconfined, or becomes unconfined during pumping, an inordinate amount will be allocated to that layer

Worse yet, if the top layer were to "go dry" then that portion of the discharge would be omitted from the simulation.
An alternative approach is to define a small grid cell to represent the wellbore. It is assigned a K that is numerous orders of magnitude (without sacrificing model stability and mass balance) greater than the formations, and storage parameters of 1.0. The discharge is then withdrawn from the lowest cell in which the well is open. Of course, the adjacent grid cells must gradually increase in size away from the well