Changes between Version 67 and Version 68 of u/erica/GudonovMethodEuler


Ignore:
Timestamp:
05/08/13 11:35:57 (12 years ago)
Author:
Erica Kaminski
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • u/erica/GudonovMethodEuler

    v67 v68  
    135135== Debugging ==
    136136
    137 I ran into issues with the original revisions of this code. I started debugging by first adding sequential print statements throughout the code, module, and subroutines, to make sure the routines were called in the correct order, and that values of cells, were being delivered correctly to the various parts of the program. These all checked out. Next I began adding print statements to the iterative scheme, that checked the time step (dt), and the cfl. For the first time step, dt was calculated correctly, and the cfl was also correct.
     137I ran into issues with the original revisions of this code. I started debugging by first adding sequential print statements throughout the code, module, and subroutines, to make sure the routines were called in the correct order, and that values of cells, were being delivered correctly to the various parts of the program. These all checked out. Next I began adding print statements to the iterative scheme, that checked the time step (dt), and the cfl. For the first time step, dt was calculated correctly, and the cfl was also correct. The next thing I checked was that between time = 0 and time = 0 + dt, the values of q were being computed correctly at those cells near the discontinuity where I expected to see non-linear wave formation. I made a spreadsheet of values, and calculated the updated values of q for these cells. Here is a screenshot of that spreadsheet:
     138
     139[[Image(GodDebug.png, 35%)]]
     140
     141Using my standard out, I checked the updated values of q I calculated for the cells adjacent to the discontinuity, and it checked out. Running the code again, after the 8th or 9th time step, the code stopped after the Newton Iteration Scheme failed to converge... But everything was being computed correctly! A look at the time by this 8th or 9th time step hinted to a bug... The time was extremely small, at this rate, the simulation wouldn't get done for hundreds and hundreds of time steps. This was wrong. Checking then the cfl, dt, and max speed for the time steps between 2 and 8, provided the answer. Smax was not changing, but the cfl was getting smaller and smaller, decreasing the time step by many factors. I checked the code I was using to set up the cfl coefficient, and found an error in the way I was doing so. I was rewriting the cfl coeff each time, and then re-using this value when I'd ask for 20% of the cfl coeff during those first 5 time steps (see above cfl condition subroutine explanation). I adjusted the code to not do this any more, and sure enough, the code ran smoothly afterward... No more divergence in iteration scheme for pstar, and the code finished with the correct output. Interesting an error that led to divergence in the iteration scheme was produced with such small time steps...
     142
     143
    138144
    139145== Results ==
    140146
     147To check the hypothesis that the initial condition would change initially at the discontinuity with the generation of non-linear waves, and then move outward with time, I plotted some sequential time steps in density. Here is the initial condition for density:
     148
     149[[Image(God_density_init.png, 35%)]]
     150
     151As time proceeds, you can see that a disturbance in density is generated at the border between the discontinuous left and right states and travels outward with time:
     152
    141153[[Image(God_density.png,35%)]]
    142 [[Image(God_density_init.png, 35%)]]
     154
     155In the last time step here, we begin to see the shape of the density curve shown in the following plot to emerge.
     156
    143157[[Image(GodEulRho.png, 35%)]]
     158
     159The above plot is that result that Toro published in chapter 6 for Test 4, but without the exact solution given by the Exact Riemann Solver. I simply wanted to check that the Godonuv scheme I wrote was performing correctly, so decided to just post these results for test 4, analyze them, and move on with my studies of numerics. In the next section I will analyse Toro's results to determine the difference in solution between the Exact Riemann Solver and Godunov method, to understand why the differences occur, and which is a better model for differing initial conditions.
     160
     161Here are the results for Test 4 of velocity and pressure:
     162
    144163[[Image(GodEulU.png, 35%)]]
    145164[[Image(GodEulP.png, 35%)]]
     165
     166They match Toro's results exactly.
    146167
    147168== Discussion ==
     
    150171== Outstanding Questions ==
    151172
    152 1. Do we see an effect of the waves to spread away from the discontinuity? - check!
     1731. Do we see an effect of the waves to spread away from the discontinuity? Yes!
    1531742. What waves are generated from the type of discontinuity -- consider what the exact riemann solver alone would do