# I have a problem involving buoyant flow of an ideal gas under atmospheric conditions so that the height at a pressure boundary varies over a significant distance. When I set the pressure at the boundary, how can I specify it so that I don't see any spurious flows due to an inconsistent specification of the opening pressure?

 Specifying the pressure at a boundary for a buoyant problem where the height in the gravity potential field varies significantly requires care, particularly for an ideal gas.For an ideal gas, the pressure and density are related via the expression for the change in the hydrostatic pressure with height:dP/dy = -rho*g (assuming that the height variable is y and that gravity acts in the -y direction).It may be simplest to set the reference pressure for the domain to 0 and set the buoyancy reference density to zero as well.For an ideal gas, the density is given by PM/RT. Eliminating pressure using the ideal gas law and integrating for isothermal flow from some reference height L where the pressure is Pref and the density is rhoL gives:rho = rhoL*exp(Mg*(L-y)/R/T)and:P = Pref*exp(Mg*(L-y)/R/T)The conditions for this type of a pressure boundary should be set up so that the conditions of the dependent variables approach that of the known ambient fluid.A sample definition file for flow in a large 2D square box, with a height/width dimension of 300 m is attached.The fluid is set to be Air Ideal Gas. The pressure at the top of the box (y = L = 300 m) is set at 1 atm.The domain reference pressure is set to 0 and the buoyancy reference density to 0 as well. Gravity acts in the `y direction.At the outlet opening, the pressure is set to:P = rho*RT/M = rhoL*RT/M*exp(mg*(L-y)/R/T) = (1.0 [atm]*exp(M*g(L-y)/R/T)The temperature in this simulation is constant at 300 K.For an inlet velocity of 1 m/s, the streamlines and static pressure look reasonable. The streamlines go more or less straight across except where there is a disturbance due to flow around an internal wall.The online help suggests setting the buoyancy reference density to the average value prevailing in the domain. When you have a pressure boundary where the height and hydrostatic pressure varies, I would ignore the recommendation from the online help and choosea reference density that simplifies setting the hydrostatic pressure at the pressure boundary. I believe setting the reference density to zero allows one to calculate the pressure and density variation with height in the simplest manner.