From 923d90f0d5dffa58ac6b4f820f1db5123a0df618 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Tue, 25 Aug 2026 16:59:08 +0200 Subject: Dangling --- modules/core/c++/fplbm.hpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'modules/core/c++') diff --git a/modules/core/c++/fplbm.hpp b/modules/core/c++/fplbm.hpp index 9514c93..714a300 100644 --- a/modules/core/c++/fplbm.hpp +++ b/modules/core/c++/fplbm.hpp @@ -49,7 +49,7 @@ public: auto& vel_f = macros.template get<"momentum">(); auto& vel = vel_f.at(index); - compute_rho_u(dfs,rho,vel); + compute_rho_momentum(dfs,rho,vel); } } }; @@ -92,9 +92,10 @@ public: auto& vel_f = macros.template get<"momentum">(); saw::data> vel = vel_f.at(index); + // We already computed this in reset // compute_rho_u(dfs,rho,vel); - auto eq = equilibrium(rho,vel); - vel = vel + force * half / rho; + vel = vel + force * half; + auto eq = equilibrium(rho,vel / rho); using dfi = df_info; @@ -109,12 +110,12 @@ public: for(uint64_t d{0u}; d < Descriptor::D; ++d){ ci.at({{d}}).set(static_cast::type>(dfi::directions[i][d])); } - auto ci_dot_u = saw::math::dot(ci,vel); + auto ci_dot_u = saw::math::dot(ci,vel/rho); saw::data> w; w.at({}).set(dfi::weights[i]); - auto term1 = (ci-vel) * dfi_inv_cs2; + auto term1 = (ci-vel/rho) * dfi_inv_cs2; auto term2 = ci * (ci_dot_u * dfi_inv_cs2 * dfi_inv_cs2); auto force_projection = saw::math::dot(term1 + term2, force); -- cgit v1.2.3