aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2018-10-17 12:48:37 +0200
committerAdrian Kummerlaender2018-10-17 12:48:37 +0200
commitc67e4e1d68459fc29b6a1b4428256b6f86a43d78 (patch)
tree3fc2742f105d285de20e26ea203c8a94a39fed2f
parent2bcbae122b141147e472bdbbad219c3571f71d0b (diff)
downloadboltzbub-c67e4e1d68459fc29b6a1b4428256b6f86a43d78.tar
boltzbub-c67e4e1d68459fc29b6a1b4428256b6f86a43d78.tar.gz
boltzbub-c67e4e1d68459fc29b6a1b4428256b6f86a43d78.tar.bz2
boltzbub-c67e4e1d68459fc29b6a1b4428256b6f86a43d78.tar.lz
boltzbub-c67e4e1d68459fc29b6a1b4428256b6f86a43d78.tar.xz
boltzbub-c67e4e1d68459fc29b6a1b4428256b6f86a43d78.tar.zst
boltzbub-c67e4e1d68459fc29b6a1b4428256b6f86a43d78.zip
Fix density calculation in moving wall BC
-rw-r--r--src/boundary_conditions.cc7
1 files changed, 1 insertions, 6 deletions
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<std::size_t> cell, Vector<int>
void computeMovingWallCell(DataCellBuffer& pop, Vector<std::size_t> cell, Vector<int> normal, Vector<double> 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<Cell&>(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));