Skip to content

Commit

Permalink
fix F_eq update variables
Browse files Browse the repository at this point in the history
  • Loading branch information
ndbaker1 authored Jul 30, 2024
1 parent 6d7551b commit 1cfa84c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1cfa84c

Please sign in to comment.