BC for compressible flows
Dear all,
A basic problem, which I thought should be quite simple, puzzles me a long time... For compressible simulations (still subsonic, Mach is about 0.7) of flow passing a square block, the mesh is Cartesian and the scheme is MacCormack. I tried different boundary conditions of the pressure on the block surface, for instance: extrapolation from two internal points (as said in Anderson's book), zero gradient pressure (i.e. p_surface=p_1), or from the continuity eq. to update pressure etc. But none of them can work satisfactorily and finally the density runs to negative around the corner. Could anybody give me suggestions? Many thanks. 
Just hold the pressure and density from the nearest cell on the wall surface. Make sure velocity components are rotated properly to make zero normal component on the wall (for Euler solver).

The exit boundary condition is usually tied to some extent to the inlet boundary condition. For example a "total pressure" condition at the inlet and a "static pressure" condition at the exit. What is your inlet condition?
Zero gradient on pressure is usually fairly stable even though physically incorrect in most situations. Are you violating a stability limit during the initial bang? 
Dear Andy,
Thanks. The outlet is given static pressure and the inlet is from extrapolation of two interior points' pressure, because I specify the inlet velocity (both direction and magnitude). From the visualization I found around the corner a lot of fluctuation. I think it is mainly from the corner and solid BC, but much less relevant to inlet and outlet, because the 'wrong' region is far from them. Am I right? 'Are you violating a stability limit during the initial bang ', I am not quite clear about this point. Do you mean that the initial value still need to be reasonable? I thought even an initial field is not 'good', it will evolve toward the final solution (the problem is timedependent). Also no way to have a good initial field. Thanks again for your help. Quote:

Dear Duri,
Thanks. I tried different BC, including yours (let pressure gradient =0 and the wall temperature is fixed.) But always failed. One observation may be helpful: I reduced the inlet velocity a bit, it can work. Do you have any idea about the problem? If the mesh is very coarse, is it also OK? (I found from Anderson's book that the grid Re should be <30~50, but my case is much larger ~1000) If you have a similar code to let me share? If yes, I will greatly appreciate! Quote:

Are you solving Euler equations or NS equations. Whether implicit or explicit. Time stepping etc. Give more details for better understanding of the issue. And also what kind of boundary condition at inlet and exit (characteristics or physical).

I am solving the NS equations, using the explicit MacCormack scheme. Time step is from the stability criterion and much smaller time step was also tried, but still diverge.
Because flow is subsonic, inlet BCs are: velocity (magnitude and direction) and temperature are given and the pressure is extrapolated; for outlet, the static pressure is given and u,v,w and T are extrapolated from two interior points along the flowing direction. For the corner points in the channel, I tried many different possibilities for pressure: like average of two adjacent surface points', equal to the diagonal cell point's pressure etc. Results are always the same. Quote:

BC's and time stepping are seems to be correct. It could be the problem with code also. Please do the following to ensure there is no bug in the code.
1. Simple rectangular duct with symmetry on top and bottom should work, it will give almost zero residual make sure it doesn't blows up later. 2. Full supersonic flow like flow over ramp. (if this fails problem is with time stepping and possibly scheme). if these two are working then problem is certainly with subsonic boundary conditions. Don't extrapolate from two interior points just use the value from the nearest cell. First order bc is sufficient enough to start with. 
some time ago I worked on compressible flows using an unstructuredbased code. I used to solve the continuity equation at wall on a nonsymmetric FV, then the temperature and finally I computed the pressure at wall

The flow around a square block will probably be supersonic if the freestream Mach number is Mach 0.7. I'm not sure the MacCormack scheme is stable for the corners of your block. You may need to add artificial dissipation. The fact that it works if you lower the inlet velocity seems to indicate this.
You've mentioned "square block" and "channel". If the square block is in a channel at Mach 0.7 then the flow may be choking. Lowering the inlet velocity would also help this. 
All times are GMT 4. The time now is 16:18. 