Skip to content
Snippets Groups Projects
Commit 3b8d320d authored by Adam Nyberg's avatar Adam Nyberg
Browse files

Improved README

parent e85b773d
Branches
No related tags found
No related merge requests found
......@@ -16,19 +16,50 @@ The following parameters control the fluid behavior:
These values are adjustable within the code and can be fine-tuned based on desired fluid dynamics.
### Equations
The SPH fluid simulation relies on specific equations for density, pressure, and force calculations, leveraging smoothing kernels:
1. **Density Calculation**
The Poly6 kernel is used to compute density based on particle distances:
$$ W_{\text{poly6}}(r) = \text{POLY6_CONST} \cdot (H^2 - r^2)^3 $$
2. **Pressure Force**
Pressure force between particles is calculated using the Spiky kernel gradient:
$$ W'_{\text{spiky}}(r) = \text{SPIKY_GRAD_CONST} \cdot (H - r)^2 $$
3. **Viscosity Force**
The viscosity force is calculated with a Laplacian kernel:
$$ \nabla^2 W_{\text{visc}}(r) = \text{VISC_LAP_CONST} \cdot (H - r) $$
\ No newline at end of file
## Compile & Run
### Dependencies
* **CUDA Toolkit** – for CUDA language support, GPU parallelization, and CUDA/OpenGL interoperability
* **GLEW** – for OpenGL Extension Wrangler Library
* **freeGLUT** – for OpenGL windowing and event handling
* **GLM** – for vector and matrix math operations in OpenGL
* **Thrust** – for high-performance parallel algorithms (comes with the CUDA Toolkit)
### Build Instructions
1. **Install Dependencies**
On Ubuntu, you can install the required libraries using:
```bash
sudo apt update
sudo apt install -y build-essential cmake libglew-dev freeglut3-dev libglm-dev
```
Install the **CUDA Toolkit** from NVIDIA’s official site [here](https://developer.nvidia.com/cuda-toolkit), which includes both CUDA and Thrust libraries.
```
2. **Build the Project with CMake**
Navigate to the project src folder and create a `build` folder:
```bash
mkdir build
cd build
```
Run CMake to configure and generate the makefiles, then compile the code:
```bash
cmake ..
make
```
This will produce an executable named `cuda_opengl_integration` in the `build` directory.
## Run
From the `build` directory, run the executable:
```bash
./cuda_opengl_integration
```
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment