CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   CFX & Tait EOS (https://www.cfd-online.com/Forums/cfx/148130-cfx-tait-eos.html)

fivos February 4, 2015 16:07

CFX & Tait EOS
 
3 Attachment(s)
Hi to everyone,

I have implemented the Tait equation of state in CFX in order to simulate the propagation of waves inside a weakly compressible liquid (such as water). The EOS has the form:

p(rho) = B*((rho/rho0)^n-1)-pref

where B=rho0*c0^2/n and rho0 and c0 are the reference density and speed of sound respectively. For water these are rho0=998.2kg/m3 and c0=1500m/s (also lets assume that pref=0Pa).

I have tried to check how this model works in a shock tube case. For comparison I have used a density based solver of mine and the exact Riemann solver. The shock tube has: (x<0, rho=1050kg/m3, U=0, p=136897106.1) and (x>0, rho=999kg/m3, U=0, p=1804442.093). The computational mesh is trivial and Cartesian, with a span from -2 to 2 and a resolution of dx=0.004.

The analytic solution with the exact solver is:
rho_star=1025.152kg/m3
u_star=40.462m/s
p_star= 65917422Pa

As can be seen in the image, the density based solver (blue line) get the Riemann solution correctly. On the other hand, even if CFX (red line) predicts more or less the same pattern, it produces lots of wiggles and underesimates the u_star.

The settings used in CFX can be found in the attached ccl. Briefly:
- 2nd order backward Euler in time
- High resolution for advection
- compressible timestepping = t
- global max courant 0.75

Indicative output is posted in the out_sample.zip file. It is a sample, since I cannot upload the full out file, but more or less the pattern is the same, the MAX residuals are well below 10^-5 and the variable ranges are reasonable (no variable clipping..).

Has anyone else experienced this? Are there any suggestions on how to improve the performance of the solver, while maintaining high accuracy for the resolution of pressure waves?

Any thoughts are welcome.
Thanks in advance

ghorrocks February 4, 2015 16:30

These wiggles are a well known result of the numerical discretisation in a mesh based Navier Stokes solver. I discuss this in my PhD where I used 1D shock tube flow as a validation case: https://opus.lib.uts.edu.au/research/handle/2100/248 section 5.2, and there is lots of literature and textbooks on this topic as well.

In short:
* The wiggles are inherent in a second order discretisation.
* You can eliminate the wiggles by going to first order but then you loose fidelity of the shock wave.
* The hi-res advection scheme is about as good as you are going to get in CFX to reduce them.
* Likewise for temporal discretisation. Second order gets you closer to the ideal shock wave but gives you wiggles. First order reduces the wiggles but has more diffusion.
* A finer mesh will reduce the wiggles
* A time step sensitivity study can also reduce the wiggles.

fivos February 4, 2015 17:47

Hi ghorrocks,

thank you for your answer, I will take a look in your Phd, however I do not completely agree with your explanation. A pure (i.e. unlimited) second order solver (or higher) will produce numerical overshoot/undershoot and this is natural and well known (as Godunov theorem, numerical dispersion ,gibbs phenomenon etc...). However no one uses an unlimited high order scheme, because it is practically useless; something is introduced either slope limiting, flux limiting, or artificial viscosity to make the method Total Variation Diminishing (TVD). For example the density based solver of which the results I compared to CFX is 2nd order accurate in space (MUSCL & SuperBee limiter) and 4th in time (RK4), yet it does not produce significant wiggles, only some minor, hardly even noticeable at the shock wave.

I do not recall what exactly CFX uses for High Resolution, but I cannot believe that a code as CFX, oriented towards compressible stuff, LES, aeroacoustics and, generally, high fidelity simulations has not TVD schemes to prevent significant oscillations from building up, since these would ruin such simulations.

I think that this could be more related to inappropriate limiter choice or something like that.

Again thanks and any thoughts are welcome.

ghorrocks February 4, 2015 18:14

The Hires scheme in CFX is effectively a TVD scheme. See the theory manual for further details.

I do not know what density based solver you used for why it does not produce wiggles, but all pressure based CFD software I know produces wiggles or smears the shock wave. And all the CFD software I have used have some form of TVD scheme, so TVD does not eliminate the problem, just reduce it.

The results you posted have a lot of very high frequency wiggles at the shock. A lot more and much higher frequency than I normally see with my work. So in your case I suspect the unusual EOS is making the numerics additionally unstable to make the wiggles much worse than normal. What does it look like when you use ideal gas for your EOS?

(Yay! That is my 10000th post. That's a lot of typing :) )

fivos February 5, 2015 04:51

Hi ghorrocks,

The density based solver I am using is based on the work of Toro and Irvings (http://onlinelibrary.wiley.com/doi/1...O;2-S/abstract); essentially it is a primitive variable solver (p, u, rho), with MUSCL reconstruction and Superbee limiter. I did not say it does not produce wiggles; it does produce, but only minor (something similar to what you get in your phd - I agree with you that all high order schemes will produce some sort of wiggles, but not the mess I got..).

Probably, the oscillations are due to increased stiffness of the EOS I have used, i.e. small density changes produce large pressure changes. I have seen in the past that not that stiff EOS (like the ideal gas), do not cause so much wiggling..

In you PhD you used some more tricks, like modifying the standard Rhie-Chow pressure interpolation, quadratic timestepping (?) in CFX.. are these available in new CFX versions? (I have seen the Rhie-Choow option, but not the other modifications you mention in the phd).

Thanks in advance

ghorrocks February 5, 2015 05:24

My PhD was on CFX4. This was the structured mesh predecessor of the current unstructured mesh CFX. It was also a SIMPLE based solver so it had quite different numerics to the current CFX. So there will be options I used on my PhD which are not available in the current CFX.

As your EOS is quite stiff as you say I suggest you do some experiments with the CFX options for the Rhie-Chow, pressure interpolation and the other related stuff. Also have a look at the expert parameters. I bet you can find some options which reduce the wiggles. I do not often suggest playing with solver parameters but I suspect this is a case where it might be called for.

fivos February 5, 2015 12:22

Thanks ghorroks,

I will try to find if behaviour can be improved through advanced solver options/expert parameters.

And, by the way, I wish you to reach 100K posts :)


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