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

Better parametrs + constant gravity. Constants still neeed fine tuning

parent c8d2f48f
No related merge requests found
......@@ -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
......@@ -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];
......
......@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment