Version 41 (modified by 12 years ago) ( diff ) | ,
---|

# The Godunov Method for Euler Equations, using EXACT Riemann Solver

## Big Picture

- Define a piece-wise function of initial data

- Solve the IVP for the conservation laws, but with modified (discretized) initial data to get the solution for the next time level

- This produces local Riemann Problems (LRPs), centered on intercell boundaries.

- Solve these local RP's, and use solution to compute fluxes

- Use these fluxes to update cells.

Here is a picture of the situation:

In this picture, WL and WR denote the arrays of primitive fluid variables (namely, rho, u, P) designated as the values of those variables at the adjacent cell centers, the asterisk indicates a star region that is bound by two outgoing arrows, the arrows indicate the wave pattern generated in the LRP, F is the numerical flux (described below), and the conservative formula is given by the Godunov scheme, also presented below.

If we were to blow the left star region up (on the intercell boundary between cell i-1 and i), what we would have is 3 non-linear waves (contact, shock(s) and/or rarefaction(s)) being generated at this boundary IF the left and right states (WL and WR) were different. If these states are the same, then NO non-linear waves would be generated. We would like to first find pstar, the value of pressure between the left and right waves, in the region so-called the "star region". Once this is known, we can determine the types of waves generated. Since they are propagating away from the intercell boundary, the exact values of the fluid variables along the intercell boundary depend on their relative speeds. We then would sample the solution to the LRP, along this boundary only. Once we have found the solution at this boundary, given by

we compute the flux at this boundary. These fluxes are the fluxes of the Euler equations, in conservation form. That is,

where gamma is the ratio of specific heats.

These fluxes are then fed into the Godunov scheme to update each (conserved) variable for each cell. In conservative form, the Godunov method is given by:

where

is the numerical flux (again, equal to the physical flux in the case of the God. method for the Euler equations) on the left boundary, and

is the flux along the right intercell boundary.

## The method

### Finding Pstar

Pstar is the solution for pressure in the "star region", which is set up at the intercell boundaries by the left and right cells involved in the local Riemann problems. This region is where the contact discontinuity lies, flanked on either side by a given combination of 2 shock or rarefaction waves. The first step at each intercell boundary is to solve for pstar. Pstar is found by Newton's iterative scheme, with the routine as it was in the Exact Riemann solver described before.

### Sampling the solution

Once Pstar is found to within a desired degree of accuracy, ustar is given immediately by a simple formula in Toro, chapter 4. These quantities are used to determine the combination of waves present along the intercell boundary. Once these are determined, we look for the speeds of the wave, relative to the grid speed, dx/dt = 0, which corresponds to the local intercell boudary. Depending on where the waves are, relative to this interface, the algorithm prescribes a density, velocity, and pressure for the boundary. These quantities are then used to update the cells, as described above.

### Constraining the time step

The time-step, is constrained by the CFL condition, which uses the max wave speed on the grid. The constraint used in the God. code here allows any given wave on the grid to travel a full delta_x in a time-step. In allowing this, we achieve a more efficient time-marching scheme, but with the assumption that wave interactions do not lead to wave accelerations. The CFL condition, rearranged for dt, is given by:

dt = CFL*dx/smax

Where CFL is a coefficient that ranges from 0<CFL<1. A CFL close to 1, produces the largest time step, but it should be used cautiously during times when errors can be produced, for which a smaller time step should be used. In the God. code described here, the CFL was reduced by 80% for the first 5 time steps of the code.

### Boundary Conditions

Transmissive boundaries were set up for the current code. These boundary conditions (BC's) theoretically do not produce waves at the boundary, and so allow waves to travel right through them. Such BC's are prescribed by setting the values of the fluid variables at the ghost zone cell equal to the adjacent physical cell. Thus, the local Riemann problem has WL = WR at the boundary of the physical and ghost domains, and so the solution is trivial (no wave generated).

### Variable transformations

The Exact Riemann Solver (contained in the separate module below — that includes routines to solve for pstar, ustar, and sampling along intercell boundary) uses PRIMITIVE variables, that is: density (rho), velocity (u), pressure (P). But, the Godunov scheme discretizes the Euler equations in CONSERVATIVE form, and so updating cells using this scheme, requires transforming to the conservative variables (density, momentum (p), energy (E)) updating them using Godunov formula, and then converting back to primitive form for use with the Exact Riemann Solver in the next time step. The transformation from primitive to conservative is as follows:

## The code

Here is an html version of the main program, with encompassing module, and problem.data file.

## Debugging

## Results

### Attachments (14)

- GodEulRho.png (19.0 KB ) - added by 12 years ago.
- GodEulP.png (21.1 KB ) - added by 12 years ago.
- GodEulU.png (22.3 KB ) - added by 12 years ago.
- God.2.png (50.2 KB ) - added by 12 years ago.
- God.png (50.2 KB ) - added by 12 years ago.
- LoopSR.png (44.1 KB ) - added by 12 years ago.
- program_out.png (28.7 KB ) - added by 12 years ago.
- God_density_init.png (12.8 KB ) - added by 12 years ago.
- God_density.png (21.5 KB ) - added by 12 years ago.
- GodDebug.png (72.1 KB ) - added by 11 years ago.
- test.png (5.8 KB ) - added by 11 years ago.
- test4.png (8.7 KB ) - added by 11 years ago.
- ExactTest4.png (29.1 KB ) - added by 11 years ago.
- GodTest4.png (37.9 KB ) - added by 11 years ago.

Download all attachments as: .zip

**Note:**See TracWiki for help on using the wiki.