Week 0: Installation & Prerequisites
Preparation steps for the 2D Shallow Water Solver course.
Before you begin
This course uses Python and JupyterLab to develop a 2D finite-volume shallow water solver from scratch. Week 0 ensures all participants have a fully functional environment before moving into the equations and numerical methods in Week 1.
1. Prerequisites
- Basic calculus and linear algebra.
- Fundamentals of open-channel hydraulics.
- A minimal understanding of partial differential equations.
- No prior CFD experience required.
2. Install Anaconda
Download and install the Anaconda distribution (Windows, macOS, Linux):
3. Create the course environment
Open a terminal (or Anaconda Prompt on Windows) and run:
conda create -n swsolver python=3.11
conda activate swsolver
pip install numpy scipy matplotlib jupyterlab
If you are not familiar with using the terminal or the Anaconda Prompt on Windows, you can first read the short guide “11 Terminal Commands You Should Know”, which walks through basic navigation and file commands.
4. Launch JupyterLab
jupyter lab
JupyterLab will open in your browser. You are ready to start creating notebooks.
5. Organize your working folder
- Create a main directory:
2D_SWE_Solver/ - Inside it, create the following subfolders:
notebooks/figures/data/
6. Test your installation
Create a new notebook (.ipynb) and run this cell:
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(0, 10, 200)
plt.plot(x, np.sin(x))
plt.title("Installation Successful")
plt.show()
If the plot appears, your environment is ready for Week 1.