diff --git a/src/constants.h b/src/constants.h index 5a5d500f5927e1d018798d4f320c2ecd2ecee56f..7b8bfe9d1d97fa3f154e3db170d163a13e4b3cc4 100644 --- a/src/constants.h +++ b/src/constants.h @@ -9,10 +9,10 @@ const float h_BOUND_Y_MAX = 12.0f; const float h_BOUND_Z_MIN = -4.0f; const float h_BOUND_Z_MAX = 4.0f; -const float h_GAS_CONSTANT = 300.0f; -const float h_VISCOSITY = 0.8f; +const float h_GAS_CONSTANT = 10.0f; +const float h_VISCOSITY = 0.2f; const float h_PI = 3.14159265358979323846f; -const float h_H = 0.4f; // Smoothing radius +const float h_H = 0.5f; // Smoothing radius #endif // CONSTANTS_H diff --git a/src/kernels_cuda.cu b/src/kernels_cuda.cu index 3a1717753fdd45399331e7b297be8aac7db31a94..9aae2a3296f0c1194f3eae9ecd782711332af645 100644 --- a/src/kernels_cuda.cu +++ b/src/kernels_cuda.cu @@ -23,8 +23,8 @@ __constant__ float POLY6_CONST; __constant__ float SPIKY_GRAD_CONST; __constant__ float VISC_LAP_CONST; -__constant__ float PARTICLE_MASS = 8.0f; -__constant__ float REST_DENSITY = 1000.0f; +__constant__ float PARTICLE_MASS = 1.0f; +__constant__ float REST_DENSITY = 60.0f; __constant__ float GAS_CONSTANT; __constant__ float VISCOSITY; @@ -250,7 +250,7 @@ __global__ void computeForces( float3 fPressure = make_float3(0.0f, 0.0f, 0.0f); float3 fViscosity = make_float3(0.0f, 0.0f, 0.0f); - float3 fGravity = make_float3(0.0f, -16.0f * density_i, 0.0f); + float3 fGravity = make_float3(0.0f, -2.0f , 0.0f); unsigned int cellIndex = cellIndices[idx]; diff --git a/src/main.cpp b/src/main.cpp index 601bbe11b0d682608496d11c89a37b3cc2f131fd..94dce153270ffe5b4d6d5965331356c8c5446102 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -23,10 +23,10 @@ #include "GL_utilities.h" // Number of particles -const int NUM_PARTICLES = 8000; // Should match a cubic grid for simplicity -const float GRID_SPACING = 0.5f; // Spacing between particles in the grid +const int NUM_PARTICLES = 64000; // Should match a cubic grid for simplicity +const float GRID_SPACING = 0.25f; // Spacing between particles in the grid -const float pointRadius = 8.0f; // Point size in world space +const float pointRadius = 6.0f; // Point size in world space const float pointScale = 16.0f; auto previousTime = std::chrono::high_resolution_clock::now();