Is there a pressure gradient in a stationary gas with a temperature gradient? Consider a gas with ideal equation of state $P = n k_{\rm B} T$, in a fixed rectangular container with two opposite walls maintained at different temperatures, under conditions where there are no convection cells and a steady state has been achieved. This is a setup one might use to measure thermal conductivity, for example.
Is there a pressure gradient in such a gas?
Before you answer "no" (which is the answer I have seen in various sources, including answers on this site), consider the following. The argument for no pressure gradient is that if there were then any given layer of gas would have different pressures on either side and so would be subject to a net force so would accelerate so the conditions can't be stationary. This condition is
$$
P = \mbox{const} \Rightarrow n T = \mbox{const}
$$
where by const here we mean independent of position as well as time.
However, the flux of particles from one layer to another is proportional to
$$ 
n \bar{v} \propto n \sqrt{T}
$$
where $\bar{v}$ is the mean speed which is proportional to the local $\sqrt{T}$,
so in order to reduce this flux to zero we will require
$$
n \sqrt{T} = \mbox{const}.
$$
(This is like the argument for equalization of effusion between two chambers separated by a wall with a small hole.)
I think that in steady state, for the chamber as described, there cannot be a net flux of particles, because particles cannot penetrate the walls, but there can be a pressure gradient because the walls can sustain one. I therefore did a more thorough calculation via kinetic theory with a position-dependent Maxwell-Boltzmann distribution and I got an answer intermediate between the above two answers, namely
$$
n T^\nu = \mbox{const}
$$
where the exponent $\nu$ is approximately $0.72$.
If this is correct then what is wrong with the seemingly incontrovertible argument for uniform pressure? Conversely, if the pressure is uniform then what is wrong with my argument about diffusive particle flux?
Added note: for clarity, you can assume the temperature gradient is in a vertical direction if you like, but really I want the case where gravity is entirely negligible. Maybe I should not have mentioned convection, but I wished to make it clear that there is no streaming flow anywhere in the gas in the situation under discussion (this does not rule out diffusion).
 A: There is no pressure gradient.
The way to see this is to find a static solution to the equation of fluid dynamics. The Euler equation is
$$
\partial_t\vec{v}+(\vec{v}\cdot\vec{\nabla})\vec{v} = -\frac{1}{\rho}
\vec\nabla  P.
$$
We want a static solution with no fluid flow, $\vec{v}=0$. This means that $\vec{\nabla}P=0$, and the pressure is constant throughout the fluid. This conclusion is not modified by dissipative stresses (the Navier-Stokes equation), because dissipative stresses are automatically zero if $\vec{v}=0$.
The other fluid dynamic equations are the continuity equation, and the equation of energy conservation. Continuity is
$$
\partial_t\rho + \vec\nabla (\rho\vec{v}) =0 
$$
which is automatic if $\rho$ is static and $\vec{v}=0$. Energy conservation is more interesting. We have
$$
\partial_t{\cal E}+\vec\nabla \cdot\vec\jmath_\epsilon = 0
$$
where ${\cal E}$ is the energy density, and $\vec\jmath_\epsilon$ is the energy current. Including thermal conduction we have
$$
\vec\jmath_\epsilon = \vec{v}({\cal E}+P) -\kappa\vec\nabla T .
$$
For a static solution $\vec\nabla\cdot \vec\jmath_\epsilon=0$. If $\vec{v}=0$ we have $\nabla^2 T=0$ (assuming $\kappa$ is not a function of density or temperature, which is not quite right, but a reasonable approximation). This means temperature varies linearly
with distance.
Finally, we have to use the equation of state. Pressure is given by $P=P(\rho,T)$. Here we assume the ideal gas form $P=\rho T/m$. Since $T$ varies linearly, $\rho$ has to vary as $1/(const +x)$. This is consistent with continuity, the Euler equation, and energy conservation.
Finally: Is this consistent with kinetic theory? It must be, because fluid dynamics can be derived from kinetic theory. But one may ask how this happens microscopically.
In kinetic theory the density of the fluid is
$$
\rho(x,t) = \int d^3p \, f_p(x,t)
$$
where $f_p(x,t)$ is the distribution function of the constituents (atoms, for example). The fluid velocity is
$$
\vec{v} = \int d^3p \,\frac{\vec{p}}{m} \, f_p(x,t)
$$
and the energy current is
$$
\vec\jmath_\epsilon = \int d^3p \,\frac{\vec{p}}{m} \frac{p^2}{2m}
\, f_p(x,t).
$$
In the present case we seek a solution where $T$ varies linearly with distance, there is no flow, $\vec{v}=0$, and $\vec\jmath_\epsilon\sim \vec\nabla T$.
This can be done, as shown in many textbooks on kinetic theory. The standard trick is to write $f_p$ as a small perturbation of the Maxwell distribution
$$
  f_p(x) = f_p^0(x) (1+\psi_p(x)), \;\;\;
  f_p^0(x)=\exp\left(\frac{\mu(x)-p^2/(2m)}{T(x)}\right)
