CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Pressure correction for compressible gas

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 9, 2017, 06:08
Default Pressure correction for compressible gas
  #1
New Member
 
Leonhard Schmalhorst
Join Date: Nov 2015
Location: Munich, Germany
Posts: 1
Rep Power: 0
lstum is on a distinguished road
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:
  1. Guess pressure field and velocity field
  2. Calculate axial velocity using the momentum balance in axial direction
  3. Calculate radial velocity using the momentum balance in radial direction
  4. Calcultate density field from continuity equation
  5. Calculate new pressure field using ideal gas law (I assume constant high temperatures, later i will solve the energy equation as well)
  6. Check for convergence
  7. If no convergence, go back to step 2 using the new calculated pressure field or only parts of it (e.g. p_{new} = p_{old} + 0.5 (p_{new} -  p_{old}))

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:

- \frac{\partial p}{\partial r} - f_1 u - f_2 \sqrt{u^2 + v^2} u + \eta _{eff} (\frac{\partial}{\partial r} (\frac{1}{r} \frac{\partial ru}{\partial r}) + \frac{\partial^2 u}{\partial r^2}) - \rho ( u \frac{\partial u}{\partial r} + v \frac{\partial u}{\partial z} ) = 0

Momentum balance axial direction:

- \frac{\partial p}{\partial z} - f_1 v - f_2 \sqrt{u^2 + v^2} v +  \eta _{eff} (\frac{1}{r} \frac{\partial}{\partial r} (r\frac{\partial v}{\partial r}) + \frac{\partial^2 v}{\partial r^2}) - \rho ( u  \frac{\partial v}{\partial r} + v \frac{\partial v}{\partial z} ) = 0

Continuity equation:

\frac{1}{r} \frac{\partial r\rho u}{\partial r} + \frac{\partial \rho v}{\partial z} = 0

Ideal gas law:
p = \rho \cdot R \cdot T
lstum is offline   Reply With Quote

Old   June 11, 2017, 01:41
Default
  #2
Senior Member
 
Michael Prinkey
Join Date: Mar 2009
Location: Pittsburgh PA
Posts: 363
Rep Power: 23
mprinkey will become famous soon enough
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.
mprinkey is offline   Reply With Quote

Old   June 11, 2017, 14:23
Default
  #3
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,061
Rep Power: 60
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
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.
LuckyTran is offline   Reply With Quote

Old   August 5, 2017, 14:59
Default
  #4
Senior Member
 
Join Date: Aug 2011
Posts: 270
Rep Power: 14
leflix is on a distinguished road
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.

the overall algorithm reads as follow see the attached jpg file:


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
File Type: jpg compressible algorithm.jpg (93.2 KB, 17 views)
leflix is offline   Reply With Quote

Reply

Tags
compressible, fixed bed, gas, pressure correction

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Wind tunnel Boundary Conditions in Fluent metmet FLUENT 6 October 30, 2019 13:23
SIMPLE algorithm does not converge when using old pressure (correction) values andreasp Main CFD Forum 3 February 9, 2016 22:18
Gas Diffusion and Pressure Distribution Xuekun Main CFD Forum 0 October 29, 2015 11:10
Using ideal gas law to simulate pressure decline Björn Mattsson FLUENT 5 September 5, 2005 05:03
Hydrostatic pressure in 2-phase flow modeling (long) DS & HB Main CFD Forum 0 January 8, 2000 16:00


All times are GMT -4. The time now is 03:34.