An interactive scientific simulation that models wave propagation in shallow water using numerical PDE solvers from Clawpack.
The project visualizes how disturbances in water propagate over time and allows users to interactively control simulation parameters through a Streamlit web interface.
This project simulates wave dynamics using the shallow water equations, which are widely used in computational fluid dynamics and geophysical modeling.
A disturbance is introduced in the water surface, and the simulation computes how the waves propagate outward using finite volume methods implemented in Clawpack.
Users can interactively modify simulation parameters and visualize the resulting wave patterns in real time.
- Numerical simulation using Clawpack PDE solvers
- Interactive simulation controls via Streamlit
- 3D visualization of water surface
- Adjustable simulation parameters:
- Grid resolution
- Disturbance strength
- Simulation time
- Animated wave propagation
- Scientific computing workflow using Linux + Conda
The simulation uses the Shallow Water Equations (SWE):
- ∂h/∂t + ∇·(hu) = 0
- ∂(hu)/∂t + ∇·(hu² + ½gh²) = 0
Where:
| Symbol | Meaning |
|---|---|
| h | Water height |
| u | Water velocity |
| g | Gravitational acceleration |
These equations describe fluid flow where horizontal scales are much larger than vertical scales.
They are commonly used in:
- Tsunami simulation
- Ocean modeling
- Flood modeling
- Atmospheric modeling
- Hydrodynamics research
User Interface
│
│
┌───────▼────────┐
│ Streamlit UI │
│ Parameter UI │
└───────┬────────┘
│
│ user inputs
▼
┌─────────────────┐
│ Simulation Core │
│ (Clawpack) │
│ PDE Solver │
└───────┬─────────┘
│
│ simulation frames
▼
┌─────────────────────┐
│ Visualization Layer │
│ Matplotlib (3D) │
└─────────┬───────────┘
│
▼
Animated Wave Surface
User sets simulation parameters │ ▼ Initialize shallow water domain │ ▼ Apply disturbance to water surface │ ▼ Clawpack solves PDE system │ ▼ Generate simulation frames │ ▼ Render 3D wave surface │ ▼ Display animated result in Streamlit
| Technology | Purpose |
|---|---|
| Python | Programming language |
| Clawpack | Numerical PDE solver |
| NumPy | Numerical computation |
| Matplotlib | Scientific visualization |
| Streamlit | Interactive web interface |
| Conda | Environment management |
| WSL + Ubuntu | Linux environment for scientific libraries |
ClawPack-Wave-Simulation
│
├── streamlit_app.py
│ Interactive Streamlit application for running the wave simulation
│
├── wave_simulation.py
│ Standalone script for running the wave simulation locally
│
├── generate_demo_gif.py
│ Script that generates an animated GIF of the simulation
│
├── demo_simulation/
│ └── demo.gif
│ Example animation showing wave propagation
│
├── requirements.txt
│ Python dependencies required to run the project
│
├── environment.yml
│ Conda environment configuration for reproducibility
│
└── README.md
│ Project documentation
wsl --install -d Ubuntuwget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
Miniconda3-latest-Linux-x86_64.shRestart the terminal afterwards.
conda create -n clawpack_env python=3.10conda install -c conda-forge clawpack
pip install numpy matplotlib streamlitNavigate to the project directory:
cd "/mnt/e/Projects/ClawPack - Wave Simulation"Note: Make sure to customize the project directory path according to yours.
Activate the environment:
conda activate clawpack_envRun the interactive app:
streamlit run streamlit_app.pyOpen the browser at:
http://localhost:8501Users can control the following parameters:
| Parameter | Description |
|---|---|
| Grid Resolution | Controls simulation accuracy |
| Disturbance Strength | Initial wave amplitude |
| Simulation Time | Duration of simulation |
Press Run Simulation to visualize the wave propagation.
Example visualization produced by the simulator:
The disturbance creates circular waves that propagate outward across the water surface.
Wave simulations like this are used in:
- Tsunami prediction models
- Ocean wave forecasting
- Hydrodynamic research
- Climate and atmospheric simulations
- Computational fluid dynamics
This project can be extended with:
- Multiple disturbance points
- Wave interference patterns
- Real-time GPU acceleration
- Coastal boundary modeling
- Tsunami simulation scenarios
- Web deployment
Shivam
Computer Science Student
Project developed as part of exploring scientific computing, numerical simulations, and interactive visualization.
Clawpack Documentation
https://www.clawpack.org
Streamlit Documentation
https://docs.streamlit.io
Numerical Methods for Hyperbolic PDEs
