A statistical mechanical formalism is presented for the calculation of the thermodynamic properties of the water in nanopores of polymer electrolytes, with particular emphasis on the polarization. We describe a method that exploits the variational properties of the Ornstein-Zernicke integral equation.