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

A good shcheme for 2D euler equations on carthesian grid

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 2 Post By naffrancois
  • 1 Post By Eifoehn4
  • 1 Post By naffrancois

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 29, 2022, 13:22
Default A good shcheme for 2D euler equations on carthesian grid
  #1
Member
 
Anders Aamodt Resell
Join Date: Dec 2021
Location: Oslo, Norway
Posts: 66
Rep Power: 5
ander is on a distinguished road
Hi

I'm creating a solver for 2D euler equations, and I would like some inputs on how to improve it.

What I have attempted at this point is the following:
  • I use a semi-discrete approach with an ODE solver. I have tried explicit euler and TVD_RK3
  • For the calculation of fluxes I have tested the Rusanov (local Lax Friedrich) method. I also tried to implement a HLLC solver.
  • To get second order spatial accuracy in smooth regions I have used The MUSCL approach with the minmod limiter. The fluxes which are originally calculated as F_{i+1/2,j}(U_{i+1,j},U_{i,j}) are now instead calculated as F_{i+1/2,j}(U_R,U_L) where U_R and U_L are the MUSCL extrapolated variables.
  • Before every timestep I loop around the whole grid and compute the new time step size given by the CFL condition. (I guess this is normal procedure).

I set up a 1D riemann problem as a test case for my solver, and noticed the following. The fields are smeared a lot more at discontinuities when using the TVD RK3 method than when using explicit euler, although the euler solution has some ripples, which are now gone. I guess the TVD RK3 method shouldn't give more smearing, or am I wrong?

I would like to hear if I have likely done some errors in my implementation, or if these results are to be expected.

Any suggestions on how to improve the solver, without switching to an entirely different solution strategy (Like Lax Wendroff) would also be much appreciated!
ander is offline   Reply With Quote

Old   January 29, 2022, 15:47
Default
  #2
Senior Member
 
Join Date: Oct 2011
Posts: 242
Rep Power: 17
naffrancois is on a distinguished road
Hello,

This really depends on what applications you have in mind. There isn't a single numerical framework better for everything. An example from what you already implemented: Rusanov approximate Riemann solver is a two-wave RS, HLLC a three-wave. What's the difference ? One practical difference is that HLLC catches stationary contacts exactly while Rusanov cannot by construction. Have you experienced this through a test case ? This is a necessary verification case for your HLLC solver, zero velocity initial condition, constant pressure and density discontinuity: HLLC maintains contact exactly over time while Rusanov smears it. Now add constant velocity, on coarse meshes you will see HLLC predicts sharper contacts than Rusanov. Now, Rusanov RS is very robust for high pressure jumps although/because it is more diffusive. Which one is better ?

Euler vs RGK. Accuracy of your solution is related to truncation errors, spatial AND temporal. Accuracy has to be understood in an asymptotic sense. For a given time step and grid a low order method may potentially give a better solution answer than a high order one. But in the end high order methods converge quicker and refining grids/time steps should show better accuracy for higher order methods. This is something you should experience and it will help verifying your code.

There are stability constraints to handle as well, Euler time integrator + 2nd order spatial scheme is not stable. This may not be so obvious on shock tubes with small pressure ratios but it becomes more evident with very strong conditions.

MinMod limiter tends to clip smooth extremas, you may try to experience it by working first with advection problems. Advect heaviside functions, gaussian profiles and compare with other limiters. Minmod acts also on smooth regions and degrades the accuracy. This is something you should consider to improve the accuracy of your code.

You should set up various test cases with your current schemes before going further. This will help you understand all the methods you put in your code.
Eifoehn4 and ugurtan666 like this.
naffrancois is offline   Reply With Quote

Old   January 30, 2022, 13:02
Default
  #3
Senior Member
 
Eifoehn4's Avatar
 
-
Join Date: Jul 2012
Location: Germany
Posts: 184
Rep Power: 14
Eifoehn4 is on a distinguished road
As additional Note:

The ripples for the explicit Euler method are quite obvious, since it is not stable with a seconde order reconstruction.

Quote:
I guess the TVD RK3 method shouldn't give more smearing, or am I wrong?
No that is not always true. The cause of the decay is the highly-diffusive first or seconde order spatial discretization. You may want a different view on this phenomenon by insert the Taylor expansion into your approximation.

Regards
naffrancois likes this.
__________________
Check out my side project:

A multiphysics discontinuous Galerkin framework: Youtube, Gitlab.
Eifoehn4 is offline   Reply With Quote

Old   January 31, 2022, 18:20
Default
  #4
Member
 
Anders Aamodt Resell
Join Date: Dec 2021
Location: Oslo, Norway
Posts: 66
Rep Power: 5
ander is on a distinguished road
Thanks for the nice replies.

I did the the stationary contact discontinuity test that you suggested and the HLLC solves it exactly while Rusanov smears it, so that's a good sign. I also notice that the contact discontinuity gets less smeared when using HLLC than Rusanov for Sod's problem and for the problem with initial velocity and density discontinuity.

Unfortunately it doesn't seem like the solution converges faster with RK3 than explicit euler at least for Sod's problem. I tried running the test with 400 cells and the explicit euler solution is clearly sharper, but as you say it is unstable and will perhaps fail for different problems.

I will do further tests when I have the time an perhaps try a different limiter. At this point I did the extrapolation on the primitive variables, instead of on the conserved variables directly because I have heard it can give better results.
ander is offline   Reply With Quote

Old   February 1, 2022, 04:13
Default
  #5
Senior Member
 
Join Date: Oct 2011
Posts: 242
Rep Power: 17
naffrancois is on a distinguished road
Hello,

Good job done with verifying hllc. Concerning TVD rk3, how do you assess convergence rate ? If you use a shock tube test, this is not the way to go. The reason is that your solution depends on two truncation errors, spatial and temporal. When checking solution dependence to the time-step size you need to be certain that the spatial error is much lower than the temporal one which in my opinion will not happen with a 400 nodes grid and a discontinuous flow (spatial truncation error is O(1) at the shock). Then, to check that your implementation of rk3 truly results in a 3rd order temporal scheme you may need a smooth test case on a rather fine grid, search for "method of manufactured solution" on the web.

By the way, you don't need a rk3 scheme to stabilise your 2nd order space scheme, SSP-rk2 is enough.

Extrapolating primitive variables is fine in most situations. Just make sure you do not violate thermodynamics, choose your set of primitives wisely: equation of state gives energy as a function of pressure and density and vice versa then you want to reconstruct two of the three variables and get third using EOS.

Good verification to do with a shock tube: close all boundaries with slip walls. Monitor total mass and energy by summing over all cells rho_i*V_i and rho_i*E_i*V_i where V_i is volume of cell i. This should be machine error constant assuming your scheme uses finite volume approach and it is indeed conservative.
FMDenaro likes this.
naffrancois 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
2nd Order Spatial accuracy: Euler Equation on Unstrutured Grid AshwaniAssam Main CFD Forum 1 February 7, 2015 20:06
Analytic solution for 2D steady Euler equations jojo81 Main CFD Forum 0 October 15, 2012 13:05
Euler computation on hybrid grid naffrancois Main CFD Forum 0 October 7, 2011 06:51
multigrid solution of 2d euler equations jim Main CFD Forum 2 May 21, 2002 05:05
Grid Independent Solution Chuck Leakeas Main CFD Forum 2 May 26, 2000 12:18


All times are GMT -4. The time now is 08:48.