The recovery of oil from subsurface reservoirs often requires the injection of water or gas to maintain reservoir pressure and to displace the oil from injection to production wells. The design of an economically optimal recovery strategy is usually based on ’reservoir simulation’, i.e. large-scale numerical simulation of the flow of multi-phase fluids through strongly heterogeneous porous media with uncertain coefficients. Control of the recovery process is through prescribing time-varying pressures or flow rates in the wells. Efficient methods to optimize the recovery strategy make use of gradients of an economic objective function with respect to the well controls at every time step. These can be obtained efficiently with the aid of adjoint-based techniques. Constraints, in particular those that involve states (reservoir pressures or saturations) or outputs (measured well pressures or rates) require special treatment. Uncertainty in the coefficients can be incorporated through robust optimization over an ensemble of models. The limited controllability of the reservoir states offers scope for reduced-order modeling using techniques like proper orthogonal decomposition. ‘Closed-loop’ optimization can be performed through frequent repetition of the optimization during the producing life of the field in combination with updating the of the model coefficients based on production measurements. Moreover, an emerging technology is the operational use of model-based optimization which requires a combination of long-term and short-term objectives through multi-level optimization strategies.