CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

solvers for adiabatic compression of a perfect gas

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By dygu

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 4, 2019, 13:12
Default solvers for adiabatic compression of a perfect gas
  #1
Member
 
Mat
Join Date: Jan 2012
Posts: 60
Rep Power: 14
Mat_fr is on a distinguished road
Dear Foamers,

I am investigating the adiabatic compression of air (assumed to be a perfect gas).
During this process, the pressure must follow the law PV^Gama = constant.

To simulate this problem, I am squeezing my computational domain (DyM).
I use zero pressure gradient everywhere and zero temperature gradient also (adiabatic).

When using rhoCentralDyMFoam, the pressure satisfies approx. the PV^Gama = constant law.
As it is a density based solver, the drawback of this approach is the appearance of pressure wave and the need of small time step.

When using compressibleInterFoam however, there is a large underestimation of the pressure.

For rhoCentralDyMFoam, the thermophysical properties are:

thermoType
{
type hePsiThermo;
mixture pureMixture;
transport const;
thermo hConst;
equationOfState perfectGas;
specie specie;
energy sensibleInternalEnergy;
}
with standard properties (Cp, Pr, M) for air.

For compressibleInterFoam, the thermophysical properties are similar except for the type which is "heRhoThermo" in this case.
Would the type explain the difference in pressure between both solvers for the same simulation case ?
hePsiThermo is not available with compressibleInterFoam though.

I will gladly welcome any feedback on this issue.

Kind Regards,
Mat
Mat_fr is offline   Reply With Quote

Old   March 5, 2019, 05:05
Default
  #2
Senior Member
 
Olivier
Join Date: Jun 2009
Location: France, grenoble
Posts: 272
Rep Power: 17
olivierG is on a distinguished road
Hello,
You almost find your answer: compressibleInterFoam is a pressure based solver (heRhoThermo type), rhoCentral is a density based solver (hePsiThermo type). You can't swap a pressure based solver with a density based thermo type.

regards,
olivier
olivierG is offline   Reply With Quote

Old   March 5, 2019, 05:37
Default
  #3
Member
 
Mat
Join Date: Jan 2012
Posts: 60
Rep Power: 14
Mat_fr is on a distinguished road
Hi Oliver,

Thank you for your answer.
Would you know why the air is not following a perfect gas behavior with the pressure based solver then ? (although I specified "equationOfState perfectGas;")
Regards,
Mat
Mat_fr is offline   Reply With Quote

Old   March 5, 2019, 08:19
Default
  #4
Senior Member
 
Olivier
Join Date: Jun 2009
Location: France, grenoble
Posts: 272
Rep Power: 17
olivierG is on a distinguished road
hello,
Why do you use compressibleInterFoam, and not rhoPimpleFoam ?
because I guess you may have artificial second phase creation, which can explain a wrong PV^g conservation.
But the first candidate is that with pressure based solver, you should have a good convergence on pressure to get a good perfect gaz behaviour.
regards,
olivier
olivierG is offline   Reply With Quote

Old   March 5, 2019, 09:34
Default
  #5
Member
 
Mat
Join Date: Jan 2012
Posts: 60
Rep Power: 14
Mat_fr is on a distinguished road
Hi Olivier,
Thanks for your time!


I am using compressibleInterFoam, because I want to run two-phase simulation afterwards.
For the moment, it is single-phase only indeed, and I'm sure there is no second phase creation.


However, looking at the residuals, you are right, I have an unsatisfactory convergence behavior for pressure.

I've tried playing with the time step and the number of corrections steps, but without success at the moment.


Regards,
Mat
Mat_fr is offline   Reply With Quote

Old   February 19, 2020, 13:40
Default
  #6
New Member
 
Join Date: Feb 2020
Posts: 5
Rep Power: 6
dygu is on a distinguished road
Hi Mat,

I am working on a similar problem where I am using compressibleInterDyMFoam to squeeze a box of air using a moving wall approach and a sinusoidal pointDisplacement. In the images below, a pressure probe in the middle of the domain is compared to:
p = p0*(V0/V)^(1.4) where V=V0-amp*sin(2*pi*f*t) is the instantaneous volume based on a sinusoidal motion of one wall of the box.

I have found that I can get the anticipated PV^gamma behavior but only with very small time step size using the Euler dt scheme or by compiling the solver with the backward dt scheme option and running with a more reasonable dt at least 4x larger than with Euler. The images below compare the Euler and backward schemes using the same dt=0.01s.




I understand that the backward scheme can be unbounded and this is likely why it is not an option for the multiphase solvers. In a case of a cube of air with perfect hex cells, this scheme works very well. On more realistic industries grids with non-orthogonality around 65 deg and non-zero skew, the pressure / T solve blows up quite quickly with negative temperature when using the backward scheme.

I wonder if anyone has any hits as to how to stabilize the compressible multiphase solver with a 2nd-order time discretization scheme? I have tried the CrankNicolson scheme but it is very unstable unless the Euler-biasing is quite high and thus the benefit of the 2nd-order scheme is mostly lost.
EngMec likes this.

Last edited by dygu; February 19, 2020 at 18:02.
dygu is offline   Reply With Quote

Reply


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
reactingTwoPhaseEulerFoam - stability of subcooled boiling simulation Robin.Kamenicky OpenFOAM Running, Solving & CFD 20 September 20, 2021 10:15
Domain Reference Pressure and mass flow inlet boundary AdidaKK CFX 75 August 20, 2018 05:37
Gas pressure question Dan Moskal Main CFD Forum 0 October 24, 2002 22:02
Gas compression andreis CFX 4 August 1, 2002 10:48
Numerical methods in gas compression Oleg Main CFD Forum 0 January 15, 1999 05:46


All times are GMT -4. The time now is 23:40.