GPUs TO MARS Full Scale Simulation of SpaceX’s Mars Rocket Engine Adam Lichtl, Stephen Jones, GTC 2015
Background Independent space launch company Build and operate our own rocket & capsule Operations in CA, TX & FL Founded in 2002, first launch in 2008 18 successful missions to date
Design
Build
Launch
Mars Length of day 24 hours, 40 minutes Length of year 687 days Gravity 0.375g s Distance from Sun 1.53 AU Mars Air CO 2 (96%), N 2 (2%) Earth Air O2 (21%), N2 (78%) Atmosphere 1% density / pressure of Earth Temperature -284 / +86 / -81 F (low / high / avg)
Human Mars Mission Classes Credit: CollectSpace
Mass to Mars Apollo Command & International Space Station NASA Mars Architecture Service Module Mass: 450 tons Mass: 300 tons Mass: 46 tons 36x Space Shuttle, 3x heavy-lift Terrestrial assembly 5x Proton launches launches In-orbit assembly Image Credit: NASA Image Credit: NASA Image Credit: Mark Benson & Kerbal Space Program
Methane Fuel Carbon dioxide from atmosphere Synthesize return-journey fuel on Mars O C O C O 2H 2 O + CO 2 -> CH 4 + 2O 2 O O H H C O O H H O H O Water from below ground O H H H
Rocket Engine Design
Why Simulation? 1. Investigate what cannot be measured 2. Reduce need for testing 3. Design optimisation: narrow design space 4. Proactive instead of reactionary design
Time scales vary by 8 orders of magnitude Diffusion Advection Acoustics 10 -11 10 -10 10 -9 10 -8 10 -7 10 -6 10 -5 10 -4 10 -3 seconds Reaction Chamber Residence
Length scales vary by Injection 6 orders of magnitude log E(k) Cascade Combustion Eddy Energy Chamber: ~1m Kolmogorov Scale: ~1µm Viscous dissipation k min k max Eddy Wavenumber Total points: (10 3 ) 6 = 10 18 = 1,000,000,000,000,000,000 points @1kB per point -> Yottabytes of data
Structure in Turbulence Credit: SpaceWeather
Simulation Meshing Structured Grid Adaptive Grid Unstructured Grid
Fourier Transform: Spectral Compression
Wavelets: Local Fractal Basis
Wavelet Compression
Wavelet Compression
Wavelet Compression
Wavelet Compression
Wavelet Compression δ δ δ < ε δ > ε ( ε is some tolerance)
Wavelet Compression Transform Output
Wavelet Compression Transform Output
Wavelet Compression Transform Output
Wavelet Compression Transform Output
Wavelet Compression Transform Output
Wavelet Compression Transform Output
Wavelet Compression Transform Output
Wavelet Compression Transform Output
Wavelet Compression Transform Output
Wavelet Compression Transform Output
Wavelet Compression Transform Output
Wavelet Compression Transform Output
Wavelet Compression Transform Output
Wavelet Compression Transform Output
Wavelet Compression Transform Output
Wavelet Compression Transform Output
Decompression Transform Output
Decompression Transform Output
Decompression Transform Output
Decompression + δ Transform Output
Decompression Transform Output
Decompression Transform Output
Decompression Transform Output
Decompression Transform Output
Decompression Transform Output
Regular Grid: Direct Indexing (x, y, z) (x, y+1, z) Index (x, y, z) = p Index (x, y+1, z) = p + N x
Sparse Grid: Difficult Indexing (x, y, z) (x, y+1, z) Index (x, y, z) = p Index (x, y+1, z) = ???
Sparse Grid Point Lookup Linear search Tree-based search Hybrid tree search + dense indexing
Grid Point Contains Reference to Data Grid Point 14 Location (x,y,z) Data Reference (x, y, z)
Grid Point Contains Reference to Data Grid Point 14 15 Grid Index 14 16 Location (x,y,z) (11,11,5) (11,12,5) (Location) Grid Data Data Reference 3 8 (Reference) (x, y, z)
Grid Point Contains Reference to Data Grid Point 14 15 Grid Index 14 16 Location (x,y,z) (11,11,5) (11,12,5) … Grid Data Data Reference 3 8 … ρ 0 ρ 1 ρ 2 ρ 3 ρ 4 ρ 5 ρ 6 ρ 7 ρ 8 ρ 9 density (x, y, z) ρ u 0 ρ u 1 ρ u 2 ρ u 3 ρ u 4 ρ u 5 ρ u 6 ρ u 7 ρ u 8 ρ u 9 X-momentum ρ v 0 ρ v 1 ρ v 2 ρ v 3 ρ v 4 ρ v 5 ρ v 6 ρ v 7 ρ v 8 ρ v 9 Y-momentum ρ w 0 ρ w 1 ρ w 2 ρ w 3 ρ w 4 ρ w 5 ρ w 6 ρ w 7 ρ w 8 ρ w 9 Z-Momentum E 0 E 1 E 2 E 3 E 4 E 5 E 6 E 7 E 8 E 9 Energy Simulation Data
Grid Point Contains Reference to Data Grid Point 14 15 Grid Index 14 16 Location (x,y,z) (11,11,5) (11,12,5) … Grid Data Data Reference 3 8 … ρ 0 ρ 1 ρ 2 ρ 3 ρ 4 ρ 5 ρ 6 ρ 7 ρ 8 ρ 9 density (x, y, z) ρ u 0 ρ u 1 ρ u 2 ρ u 3 ρ u 4 ρ u 5 ρ u 6 ρ u 7 ρ u 8 ρ u 9 X-momentum ρ v 0 ρ v 1 ρ v 2 ρ v 3 ρ v 4 ρ v 5 ρ v 6 ρ v 7 ρ v 8 ρ v 9 Y-momentum ρ w 0 ρ w 1 ρ w 2 ρ w 3 ρ w 4 ρ w 5 ρ w 6 ρ w 7 ρ w 8 ρ w 9 Z-Momentum E 0 E 1 E 2 E 3 E 4 E 5 E 6 E 7 E 8 E 9 Energy Simulation Data
Grid Adaptation Grid Index P 0 P 1 P 2 P 3 P 4 P 5 P 6 P 7 P 8 P 9 Location x 0 y 0 x 1 y 1 x 2 y 2 x 3 y 3 x 4 y 4 x 5 y 5 x 6 y 6 x 7 y 7 x 8 y 8 x 9 y 9 Reference 0 1 2 3 4 5 6 7 8 9
Grid Adaptation Grid Index P 0 P 1 P 2 P 3 P 4 P 5 P 6 P 7 P 8 P 9 Location x 0 y 0 x 1 y 1 x 2 y 2 x 3 y 3 x 4 y 4 x 5 y 5 x 6 y 6 x 7 y 7 x 8 y 8 x 9 y 9 Reference 0 1 2 3 4 5 6 7 8 9
Grid Adaptation Grid Index P 0 P 1 P 2 P 3 P 4 P 5 P 6 P 7 P 8 P 9 Location x 0 y 0 x 1 y 1 x 2 y 2 x 3 y 3 x 4 y 4 x 5 y 5 x 6 y 6 x 7 y 7 x 8 y 8 x 9 y 9 Reference 0 1 2 3 4 5 6 7 8 9
Grid Adaptation Grid Index P 0 P 2 P 4 P 6 P 8 Location x 0 y 0 x 2 y 2 x 4 y 4 x 6 y 6 x 8 y 8 Reference 0 2 4 6 8
Grid Adaptation Grid Index P 0 P 1 P 2 P 3 P 4 Location x 0 y 0 x 2 y 2 x 4 y 4 x 6 y 6 x 8 y 8 Reference 0 2 4 6 8
Grid Transformations Track Data Grid Index P 0 P 1 P 2 P 3 P 4 P 5 P 6 P 7 P 8 P 9 Location x 0 y 0 x 1 y 1 x 2 y 2 x 3 y 3 x 4 y 4 x 5 y 5 x 6 y 6 x 7 y 7 x 8 y 8 x 9 y 9 Reference 0 1 2 3 4 5 6 7 8 9
Grid Transformations Track Data Grid Index P 0 P 1 P 2 P 3 P 4 P 5 P 6 P 7 P 8 P 9 Location x 0 y 0 x 1 y 1 x 2 y 2 x 3 y 3 x 4 y 4 x 5 y 5 x 6 y 6 x 7 y 7 x 8 y 8 x 9 y 9 Reference 0 1 2 3 4 5 6 7 8 9 Delete Add Sort Transpose
Grid Transformations Track Data Grid Index P 0 P 1 P 2 P 3 P 4 P 5 P 6 P 7 P 8 P 9 Location x 0 y 0 x 1 y 1 x 2 y 2 x 3 y 3 x 4 y 4 x 5 y 5 x 6 y 6 x 7 y 7 x 8 y 8 x 9 y 9 Reference 0 1 2 3 4 5 6 7 8 9 Delete Add Sort Transpose Grid Index P 0 P 1 P 2 P 3 P 4 P 5 P 6 P 7 P 8 P 9 Location x 4 y 4 x 7 y 7 x 9 y 9 x 0 y 0 x 5 y 5 x 1 y 1 x 8 y 8 x 3 y 3 x 6 y 6 x 2 y 2 Reference 4 7 9 0 5 1 8 3 6 2
Losing Coalesced Memory Access Grid Index P 0 P 1 P 2 P 3 P 4 P 5 P 6 P 7 P 8 P 9 Reference 0 1 2 3 4 5 6 7 8 9 ρ 0 ρ 1 ρ 2 ρ 3 ρ 4 ρ 5 ρ 6 ρ 7 ρ 8 ρ 9 ρ u 0 ρ u 1 ρ u 2 ρ u 3 ρ u 4 ρ u 5 ρ u 6 ρ u 7 ρ u 8 ρ u 9 ρ v 0 ρ v 1 ρ v 2 ρ v 3 ρ v 4 ρ v 5 ρ v 6 ρ v 7 ρ v 8 ρ v 9 ρ w 0 ρ w 1 ρ w 2 ρ w 3 ρ w 4 ρ w 5 ρ w 6 ρ w 7 ρ w 8 ρ w 9 E 0 E 1 E 2 E 3 E 4 E 5 E 6 E 7 E 8 E 9 Coalesced Simulation Data
Losing Coalesced Memory Access Grid Index P 0 P 1 P 2 P 3 P 4 P 5 P 6 P 7 P 8 P 9 Reference 4 7 9 0 5 1 8 3 6 2 ρ 0 ρ 1 ρ 2 ρ 3 ρ 4 ρ 5 ρ 6 ρ 7 ρ 8 ρ 9 ρ u 0 ρ u 1 ρ u 2 ρ u 3 ρ u 4 ρ u 5 ρ u 6 ρ u 7 ρ u 8 ρ u 9 ρ v 0 ρ v 1 ρ v 2 ρ v 3 ρ v 4 ρ v 5 ρ v 6 ρ v 7 ρ v 8 ρ v 9 ρ w 0 ρ w 1 ρ w 2 ρ w 3 ρ w 4 ρ w 5 ρ w 6 ρ w 7 ρ w 8 ρ w 9 E 0 E 1 E 2 E 3 E 4 E 5 E 6 E 7 E 8 E 9 Uncoalesced Simulation Data
Restoring Coalesced Memory Access Grid Index P 0 P 1 P 2 P 3 P 4 P 5 P 6 P 7 P 8 P 9 Location x 4 y 4 x 7 y 7 x 9 y 9 x 0 y 0 x 5 y 5 x 1 y 1 x 8 y 8 x 3 y 3 x 6 y 6 x 2 y 2 Reference 4 7 9 0 5 1 8 3 6 2 ρ 0 ρ 1 ρ 2 ρ 3 ρ 4 ρ 5 ρ 6 ρ 7 ρ 8 ρ 9 ρ u 0 ρ u 1 ρ u 2 ρ u 3 ρ u 4 ρ u 5 ρ u 6 ρ u 7 ρ u 8 ρ u 9 ρ v 0 ρ v 1 ρ v 2 ρ v 3 ρ v 4 ρ v 5 ρ v 6 ρ v 7 ρ v 8 ρ v 9 ρ w 0 ρ w 1 ρ w 2 ρ w 3 ρ w 4 ρ w 5 ρ w 6 ρ w 7 ρ w 8 ρ w 9 E 0 E 1 E 2 E 3 E 4 E 5 E 6 E 7 E 8 E 9 Uncoalesced Simulation Data
Recommend
More recommend