Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.

TSBK03 project

This is a SPH fluid simulation as part of a university projeect course.

Thee fluid simulation is parallelized on the GPU using CUDA and visualize using openGl.

SPH

Parameters

The following parameters control the fluid behavior:

  • Particle Mass: PARTICLE_MASS
  • Rest Density: REST_DENSITY
  • Gas Constant: h_GAS_CONSTANT
  • Viscosity: h_VISCOSITY
  • Smoothing Radius: h_H

These values are adjustable within the code and can be fine-tuned based on desired fluid dynamics.

Compile & Run

Dependencies

  • CUDA Toolkit – for CUDA language support, GPU parallelization, and CUDA/OpenGL interoperability
  • GLEW – for OpenGL Extension Wrangler Library
  • GLFW
  • Thrust – for high-performance parallel algorithms (comes with the CUDA Toolkit)

Build Instructions for Ubuntu

Dependencies

Install all required dependencies using the following command:

sudo apt update && sudo apt install -y build-essential cmake libglew-dev libglfw3-dev mesa-common-dev libx11-dev

Building the Project

  1. Clone the repository and navigate to the project directory:

    git clone https://github.com/your_username/your_project.git
    cd your_project
  2. Create a build directory:

    mkdir build
    cd build
  3. Configure and build the project:

    cmake ..
    make

Running the Application

Run the application from the build directory:

./fluidSimulator