From 1cfa84c2f1d27951ecc8f5019cb6fc6cadf392d1 Mon Sep 17 00:00:00 2001 From: Nick Baker Date: Tue, 30 Jul 2024 09:03:35 -0700 Subject: [PATCH] fix F_eq update variables --- src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 83a1c3a..d5837b0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -134,9 +134,9 @@ impl<'b, const X: usize, const Y: usize> LBM<'b, X, Y> { let u = self.u[i][j]; let p1 = 3.0 * c.dot(u); - // p2 = 9 / 2 * c.dot(u) ^ 2 - let p2 = p1.powi(2) / 2.0; - let p3 = (3.0 / 2.0) * u.dot(u); + // p2 = 3 / 2 * c.dot(u) ^ 2 + let p2 = p1.powi(2) / (3.0 * 2.0); + let p3 = (9.0 / 2.0) * u.dot(u); // equilibrium state lattice point let f_eq_ijk = self.rho[i][j] * WEIGHTS[k] * (1.0 + p1 + p2 - p3);