There are four fundamental mechanisms of foam generation in porous media, including snap-off, lamella division, leave-behind, and pinch-off . The snap-off mechanism is a crucial step in the formation of foam in porous media. This mechanism describes how bubbles form when gas pushes the gas-liquid interface into the groove of a pore and subsequently ruptures the interface. This leads to the creation of gas bubbles that are roughly equivalent in size to the pores present in the porous medium. Snap-off takes place when the capillary pressure at the constriction surpasses the capillary pressure at the leading edge of the interface . This process is influenced by various factors, including pore geometry, interfacial tension between the gas and liquid phases, and the flow rate of the liquid .