Changes between Version 22 and Version 23 of u/erica/ExactRiemannSolver
 Timestamp:
 01/05/13 00:05:38 (12 years ago)
Legend:
 Unmodified
 Added
 Removed
 Modified

u/erica/ExactRiemannSolver
v22 v23 5 5 == Program Outline for Exact Riemann Solver == 6 6 7 Given the above properties of the Riemann problem, an algebraic expression can be derived which gives p in the central "starregion" (denoted by '*'). The overall structure of the Riemann problem then is to solve this algebraic equation for p*. Once p* is known, u* follows immediately. The remaining rho*_L and rho*_R follow from expressions valid for the specific L or R wave present. Specifically, this means that the code will determine at every point (x,t), that point's relative position to the different waves present. Once the position is determined, the solution is given by analytic expressions for the following five possibilities: pre or post shock, ahead of rarefaction head, behind rarefaction tail, or within the rarefaction fan. The position of each sampling point (x,t) is determined by a characteristic speed in the grid given by s = dx/t, where dx is the distance from the initial discontinuity to the sampling point (x,t), and t is the simulation end time. This s for every point on the grid can be compared to the known present waves, as their speeds are known exactly. In this way, the relative position of the sampling point with respect to the waves on the grid is determined, and hence the fluid variables a t that point.7 Given the above properties of the Riemann problem, an algebraic expression can be derived which gives p in the central "starregion" (denoted by '*'). The overall structure of the Riemann problem then is to solve this algebraic equation for p*. Once p* is known, u* follows immediately. The remaining rho*_L and rho*_R follow from expressions valid for the specific L or R wave present. Specifically, this means that the code will determine at every point (x,t), that point's relative position to the different waves present. Once the position is determined, the solution is given by analytic expressions for the following five possibilities: pre or post shock, ahead of rarefaction head, behind rarefaction tail, or within the rarefaction fan. The position of each sampling point (x,t) is determined by a characteristic speed in the grid given by s = dx/t, where dx is the distance from the initial discontinuity to the sampling point (x,t), and t is the simulation end time. This s for every point on the grid can be compared to the known present waves, as their speeds are known exactly. In this way, the relative position of the sampling point with respect to the waves on the grid is determined, and hence the fluid variables are given at that point. 8 8 9 9 === Exact Riemann Solver === 10 10 Attached here is the Exact RS program I wrote. It reproduces the results for the Toro tests, as can be seen in the next section. The program is broken up into the following routines: 11 11 12 1. Estimate an initial starting P*. This subroutine was taken from Toro almost exactly, as the details for approximation methods have not yet been covered in my studies. Once this P* is found, it is fed into theFindPstar routine, whereby a Newton Rhapson iteration method corrects this P* until it converges.12 1. Estimate an initial starting P*. This subroutine was taken from Toro almost exactly, as I have not yet covered the details for approximation methods in my studies. Once this P* is found, it is fed into the !FindPstar routine, whereby a Newton Rhapson iteration method corrects this P* until it converges. 13 13 14 2. Using this p*, u* is found in the star region given simple analyticexpression.14 2. Using this p*, u* is found in the star region given a simple analytical expression. 15 15 16 3. Using p* and u*, the solution is sampled at every point on the grid. The position is determined by comparing speeds in the grid. First it is determined whether point is on left or right side of the contact discontinuity. (The speed of the contact disc. is given by u*). If s<u*,point is on left of the contact. If s>u*, it is on right.16 3. Using p* and u*, the solution is sampled at every point on the grid. The position is determined by comparing speeds in the grid. First it is determined whether the point is on the left or right side of the contact discontinuity. (The speed of the contact disc. is given by u*). If s<u*, the point is on left of the contact. If s>u*, it is on right. 17 17 18 4. Next, given the initial L and R pressure compared to P*, the type of wave is determined. If p_L < p*  left wave is shock else it is a rarefaction. If p_R < p*, wave is shockelse it is a rarefaction. Note, this assumes waves always travel away from the contact.18 4. Next, given the initial L and R pressure compared to P*, the type of wave is determined. If p_L < p*  left wave is shock, else it is a rarefaction. If p_R < p*, wave is shock, else it is a rarefaction. Note, this assumes waves always travel away from the contact. 19 19 20 5. Once waves present are known, then the different speeds in the grid are compared to the speeds of the different left and right waves. The appropriate analytic expression is then chosen, based on relative position to wave.20 5. Once the waves are identified, then the different speeds in the grid are compared to the speeds of the different left and right waves. The appropriate analytic expression is then chosen, based on relative position to wave. 21 21 22 22 === Results ===