# Analytical solution of transient barometric formula for fluid in one dimension

Consider a column of fluid of length $$L$$, with initial density $$\rho_0$$ and initial velocity ($$u_0 =0$$) everywhere. Now at time $$t=0$$ gravity is switched on. No-slip boundary conditions are assumed at both end of the fluid column.

We know that after a while column will attain a steady state with fluid everywhere at rest and density as exponential function of distance from either end.

Continuity equation is $$\begin{eqnarray} \frac{\partial\rho}{\partial t} + \frac{\partial(\rho u)}{\partial x} = 0 \end{eqnarray}$$

Navier-stokes equation for fluid in one dimension is

$$\begin{eqnarray} \rho\left[\frac{\partial u}{\partial t} + u \frac{\partial u}{\partial x} \right] &=& -\frac{\partial P}{\partial x} + f_{external} \nonumber \\ &=& -\frac{\partial\rho}{\partial x}c^2_s - \rho g \end{eqnarray}$$ Here I assume shear forces are zero since the system is one dimensional.

In the steady state $$u=0$$ and $$\frac{d\rho}{dt} = 0$$ so we get, $$\begin{eqnarray} \frac{d\rho}{dx}c^2_s &=& - \rho g \\ \frac{d\rho}{\rho} &=& - dx \frac{g}{c^2_s} \\ \rho &=& \rho'\exp\left(-\frac{g}{c^2_s}x \right) \end{eqnarray}$$

where $$\rho'$$ is evaluated by mass conservation equation. $$\begin{eqnarray} \rho_{0} L = \int^{L}_0\rho'\exp\left(-\frac{g}{c^2_s}x \right)dx \end{eqnarray}$$

Where I assume hydrostatic pressure ($$P$$) is proportional to density ($$\rho$$). Is it possible to solve these equations (assuming they are correct) as a function of time? To start with, I tried to get velocity ($$u$$) profile for the time very close to initial time. When the time is really small $$t<<1$$, For the Navier-Stokes equation we assume spatial variation in density($$\rho$$) and velocity($$u$$) is yet to develop, so that we get $$\begin{eqnarray} \frac{du}{dt} &=& -g \\ u &=& -gt \hspace{0.5cm} t <<1 \end{eqnarray}$$

I am not sure if it is allowed to assume initial spatial variation small compared to time variations in the system. Even if allowed, I am not able to go any further.

Also I feel the solution for density and velocity depend upon viscosity of the fluid but viscosity appears nowhere in the formulation. Do I need to include shear forces?

• What do you want to solve exactly? As you say everthing is at rest and thus $u=0$. Jul 25, 2014 at 17:35
• @Bernhard I am looking for exact solutions of $\rho(t), u(t)$. $u$ is zero everywhere initially and at steady state but in between it is not zero. Jul 25, 2014 at 17:59
• Ah, I see what you mean. Did you actually calculate the steady state density distribution? This would be a first step. Then, you assume $d\rho/dx=0$ at th boundaries, but that is not what the exponential profile statisfies? Or am I missing something here? Jul 25, 2014 at 18:14
• @Bernhard, I have also mentioned the steady state solution. Flux is $\rho u$ so that if $u=0$, flux is zero at boundaries. I should write zero flux instead of noflux in the question. Jul 25, 2014 at 18:22
• It is good to write down complete boundary conditions indeed. Jul 25, 2014 at 18:38

You could solve numerically the first problem that you postulate, but the solution will not converge to the steady state solution you solve later.

In the initial condition that you propose and in the steady state solution, in both cases the energy of the fluid is purely gravitational, since it is not moving. But the homogeneous column has more potential energy than the one associated to the barometric solution. Therefore, for any consistent solution that evolves from your initial condition that would have more mass concentrated in the lower parts of the pipe, there will be a remanent of kinetic energy that will keep the fluid moving. As @maze-cooperation indicates, since there is no viscosity you do not have a way to dissipate this energy.

On a purely especulative side note, I would expect the time dependent solution to evolve toward something like a barometric solution, plus a density wave traveling back and forth through the pipe.

• I agree with this density wave solution, the density column "falls" down and then rebounds off the lower plate Aug 4, 2014 at 8:57
• We should it as an ansatz. Aug 4, 2014 at 10:30
• I have looked at analytical and numerical solutions of this problem. If you solve the above equations for the density you indeed see an initially homogeneous profile evolving to the barometric equation. However note that the momentum is assumed constant in that description. If you additionally the dynamics of the momentum, then density waves traveling back and forth are also obvserved. Oct 13 at 9:19

I don't think you can solve this problem analytically, as it is highly nonlinear (so no spectral methods) and you cannot do any seperation of variables or similar as far as I can see. I'm not even sure that you will reach a steady state since you don't have any energy dissipation mechanism and there might appear sound waves the moment you switch on gravity. Moreover, you have Robin boundary conditions: from $u=0$ at $x=0$ we get

$$(-c_s^2\partial_x \rho - \rho g )|_{x=0}=0$$

from the Navier Stokes equation . The problem is essentially two-dimensional with (x,t) as the variables. The only way out is to solve it numerically. However, you'll probably run into troubles with these boundary conditions. Maybe some lattice Boltzmann method will do the trick. I know that these can treat various boundary conditions easily but I never personally implemented one of these.

• I don't see any reason to use the lattice Boltzmann method over any other method. Especially not when it comes to boundary conditions. Aug 3, 2014 at 6:37
• Ahh ok, then maybe it's possible to use simple finite differences and construct a ghost cell such that the boundary condition is satisfied in every step. Aug 4, 2014 at 8:43
• I think for all methods people constructed implementations for these kind of boundary conditions. Aug 4, 2014 at 8:46
• @alekhine do you actually want us to propose numerical methods, since you explicitely asked for a analytical solution? Aug 4, 2014 at 8:51
• In the comments to the question he wrote that he wants the analytical solution to validate his numerical method. Aug 4, 2014 at 9:02

It turns out you can solve this analytically. Here is the paper Am. J. Phys. 77, 240–243 (2009).

Overall, the authors approach the problem by solving the Fokker-Planck equation with homogenous initial data, a given diffusion constant characterizing the gas or fluid, and a homogenous external force corresponding to gravity. They decompose the solution as a discrete sum over linear modes and they derive the coefficients of this representation.

Please note that this method assumes an overdamped system where the velocity does not change in time. Therefore this time-dependent solution neglects some transient effects related with fast oscillations (sound modes).

• While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review Oct 13 at 10:20
• I have updated the answer with an explanation. Oct 13 at 14:56