## 3 Wettability Alteration
### Injection of Surfactants and Ionized Fluids  
Surfactants are a unique group of chemical compounds capable of altering the interfacial tension between different phases, such as oil and water. The primary goal of using surfactants is to reduce this interfacial tension to minimal values, which is a crucial aspect of efforts to alter oil wettability.  
Positively charged surfactant particles interact electrostatically with negatively charged carbonates in crude oil, forming ionic pairs [48]. This interaction of ionic pairs is reinforced by hydrophobic interactions between the surfactants and the tails of the oil components [49].  
Since the formation of ionic pairs is associated with intense interactions between them, it is assumed that the desorption of organic material and the alteration of wettability occur [50]. When a surfactant interacts with Mg\({}^{2+}\) ions, it leads to the removal of adsorbed carbonates from the surface, resulting in a more water-wet surface due to the action of the surfactant (see Figure 16).  
Figure 16: Proposed mechanisms of wettability alteration for oil-wet calcite surfaces after treatment with magnesium chloride solution: (**a**) magnesium ions may replace calcium ions on the surface and desorb the Ca\({}^{2+}\)–carboxylate complex, thereby altering the surface wettability; (**b**) magnesium ions may interact with adsorbed carboxylate, bind with the carboxylate group, and remove the carboxylate from the surface [50].  
Figure 15: The wettability angle of sandstone and oil in the presence of solutions with varying mass fractions [47].  
The study by [PERSON] et al. [51] demonstrated that the adsorption of cationic surfactants on carbonates is lower compared to anionic surfactants with similar hydrophilic chain lengths. This effect can be enhanced by adding multivalent cations. Additionally, it was found that the addition of alkali significantly reduces the adsorption of anionic surfactants on carbonate surfaces, as noted by [PERSON] et al. [52].  
Concentrations of the cationic surfactant C12 TAB equal to or exceeding the critical micelle concentration (CMC) can alter the wettability of carbonate rocks more effectively than anionic surfactants, as established by other researchers [53]. However, [PERSON] et al. [54] did not find a clear correlation between oil recovery and CMC.  
Studies have shown that anionic surfactants have a minor impact on wettability alteration, even when efforts are made to shift it toward a more water-wet state [26; 55].  
Various ions present in the injected water, such as Na+, Ca2+, Mg2+, and SO42+, play a crucial role in altering wettability toward a water-wet state, leading to a significant increase in additional oil recovery [56].  
Sulfate (SO42) plays a dominant role in altering wettability in carbonate rocks at high temperatures [57]. An increase in sulfate concentration enhances oil recovery [58]. However, studies have shown that sulfate alone does not significantly affect wettability without the introduction of magnesium [59; 60]. In high-salinity brine solutions, sulfate is not suitable as a modifier due to the potential for CaSO4 precipitation, which can lead to precipitation [61].  
[PERSON] studied the effect of various imidazolium-based ionic liquids on wettability alteration by measuring contact angles [62]. He systematically investigated parameters such as rock type, type and concentration of fluids, temperature, pressure, and salinity. The results revealed significant changes in static wettability angles upon the addition of ionic liquids (ILs), indicating a shift toward a more water-wet state, particularly noticeable in oil-saturated samples [62]. Figure 17 illustrates the effects of different ionic liquids on contact angles when interacting with oil, rock, and seawater for (a) brine-saturated and (b) oil-saturated rocks at 25 \({}^{\circ}\)C.