$$
and find a $\psi_p(x)$ that generates an energy current, but not a particle current. This $\psi_p$ is of the form
$$
 \psi_p = (\vec{p}\cdot\vec{\nabla} T) \chi_p
$$
and we have to fix $\chi_p$ such that the first moment (which defines $\vec{v}$) vanishes, but the third moment (which gives the energy current) does not. This is just an excercise in orthogonal polynomials, and $\chi_p$ is proportional to a Legendre polynomial.
Note that $\psi_p$ does not modify the equation of state. The pressure tensor is isotropic and $P=nT$. Also, we can adjust $\mu$ such that $\nabla\mu = (\partial \mu)/(\partial T)|_P \, \nabla T$, and the pressure is constant.
Finally, the overall constant is fixed by inserting this ansatz into the Boltzmann equation. The detailed solution depends on the form of the collision term, although there are popular approximations (the "relaxation time" or BGK form), for which the solution is easily found analytically. The answer is that the ansatz given above, for a suitable $\chi_p$ with vanishing first moment, indeed satisfies the Boltzmann equation, and the collision term just fixes the thermal conductivity. For the BGK form one gets the well known result
$$
 \kappa \sim \rho c_P \frac{\tau T}{m}
$$
where $c_P$ is the specific heat, and $\tau$ is the collision time.
Postscript: What happens if the mean free path is comparable to the size of the box? This is not relevant to real gases (unless at very low pressure) in  macroscopic containers, but it can of course be studied using the Boltzmann equation in the Knudsen limit. This can be done, but I suspect that the details will depend on exactly what happens at the walls. Also, without collisions, macroscopic variables like pressure and temperature are no longer well defined.
A: 
The argument for no pressure gradient is that if there were then any given layer of gas would have different pressures on either side and so would be subject to a net force

