Advanced well simulation in a multilayered reservoir.