A Generalized Wellbore and Surface Facility Model, Fully Coupled to a Reservoir Simulator