Temperature dependence of the free energy of nanoporous materials