This summer, June 13-17 2016 in Campbell room 131, I will be teaching a course entitled "How to Write a Hydro Code". The goal will be for each student to build his or her own hydro code, tailored to individual interests.

This is highly experimental (I've never done this before) and the goal is somewhat ambitious (building a research-grade code in one week) but I think it's always best to aim high.

The course aims to be accessible to undergrads, yet still informative and useful for graduate students and postdocs. At the moment, enrollment is pretty evenly split between these three groups.

There is no official "homework", meaning that all coursework is done in-class, between lectures. I believe it will be much easier to motivate code development if the work is done in the classroom. This will also hopefully motivate collaboration between students.

The final project for the course will be the development of an advanced hydrodynamics code; if students wish, they can team up during the course to develop a single code together.

## ‌

### Course Schedule

The course will take place Monday-Friday, June 13-17. The course is held in Campbell 131, the big classroom.

There will be two lectures each day, and each lecture will be followed by a coding session.

Tentative daily schedule:

• 10:00 Lecture 1
• 11:00 Coding Session 1
• (Lunch)
• 2:00 Lecture 2
• 3:00 Coding Session 2

Coding sessions will last for 1-2 hours, depending on the task involved and how quickly we move.

Lecture material is tentatively scheduled for the first few days of the week:

### ‌

#### ‌

##### Hello World!

Introduction to the course, and a brief overview of the possible directions that can be taken as the course unfolds. Possibly some numerical basics such as convergence and Runge-Kutta methods.

Assignment #1:

• Pick any smooth function $f(x)$, whose derivative $f'(x)_{\rm analytic}$ you know.
• Calculate $f'(x,h)_{\rm numerical}$, using a first-order and second-order difference.
• Evaluate $\epsilon = |f'(x)_{\rm analytical} - f'(x,h)_{\rm numerical}|$, as a function of $h$.
• Plot $\epsilon(h)$ on a log-log plot.

Assignment #2:

• Pick any first-order ODE for which you know the solution, given $x_0$, $f_0$.
##### ‌

I do not have a specific order planned after day 2. This will depend on exactly what everyone wants to learn. Possible topics:

• 2D/3D
• HLLC
• Moving Mesh Methods
• Magnetohydrodynamics
• Relativistic Fluid Dynamics
• Viscosity
• Cylindrical/Spherical Coordinates
• Gravity
• Parallelization

### Course Documents

I suppose I will be occasionally posting documents here that you may find useful. Essentially, the course is based around the following two documents:

Chapter 1 of my Thesis

"How to Write a Hydro Code" by Weiqun Zhang