From 6ffcf2373701faae32267d738dd8cbd65372752c Mon Sep 17 00:00:00 2001 From: adany292 <adany292@student.liu.se> Date: Sun, 29 Dec 2024 16:50:16 +0100 Subject: [PATCH] Small PCISPH changes --- src/cuda/pcisph_kernels.cu | 2 +- src/cuda/pcisph_update.cu | 2 +- src/settings/constants.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cuda/pcisph_kernels.cu b/src/cuda/pcisph_kernels.cu index a0dac1a..0357fd8 100644 --- a/src/cuda/pcisph_kernels.cu +++ b/src/cuda/pcisph_kernels.cu @@ -140,7 +140,7 @@ __global__ void updatePressures( if (idx < numParticles) { float deltaP = -density_errors[idx] / A; - pressure_increments[idx] += deltaP; + pressure_increments[idx] = deltaP; } } diff --git a/src/cuda/pcisph_update.cu b/src/cuda/pcisph_update.cu index 34a73f9..757f723 100644 --- a/src/cuda/pcisph_update.cu +++ b/src/cuda/pcisph_update.cu @@ -101,7 +101,7 @@ void updateParticles(float deltaTime) // ------------ Iterative Pressure Correction Loop -------------------- - const int maxIterations = 5; + const int maxIterations = 3; for (int iter = 0; iter < maxIterations; ++iter) { // Launch the boundary correction kernel diff --git a/src/settings/constants.h b/src/settings/constants.h index ba5edf1..d34d1eb 100644 --- a/src/settings/constants.h +++ b/src/settings/constants.h @@ -12,7 +12,7 @@ const float h_BOUND_Z_MAX = 4.0f; const float h_GAS_CONSTANT = 0.02f; const float h_VISCOSITY = 0.04f; -const float h_PARTICLE_MASS = 0.04f; +const float h_PARTICLE_MASS = 0.01f; const float h_REST_DENSITY = 800.0f; const float h_PI = 3.14159265358979323846f; -- GitLab