146 | 146 | Using 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... |