# Pressure correction for compressible gas

 Register Blogs Members List Search Today's Posts Mark Forums Read

 June 9, 2017, 06:08 Pressure correction for compressible gas #1 New Member   Leonhard Schmalhorst Join Date: Nov 2015 Location: Munich, Germany Posts: 1 Rep Power: 0 Hi everyone, I'm trying to set up a solver in matlab for gas flowing through a fixed bed reactor. The equations i have are the momentum balances in axial and in radial direction and the mass continuity equation. So far, so good... My proceeding is as follows: Guess pressure field and velocity field Calculate axial velocity using the momentum balance in axial direction Calculate radial velocity using the momentum balance in radial direction Calcultate density field from continuity equation Calculate new pressure field using ideal gas law (I assume constant high temperatures, later i will solve the energy equation as well) Check for convergence If no convergence, go back to step 2 using the new calculated pressure field or only parts of it (e.g. ) Obviously, the steps 1-3 are the same as in nearly all algorithms. But since my algorithm does not work (oscillating residuals) i am not sure if steps 4 - 7 are correct. Does anyone has an advice for me? I'm thankful for every answer. Have a nice weekend, Cheers, Leo PS: Here are the equations i'm using: Momentum balance radial direction: Momentum balance axial direction: Continuity equation: Ideal gas law:

 June 11, 2017, 01:41 #2 Senior Member   Michael Prinkey Join Date: Mar 2009 Location: Pittsburgh PA Posts: 363 Rep Power: 23 Are your linear solutions for velocity components and density converging well at all stages of convergence? Are your velocity components collocated with your pressure and density data? Are you under-relaxing your velocity and pressure corrections? If your fields are collocated, you may have a pressure-velocity-density coupling problem. That can be fixed with either staggered grid configurations or Rhie-Chow interpolation for pressure. If you are not under-relaxing your pressure and velocity corrections, you likely need to. Or, perhaps, you need to use a pseudo-transient formulation and pseudo-time march to your solution. This is a common solution procedure for steady compressible flows. If your linear systems solutions are not converging well, you may need to do implicit under-relaxation to effectively solve for the relaxed velocity/density correction and generate a more diagonal dominate linear system that converges more quickly/robustly. Good luck.

 June 11, 2017, 14:23 #3 Senior Member   Lucky Join Date: Apr 2011 Location: Orlando, FL USA Posts: 5,061 Rep Power: 60 Leo, you have basically written down how to solve the continuity & momentum equations in a segregated approach (there's no energy equation). The approach is sound but you will likely have convergence difficulties due to the pressure-velocity coupling problem. Your steps 1-7 will become much more complicated. It's non-trivial how you go about solving this problem, but basically you need lots of under-relaxation. The problem is that after step #5, you momentum equation will no longer be satisfied (it is almost guaranteed, unless your simulation has already converged). This is why there are algorithms like SIMPLE & PISO to make an additional velocity/pressure adjustment. Or you will have to solve steps 2-6 iteratively. Btw in step #5, actually you also assume an initial temperature field in step #1. Solving the energy equation and any other transport equations should not be in the loop of steps 1-7 but a separate routine altogether. As soon as you try to bring in the energy equation, your problem becomes coupled and you have to solve one big matrix and solve for u, rho, p, and T simultaneously. The steps for solving that big system are very different.

August 5, 2017, 14:59
#4
Senior Member

Join Date: Aug 2011
Posts: 270
Rep Power: 14
Hi Istum,

In your model you do not solve the energy equation which is a relevant part of the compressible fluid flow model. I'm not sure you can solve an isothermal compressible flow, because as density and pressure change, the temperature should change too. In case the flow is really isothermal, the energy equation should simulate this characteristic. Thus it might explain your convergence problem.

If you aim to solve a compresssible flow you do not need to staggered your velocity. You can work with colocated variables and without the necessity to use RC interpolation.

Writting a code based on this algorithm is really simple. Less than 1000 lines using finite differences. You do not need internal sweeping between two consecutive time steps. This is very efficient.

Leflix
Attached Images
 compressible algorithm.jpg (93.2 KB, 17 views)

 Tags compressible, fixed bed, gas, pressure correction