In footnote 1 of Chapter 13 of Ashcroft and Mermin, they remark that
The only case we shall discuss in which the local equilibrium distribution is not the uniform equilibrium distribution (13.1) (with constant $T$ and $\mu$) is when the spatially varying temperature $T(\mathbf{r})$ is imposed by suitable application of sources and/or sinks of heat, as in a thermal conductivity measurement. In that case, since the electronic density $n$ is constrained (electrostatically) to be constant, the local chemical potential will also depend on position, so that $\mu(\mathbf{r}) = \mu_{equilib}(n, T(\mathbf{r}))$. In the most general case the local temperature and chemical potential may depend on time as well as position.
Note that (13.1) is simply the Fermi function with a local temperature and local chemical potential, in general.
My question is why can we say that $n$ is electrostatically constrained to be constant? In a measurement of thermal conductivity, we generally have an open circuit and in this case I suppose I can argue that there are therefore no macroscopic fields (and so $n$ must be constant, else there would be macroscopic fields). But if I am not at open circuit, why must this be the case? For example, if we are analyzing the Thomson effect, then I have both a temperature gradient and a current (not at open circuit). Is $n$ constant throughout my sample in this case too?