From c67e4e1d68459fc29b6a1b4428256b6f86a43d78 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Wed, 17 Oct 2018 12:48:37 +0200 Subject: Fix density calculation in moving wall BC --- src/boundary_conditions.cc | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src') diff --git a/src/boundary_conditions.cc b/src/boundary_conditions.cc index 08b157c..3f54e85 100644 --- a/src/boundary_conditions.cc +++ b/src/boundary_conditions.cc @@ -32,12 +32,7 @@ void computeWallCell(DataCellBuffer& pop, Vector cell, Vector void computeMovingWallCell(DataCellBuffer& pop, Vector cell, Vector normal, Vector u) { const auto [neighborA, neighborB] = neighbors(normal); - const double rho = pop.curr(cell).get(-1,0) + pop.curr(cell).get(0,0) + pop.curr(cell).get(1,0) - + 2.*( - pop.curr(cell).get(-neighborA) + - pop.curr(cell).get(-normal ) + - pop.curr(cell).get(-neighborB) - ); + const double rho = static_cast(pop.curr(cell)).sum(); pop.curr(cell).get(neighborA) = pop.curr(cell).get(-neighborA) - (6. * weight.get(-neighborA) * rho * (-neighborA * u)); pop.curr(cell).get(normal ) = pop.curr(cell).get(-normal ) - (6. * weight.get(-normal) * rho * (-normal * u)); -- cgit v1.2.3