Changes between Version 31 and Version 32 of u/ehansen/buildcode
- Timestamp:
- 11/14/11 14:49:29 (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
u/ehansen/buildcode
v31 v32 48 48 [[BR]] 49 49 == The HLLC Solver == 50 The HLLC solver is different in that it computes an approximation for the fluxes directly rather than using a Riemann problem solution to calculate the exact fluxes. In order to calculate the approximate fluxes, the HLLC solver needs values for the pressure and velocity in the star region. This can be done using the same guess procedure* mentioned in the exact Riemann solver description.50 The HLLC solver is different in that it computes an approximation for the fluxes directly rather than using a Riemann problem solution to calculate the exact fluxes. The basic idea is to assume a wave configuration of three waves which separate four constant regions. The two middle regions form the star region, so the HLLC solver needs values for the pressure and velocity in the star region. This can be done using the same guess procedure* mentioned in the exact Riemann solver description. These values are then used to compute various wave speeds, and the wave speeds are in turn used to compute the fluxes. 51 51 52 52 [[BR]] 53 53 == The Roe Solver == 54 The Roe solver is different from all other solvers presented on this page because it makes an approximation to the Riemann problem itself and then solves that problem exactly. The Roe method takes the Riemann problem and linearizes it by assuming a constant coefficient matrix instead of a Jacobian matrix as mentioned in the Riemann problem section. 54 The Roe solver is different from all other solvers presented on this page because it makes an approximation to the Riemann problem itself and then solves that problem exactly. The Roe method takes the Riemann problem and linearizes it by assuming a constant coefficient matrix instead of a Jacobian matrix as mentioned in the Riemann problem section. The eigenvalues and eigenvectors of this new linear system are then computed. Then, a parameter known as the ''wave strength'' is computed. The wave strengths are found from projecting the difference of the data across a cell boundary onto the eigenvectors. Lastly, the fluxes can be computed using corresponding eigenvalues, wave strengths, and eigenvectors. 55 56 The original Roe method has trouble at sonic points inside rarefactions. It will produce waves known as rarefaction shocks which violate an entropy condition. Values from the star region can be used to fix this problem. A simple way to obtain these values is to use the same guess procedure* from the other two Riemann solvers. These star region values define new eigenvalues that are to be used near sonic points. Thus the entropy problem is resolved. 55 57 56 58 [[BR]] 57 59 === * A Note on the "Guess" Procedure === 58 Since all three Riemann solvers use this procedure, I thought it was important to explain it in more detail. The guess procedure is essentially an adaptive non-iterative Riemann solver. It uses three different approximate Riemann solvers which are all based on the exact solver: the Primitive Variable Riemann Solver (PVRS), the Two Rarefaction Riemann Solver (TRRS), and the Two Shock Riemann Solver (TSRS). It chooses which solver to use based on the initial conditions.60 Since all three Riemann solvers use this procedure, I thought it was important to explain it in more detail. The guess procedure is essentially an adaptive non-iterative Riemann solver. It uses three different approximate Riemann solvers: the Primitive Variable Riemann Solver (PVRS), the Two Rarefaction Riemann Solver (TRRS), and the Two Shock Riemann Solver (TSRS). These solvers are all easy to implement and involve simple approximations. The program chooses which solver to use based on the initial conditions. The PVRS is similar to the Roe solver in that it linearizes the Riemann problem, but it then makes simpler approximations to compute the solution. The TRRS and TSRS are both based on the exact Riemann solver. These basically assume a particular wave configuration and use those simple solutions as opposed to a sampling procedure. 59 61 60 62 [[BR]] … … 124 126 [[BR]] 125 127 == The MUSCL-Hancock Scheme == 128 The MUSCL-Hancock scheme achieves second order accuracy by adding a few more steps to the process. The essential idea here is that instead of using the initial data directly we are going to alter the data slightly. This process is known as ''reconstruction''. Instead of having constant data across a cell, we give the data a slope. In other words, the data in each cell is now represented by a sloped line rather than a flat line. This methodology can achieve second order accuracy, and other methods can give higher order accuracy. For example, representing the data as a quadratic could achieve third order accuracy and so on. 129 130 === 1. Compute a limited slope === 131 The first thing one usually thinks to use for a slope is the difference of data states across a cell boundary. However, this will produce what are known as ''spurious oscillations'', because a simple difference can overestimate the desired slope. This is why most methods use some type of limited slope. This can be computed directly or via a ''slope limiter''. The slope limiter is another parameter that is just multiplied by the original slope to keep it from becoming too large. 132 133 === 2. Reconstruct the data === 134 Once a suitable slope is found, it can be used to compute what are known as ''boundary extrapolated values''. These are the extreme points of the data located at the intercell boundaries. This data is then evolved in time by half of a time step via a formula similar to (9). Now we have the fully reconstructed, evolved data. This data is then used to solve the Riemann problem, and the process proceeds exactly as the first order Godunov method. 126 135 127 136 [[BR]] … … 135 144 * Impose CFL condition to get appropriate time step 136 145 * Begin flux calculation procedure 146 * Calculate a limited slope (MUSCL only) 147 * Reconstruct the data (MUSCL only) 137 148 * Solve local Riemann problem (exact, HLLC, or Roe) 138 149 * Use solution from Riemann solver to compute fluxes … … 143 154 * Output data to a file 144 155 156 The MUSCL only steps can easily be omitted to obtain the first order Godunov results. 145 157 [[BR]] 146 158 == Test Results ==