Role of confinement in water solidification under electric fields