Fun with Approximate Solvers pt 1

Martin was unable to meet with me last week, but gave me some homework (reading through the current iteration of the module and coming up with questions) that I am working on now.

I spent some quality time with Toro the last week and burned through Chapter 9 and most of Chapter 10, which included the following approximate solvers:

  • Primitive Variable Riemann Solver
  • Two Rarefaction Riemann Solver
  • Two Shock Riemann Solver
  • Adaptive Iterative Riemann Solver
  • Adaptive Non-iterative Riemann Solver
  • HLL Solver
  • HLLC Solver

The exact solver that I wrote was entirely self contained, but I hadn't anticipated the new solvers I'd be learning about following essentially the same procedure (although in retrospect, it seems obvious). Before running the tests in Chapter 9 using the AIRS and ANRS, I want to rework my code to be a little more flexible. The main code will look something like:

1) Run initialize grid script, which will return the initial state.
2) Update state, this function will choose which solver to use based on user input or adaptive conditions from a switch.
3) Print data
4) Loop steps 2 and (optionally) 3 until final time step.

This basic framework should make it easier to continue to add solvers as I learn about them. Incidentally, I now have a better understanding of why AstroBear is set up the way it is! I should have plots and tests up before next meeting.

Question: Can I continue writing in Python, or is it going to become a hindrance when I get farther along in the book? Also, when do I move past 1D?

Comments

No comments.