We present a mathematical model for wettability alteration (WA) in fractured reservoirs. Flow in the reservoir is modeled by looking at a single fracture surrounded by matrix on both sides. Water is injected into the formation with a chemical component that enters the matrix and adsorbs onto the rock surface. These changes of the mineral surface are assumed to alter the wettability toward a more water-wet state, which leads to enhanced recovery by spontaneous imbibition. This can be viewed as a representation of "smart water" injection in which the ionic composition of injection brine affects recovery. The WA is described by shifting curves for relative permeability and capillary pressure from curves representing preferentially oil-wet (POW) conditions toward curves representing more-water-wet conditions. The numerical code was successfully compared with ECLIPSE for the specific case in which a fixed wetting state is assumed. Also, the relevance of the WA model was illustrated by modeling a spontaneous-imbibition experiment in which only a modification of the brine composition led to a change in oil recovery. The model can predict sensitivity to matrix properties such as wettability, permeability, and fracture spacing and to external parameters such as schedule of brine compositions and injection rate. Our model illustrates that one cannot use conventional reservoir modeling to capture accurately the behavior we observe. The rate of recovery and the level of recovery have a strong dependency on the component chemistry and its distribution. A significant feature of gradual WA by injecting a component is that the rate of fluid transfer is maintained between matrix and fracture. The resulting recovery profile after water breakthrough can behave close to linear as opposed to the square-root-of-time profile that is observed when the wetting state is fixed (Rangel-German and Kovscek 2002). The water will typically break through early as dictated by the initial POW state, but a higher final recovery will be obtained because higher saturations can imbibe. Improved understanding of the coupling between WA controlled by water/rock chemistry and fracture/matrix flow is highly relevant for gaining more insight into recovery from naturally fractured reservoirs.