  We study the uniform electron gas with a gap model in the context of density
functional theory. Based on this analysis, we construct two local gap models
that realize generalized gradient approximation (GGA) correlation functionals
satisfying numerous exact constraints for the correlation energy. The first
one, named GAPc, fulfills the full second-order correlation gradient expansion
at any density regime, is very accurate for jellium surfaces, comparable to
state-of-the-art GGAs for atomic systems and molecular systems, and well
compatible with known semilocal exchange. The second functional, named GAPloc,
is satisfying the same exact conditions, except that the second-order gradient
expansion is sacrificed for a better behavior under the Thomas-Fermi scaling
and a more realistic correlation energy density of the hellium atom. The GAPloc
functional displays a high accuracy for atomic correlation energies, still
preserving a reasonable behavior for jellium surfaces. Moreover, it shows a
higher compatibility with the Hartree-Fock exchange than other semilocal
correlation functionals. This feature is explained in terms of the real-space
analysis of the GAPloc correlation energy.
