From 2f78b0cbfde9d5cf09f24926bb8eec62ef05235a Mon Sep 17 00:00:00 2001 From: Cory Bloor Date: Mon, 5 Jun 2017 22:45:38 -0600 Subject: [PATCH] Removed speculative comment Directly setting the velocity on solid boundaries is necessary. You never explicitly calculate the pressure of the solid wall, and it's different for each face anyways, so there's no single value to store. --- main.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.cxx b/main.cxx index 7223409..d0c00dc 100644 --- a/main.cxx +++ b/main.cxx @@ -658,7 +658,7 @@ void project(float dt, float u[Y][X], float v[Y][X], float uout[Y][X], float vou // update horizontal velocities for (size_t y = 0; y < Y; ++y) { for (size_t x = 0; x < X-1; ++x) { - if (g_solid[y][x] || g_solid[y][x+1]) { // todo: unnecessary? probably same as !is_water + if (g_solid[y][x] || g_solid[y][x+1]) { uout[y][x] = 0.f; } else if (is_water(y,x) || is_water(y,x+1)) { uout[y][x] = u[y][x] - k_invd * k_invs * dt * (p[y][x+1] - p[y][x]);