wiki:u/erica/2D_Godunov

Version 4 (modified by Erica Kaminski, 11 years ago) ( diff )

Introduction

The method I chose for practice writing a higher dimension code is the 1st order accurate, split scheme, Godunov + Exact Riemann Solver to solve the 2D Euler equations for a cylindrical explosion. Given the higher dimension of the problem, new types of waves are present in the solution, namely shears. Shears are passively advected with the flow, as can be shown by combining the continuity equation and the corresponding momenta equations.

Initialization

This method begins by initializing a 2D Cartesian grid, with a circle in the center. The primitive fluid variables (rho, x-velocity, y-velocity, pressure) are set inside and outside of this circle.

The essence of split schemes

It can be proven for linear systems of equations of higher dimension, that splitting the problem into x and y components yields an exact solution. For non-linear systems, the effort leads to a highly accurate (but not exact) solution. The concept is as follows.

We begin with a 2D mesh of initial condition

To solve the Euler equations for this given initial condition, we split the 2D Euler equations into 2, 1D initial value problems (IVPs). In the x-split direction, we have

and in the y-direction we have,

Note that the first 3 equations of these IVPs are just the 1D problem we have solved before. The difference is 1) the extra momentum equation, and 2) the presence of the tangential velocity components that factor into E.

Now, the 2 IVPs are solved on the grid independently. First the grid is sweeped in the x-direction, where it goes cell by cell on a given row and solves the IVP given by the x-split equation above + the initial condition prescribed for the mesh. Once a row is is traversed, the next is traversed, until all of the grid has been solved in the x-split direction. This, by the way, is done the "normal" way— using the Godunov conservative update formula in conjunction with the exact Riemann solver.

The solution data for the x-split mesh is then stored in a 2D array, and used as the initial condition for the y-direction sweep. The sweep proceeds as above, this time moving cell by cell along a given column solving the IVP given by the y-split Euler equations above (and initial condition that is the SOLUTION to the previous x-split sweep). Once a column is traversed, the next is followed up until the entire grid is sweeped. The solution to this last sweep is the solution to the full IVP (evolved to t+dt).

This process repeats for as many dt's needed to get to the final time of the simulation. Note, the dt is the SAME for both the x- and y-sweeps.

The method of choosing the best dt is described in Toro, chapter 16.

Upsides / Downsides

The good aspects of this choice of method (split, Godunov + Exact Riemann Solver) are: 1) accurate resolution of shear waves, 2) simple to construct.

The downside is: 1) not higher order (if wanted to add this - code could become quite complex to take into account the addition of shears into the TVD algorithms)

Download the code here

Results for cylindrical explosion

Attachments (3)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.