Patent Document ID: 7640149
Application ID: 11294962
Patent Flag: 1

Claim One:
1. A method for optimizing production of a reservoir having one or more wells having downhole valves, comprising: (a) running, using a processor, a reservoir simulator in a forward simulation to generate a multi-segmented well model; (b) processing, using the processor, outputs from the multi-segmented well model to generate intermediate partial derivatives of flow equations for the one or more wells and for the reservoir; (c) combining, using the processor, the intermediate partial derivatives of the well flow equations and the reservoir flow equations in the reservoir simulator; (d) solving, using the processor, an adjoint system of linear equations at regular time intervals to calculate a set of adjoint gradients of an objective function with respect to control parameters associated with the downhole valves; (e) determining, using the processor, from the adjoint gradients a search direction; (f) using the search direction to solve, using the processor, an optimization algorithm that maximizes an objective function using line-search methods; (g) locating, using the processor, a local maximum along the search direction and updating the control parameters; (h) using the new updated control parameters in the reservoir simulator to generate, using the processor, an updated multi-segmented well model; (i) repeating steps (a)-(i) until the updated multi-segmented well model converges on a maximized value of the objective function; and (j) adjusting control of the one or more wells in the reservoir based on the updated multi-segmented well model.