19
by Dirk Hekhuis Advisors Dr. Greg Wolffe Dr. Christian Trefftz

By Dirk Hekhuis Advisors Dr. Greg Wolffe Dr. Christian Trefftz

Embed Size (px)

Citation preview

Page 1: By Dirk Hekhuis Advisors Dr. Greg Wolffe Dr. Christian Trefftz

byDirk Hekhuis

AdvisorsDr. Greg Wolffe

Dr. Christian Trefftz

Page 2: By Dirk Hekhuis Advisors Dr. Greg Wolffe Dr. Christian Trefftz
Page 3: By Dirk Hekhuis Advisors Dr. Greg Wolffe Dr. Christian Trefftz

ApplicationsComputational Fluid Dynamics have many

applicationsAutomotive AerodynamicsDesigning HVAC SystemsWater Flow Around SubmarinesModeling Dams

Page 4: By Dirk Hekhuis Advisors Dr. Greg Wolffe Dr. Christian Trefftz

The Physics of FluidsNavier-Stokes equations for incompressible flow

Equation for velocity in a compact vector notation

Equation for density moving through the velocity field

Page 5: By Dirk Hekhuis Advisors Dr. Greg Wolffe Dr. Christian Trefftz

Fluid Representation

Page 6: By Dirk Hekhuis Advisors Dr. Greg Wolffe Dr. Christian Trefftz

Implementing Navier-StokesExternal ForcesDiffusionAdvectionProjection

Page 7: By Dirk Hekhuis Advisors Dr. Greg Wolffe Dr. Christian Trefftz

External ForcesExternal forces applied to the fluid can be

either local forces or body forcesLocal forces are applied to a specific region

of the fluid – for example the force of a fan blowing air

Body forces are forces that apply evenly to the entire fluid, like gravity

Page 8: By Dirk Hekhuis Advisors Dr. Greg Wolffe Dr. Christian Trefftz

Diffusion

Page 9: By Dirk Hekhuis Advisors Dr. Greg Wolffe Dr. Christian Trefftz

Advection

Page 10: By Dirk Hekhuis Advisors Dr. Greg Wolffe Dr. Christian Trefftz

Projection

Page 11: By Dirk Hekhuis Advisors Dr. Greg Wolffe Dr. Christian Trefftz
Page 12: By Dirk Hekhuis Advisors Dr. Greg Wolffe Dr. Christian Trefftz

Why use CUDA?

Page 13: By Dirk Hekhuis Advisors Dr. Greg Wolffe Dr. Christian Trefftz

CPU vs GPUCPU

Fast cachesBranching adaptabilityHigh performance

GPUMultiple ALUsFast onboard memoryHigh throughput on parallel tasks

Executes program on each fragment/vertex

CPUs are great for task parallelismGPUs are great for data parallelism

Page 14: By Dirk Hekhuis Advisors Dr. Greg Wolffe Dr. Christian Trefftz

CPU vs GPU - Hardware

More transistors devoted to data processing

Page 15: By Dirk Hekhuis Advisors Dr. Greg Wolffe Dr. Christian Trefftz

What is CUDA?Compute Unified Device ArchitectureNVIDIA’s software architecture for

developing and running data-parallel programs

Programmed in an extension to the C language

Page 16: By Dirk Hekhuis Advisors Dr. Greg Wolffe Dr. Christian Trefftz

Programming CUDAKernel Functions

A kernel function is code that runs on the GPUThe code is downloaded and executed

simultaneously on all stream processors on the GPUSIMD Model

SIMD stands for Single Instruction, Multiple DataSIMD exploits data level parallelism by performing

the same operation on multiple pieces of data at the same time

Example: Performing addition on 128 numbers at once

Page 17: By Dirk Hekhuis Advisors Dr. Greg Wolffe Dr. Christian Trefftz

Fluid Dynamics on the GPUTo implement the Navier-Stokes equations on

a GPU we need to write kernel functions for:External ForcesDiffusionAdvectionProjection

Page 18: By Dirk Hekhuis Advisors Dr. Greg Wolffe Dr. Christian Trefftz
Page 19: By Dirk Hekhuis Advisors Dr. Greg Wolffe Dr. Christian Trefftz

Acknowledgements“Real-Time Fluid Dynamics for Games” by Jos

Stam“Fast Fluid Dynamics Simulation on the GPU”

by Mark J. Harris

NVIDIAdeveloper.nvidia.com/CUDA

“CUDA: Introduction” by Christian Trefftz / Greg WolffeGrand Valley State University