| Version 1 (modified by , 14 years ago) ( diff ) |
|---|
Building a 1D Hydro Code
Introduction
I've created this page to document the important aspects of building a hydro code. It contains general information that I have learned from reading Riemann Solvers and Numerical Methods for Fluid Dynamics: A Practical Introduction by E.F. Toro. In the near future, it will contain useful information from my own personal experience as I build my first hydro code.
The Equations of Fluid Dynamics
The first time I saw the fluid equations was in the normal conservative-law form. These are conceptually simple and make intuitive sense.
| Name of Law | Formula |
| Conservation of Mass | |
| Conservation of Momentum | |
| Conservation of Energy |
Where is mass density, v is velocity (only in x-direction for 1D), p is pressure, and E is total energy per unit volume. E is further defined as where e is the specific internal energy. Basically, these laws state that in a given volume, the change in a conserved quantity must be equal to the flux through the boundaries of that volume.
Solving the Riemann Problem
Discretisation
Godunov's First Order Upwind Scheme
Attachments (34)
- test1_intenergy.png (14.3 KB ) - added by 14 years ago.
- test1_pressure.png (13.7 KB ) - added by 14 years ago.
- test1_velocity.png (12.5 KB ) - added by 14 years ago.
- test2_density.png (17.1 KB ) - added by 14 years ago.
- test2_intenergy.png (17.9 KB ) - added by 14 years ago.
- test2_pressure.png (16.4 KB ) - added by 14 years ago.
- test2_velocity.png (15.2 KB ) - added by 14 years ago.
- test3_density.png (10.7 KB ) - added by 14 years ago.
- test3_intenergy.png (12.9 KB ) - added by 14 years ago.
- test3_pressure.png (12.4 KB ) - added by 14 years ago.
- test3_velocity.png (12.7 KB ) - added by 14 years ago.
- test4_density.png (10.9 KB ) - added by 14 years ago.
- test4_intenergy.png (12.2 KB ) - added by 14 years ago.
- test4_pressure.png (12.8 KB ) - added by 14 years ago.
- test4_velocity.png (9.9 KB ) - added by 14 years ago.
- test5_density.png (10.2 KB ) - added by 14 years ago.
- test5_intenergy.png (12.6 KB ) - added by 14 years ago.
- test5_pressure.png (12.5 KB ) - added by 14 years ago.
- test5_velocity.png (12.8 KB ) - added by 14 years ago.
- hllc_test1_density.png (11.5 KB ) - added by 14 years ago.
- test1_density.png (11.5 KB ) - added by 14 years ago.
- roe_nofix_test1_density.png (11.5 KB ) - added by 14 years ago.
- roe_withfix_test1_density.png (11.5 KB ) - added by 14 years ago.
- hllc_test1_intenergy.png (13.8 KB ) - added by 14 years ago.
- hllc_test1_pressure.png (11.5 KB ) - added by 14 years ago.
- hllc_test1_velocity.png (12.3 KB ) - added by 14 years ago.
- muscl_test1_density.png (11.3 KB ) - added by 14 years ago.
- muscl_test1_intenergy.png (13.7 KB ) - added by 14 years ago.
- muscl_test1_pressure.png (11.3 KB ) - added by 14 years ago.
- muscl_test1_velocity.png (12.2 KB ) - added by 14 years ago.
- muscl_test2_density.png (17.2 KB ) - added by 14 years ago.
- muscl_test2_intenergy.png (16.7 KB ) - added by 14 years ago.
- muscl_test2_pressure.png (16.0 KB ) - added by 14 years ago.
- muscl_test2_velocity.png (14.8 KB ) - added by 14 years ago.
Download all attachments as: .zip