# perfect gas equation in rhoSimpleFoam

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

 October 4, 2017, 07:03 perfect gas equation in rhoSimpleFoam #1 New Member   ff Join Date: Feb 2010 Posts: 21 Rep Power: 9 Hi, I am trying to figure out how rhoSimpleFoam algorithm is working,especially when it is calculating density rho. In my case, I have a very bad convergence on pressure P. However, the Temperature, velocity and density field are closed to what I want. The problem is I found the pressure P is clearly not obey perfect gas state equation which I specified in thermophysicalproperty. I thought pressure or density is alway obey perfect gas state equation P=rho*R*T. But it looks like when pressure is not converged, there is violation. So I want to know how the density is calculated in rhoSimpleFoam. Is it calculated from pressure when this line rho = thermo.rho() is called in pcEqu ? Thanks very much.

 October 4, 2017, 11:23 #2 New Member   ano Join Date: Jan 2017 Posts: 22 Rep Power: 3 Hi fxzf, You can find the function thermo.rho() for your perfect gas in src/thermophysicalModels/specie/equationOfState/perfectGas/perfectGasI.H Code: template inline Foam::scalar Foam::perfectGas::rho(scalar p, scalar T) const { return p/(this->R()*T); } so it is as you assumed. So after this step the fields match the perfect gas law. Then the rest of the pressure coupling is applied. If the pressure convergence is low, what did you specify in your fvSolution? And can you tell us something about your case?

 October 5, 2017, 04:14 #3 New Member   ff Join Date: Feb 2010 Posts: 21 Rep Power: 9 Hi Ano, Thanks very much for your reply. In my case, I have a low speed aircraft with jet engine. I need to simulate the engine jet flow out of the exhaust pipe. In the exhause pipe, it has high temperature and high velocity when high massflow is applied. At low speed jet flow out (low mass flow) the rhoSimpleFoam is fine. However, when there is high velocity from engine (200m/s local Mach around 0.3 due to high temperature), the pressure is very oscillating and T max (max temperature) is very oscillating (about 100K up and low) as well. The solver is crashed often, so I have to make under relax factor for rho 0.01, pressure 0.01 to make rhoSimpleFoam working. I think I noticed is when rhoSimpleFoam solve pcEqu, it called perfect gas equation to calculate a rho. This rho is satisfy the perfect gas equation. However, afterward, there is rho.relax(). Because my under relaxation factor for rho is only 0.01. Then, the new rho is only based on relaxation which is not satisfy perfect gas equation. If pressure is well converged, this is not problem, but when pressure is not converged, we see this violation. Correct me if I am wrong for anything. So my problem is how to improve pressure and energy equation convergence in this case. At the moment, I use under relaxation for rho 0.01, pressure 0.01, U 0.5 to 0.7, e 0.2 to 0.6. If I use higher pressure, I saw more oscilation and solver crash sometimes. Are there anything else I can change to improve convergence? Thanks so much.

 October 10, 2017, 05:59 #4 New Member   ano Join Date: Jan 2017 Posts: 22 Rep Power: 3 Hi fxzf, I am not an expert myself. Generally I would see the point from the code like you described. What I would try to increase convergence: 1. If Ma approximately equal to 0.3, did you try to initialise with simpleFoam/pimpleFoam? 2. Switch the solver from smoothSolver/PCG to BiCGStab. This solver In a case I had to do it increased the convergence. You can find the forum discussion on BiCGStab and links for the code here.

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Mihail CFX 7 September 7, 2014 06:27 immortality OpenFOAM 7 June 25, 2013 06:53 saii CFX 2 September 18, 2009 08:07 Jake Cannon Siemens 0 January 16, 2007 18:13 Arun Siemens 1 April 23, 2004 05:48

All times are GMT -4. The time now is 21:00.