This research project has three objectives. The first objective is to develop a capability to predict and optimize the ability of gels to reduce permeability to water more than that to oil or gas. The second objective is to develop procedures for optimizing blocking-agent placement in wells where hydraulic fractures cause channeling. The third objective is to develop procedures to optimize blocking-agent placement in naturally fractured reservoirs. This research project consists of three tasks, each of which addresses one of the above objectives. Work is directed at both injection wells and production wells and at vertical, horizontal, and highly deviated wells.