This argument is natural and correct only for liquids and dense gases where collisions are the dominant mechanism of transfer of momentum with matter inside the control volume (the layer).
With such material mediums, pressure gradient is not possible in stationary state (Pascal's law). The only way to have pressure gradient is if the fluid moves.
However the situation you describe may be possible for rare enough gas, like the effusion example hints. The above argument stops working when the particle density in the gas layer gets too low. Mean paths get so long and collisions become so rare that momentum transfer with the control volume is no longer predominantly due to collisions, but rather due to particles coming/ceasing to be part of the control volume. The fluid model and Pascal's law are no longer to be trusted.
In such "ballistic" regime, impulse transferred to the control volume from one half-space, per unit area, can't be function of gas pressure $p$ only. Probably density of particles becomes relevant too.
A: Let's say the gross flux of particles from one layer to another is $F(x)$.
Then, point $x$ is losing $2F(x)$ particles to its neighbors and gaining $F(x-dx)+ F(x+dx)$ from its neighbors. Side note: the net flux across any boundary drawn at $x$ is stuff coming from $[x+dx]$ minus stuff from $[x-dx]$, or $F(x+dx)-F(x-dx)$. And the accumulation of stuff would be the difference of what is crossing boundaries.
We enforce $F(x-dx) - 2F(x) + F(x+dx) = 0$, which is more general than the strict requirement that $F(x-dx) = F(x) = F(x+dx)$
To 2nd order:
$$F(x-dx) = F(x) - F'(x)dx + \frac{1}{2}F''(x)dx^{2}$$
$$F(x+dx) = F(x) + F'(x)dx + \frac{1}{2}F''(x)dx^{2}$$
So now we find that $F''(x) = 0$, rather than $F(x)=0$.
This is in line for our expectations for diffusion (consider heat diffusion).
In practice, the diffusion constant in air is very small. The mean free path in air is something like 68 nm. So the pressure gradient necessary to counter the effect of diffusion should also be very small, but I have to accept that it must exist. To provide some context, a particle in air random walks $\sqrt{(68\,\mathrm{nm})\cdot(343\,\mathrm{m/s})\cdot(1\,\mathrm{s})} = 5$ millimeters in a second and $5$ cm in a hundred seconds. It does not take much of a pressure gradient to undo that random walk.
I believe this would be the relevant parameter: https://en.wikipedia.org/wiki/Knudsen_number
I can't seem to find a formulation of Navier-Stokes from Fokker-Planck which takes diffusion into account and directly compares pressure gradients with the effect of diffusion, so I would be curious if anyone else can.
A: You are making an incorrect assumption here when you are suggesting that a pressure gradient can not be associated with a steady state situation. When you are sitting at home in an unheated (or evenly heated) room, this is certainly a steady state (there is no movement of air) but yet there is a pressure gradient (as you can show by releasing a helium balloon). In this case the pressure gradient is due to a density gradient caused by gravity (the gradient of the gravitational potential energy). Any temperature gradient added to it would lead to an adjustment of the density gradient so that the pressure gradient equals again the external force.
A: The answer of Thomas is correct; after learning from it I looked into this some more and I am adding this answer to provide more details for anyone interested.
The question was two-fold: whether the pressure is uniform in a stationary gas with a temperature gradient, and if so then what is wrong with a simple argument concerning diffusion which suggests the pressure may not be uniform.
The answer is that the pressure is uniform, and the simple argument about diffusion fails to account correctly for the non-isotropy of the velocity distribution. So let's look at that argument a little more fully.
The pressure is uniform because the gas is in mechanical equilibrium and if the pressure were not uniform there would be a bulk flow to restore mechanical equilibrium.
In a hard sphere model of a gas there are no long-range forces between molecules, and in this case the pressure in the $i$'th direction is owing purely to the flux of momentum:
$$
P_i = \langle m v_i n v_i \rangle = m n \langle v_i^2 \rangle
$$
where the mean is over the velocity distribution (and $m$ is mass of a particle of the gas; $n$ is number density). Hence we have
that
$$
P_x + P_y + P_z = n m  \langle v^2 \rangle
$$
Thus the sum of the pressures in the three directions is proportional
to the density of kinetic energy. In a non-equilibrium condition the standard definition of temperature in this area of physics is such that it is related to the kinetic energy:
$$
T = \frac{1}{3 k_{\rm B}} m  \langle v^2 \rangle.
$$
In consequence if $P_x = P_y = P_z = P$ then the equation of state
$$
P = n k_{\rm B} T
$$
holds at each location in the case of a stationary gas with a temperature gradient. Hence when we assert that $P$ is uniform we are asserting that $n T$ is uniform.
The situation is therefore that the regions at lower temperature have higher density, and therefore the ordinary diffusion rate (which is proportional to $n T^{1/2}$) will be higher in the low temperature regions. This suggests that there would be diffusion against the temperature gradient. However this cannot be so if the gas is in a stationary condition, hence the task becomes to explain why this diffusion is not happening. The answer is simply that the non-isotropy of the velocity distribution at each point is just sufficient to exactly counter this diffusion.
The main lesson I draw from this is that the argument widely used in simple presentations of kinetic theory, where thermal conduction is estimated by calculating an energy flux as molecules move between layers separated by a mean free path, is too simplistic even as a rough picture, because that same model would also suggest the molecules themselves are diffusing, on average, in the reverse direction, which we know to be false. But if a model makes one prediction known to be false, then we cannot trust its other predictions. Therefore I think this picture  ought not to be offered in entry-level presentations of kinetic theory. Instead we need a model which takes into account the relevant issues while still being as simple as possible for an entry-level course.
A much better model, still imperfect but simple enough for teaching purposes, is to treat the Boltzmann equation with the BGK (Bhatnagar–Gross–Krook)
operator on the right. It turns out that this approach makes predictions that make physical sense. This model gets the usual formulae for the transport coefficients (diffusion; viscosity; thermal conduction) with numerical factors which are approximately correct but not exactly right at lowest order in mean free path. So it does not replace Chapman-Enskog theory which is considerably more involved and not suitable for an introductory course. But the use of the BGK operator as collision term in the Boltzmann equation leads to an easy solution, and this is able to show how thermal conduction can happen while the velocities are distributed such as to present no net diffusive flux of the particles themselves either with or against the temperature gradient. Therefore I will now join with others here in Oxford who think  we need to abandon the over-simplistic treatment and teach kinetic theory with a little more depth as part of core content in an undergraduate physics course.
A: For semi-equilibrium in a gas in a container in a gravitational field, the only pressure gradient would be that required to provide the necessary buoyant force.  (The higher temperature gas would need to be at the top of the container, and the heat would be rapidly distributed.)
A: The answer to the first part: We know there is no pressure gradient by the fact that the box is not accelerating. Conservation of momentum violations can be called bootstrap violations. Asking if the gas could ever push on the box, when there is no external force acting inside the box (like gravity), makes lack of gradient obvious. Even more so than gas layers not accelerating does. In zero gravity, a free-body diagram of the box/gas system has no force of any kind. A free body diagram of the box itself has only differential pressure from the gas. The only way out of this is if that gradient is absent.
If gravity is present, there is a pressure gradient. And this is how the gas contributes its own weight to the system if you put the box on a scale in a vacuum; it does so using the pressure gradient inside the box. (And if weighing it in the atmosphere, this is how the gas inside stops the external pressure gradient from making the box seem to weigh less than it does).
On the second part: We at least know the density is varying as we go (including assuming zero gravity). For a given layer of constant n, v varies between layers. Or, for a given layers of constant v, n varies between layers. It’s important to be clear in the model which one it is.
