From 434c888eef53c4152cd99922a4a65df79ac0b2aa Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Thu, 21 Mar 2019 15:37:28 +0100 Subject: Use Bouzidi boundary condition for refined cylinder2d --- apps/adrian/cylinder2d/common/model.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'apps') diff --git a/apps/adrian/cylinder2d/common/model.h b/apps/adrian/cylinder2d/common/model.h index d70208a..124a1df 100644 --- a/apps/adrian/cylinder2d/common/model.h +++ b/apps/adrian/cylinder2d/common/model.h @@ -115,7 +115,19 @@ void prepareLattice(Grid2D& grid) sLattice.defineDynamics(sGeometry, 2, &bulkDynamics); // walls sLattice.defineDynamics(sGeometry, 3, &bulkDynamics); // inflow sLattice.defineDynamics(sGeometry, 4, &bulkDynamics); // outflow - sLattice.defineDynamics(sGeometry, 5, &instances::getBounceBack()); // cylinder + + // only set zero velocity boundary if cylinder covered by the grid + if (sGeometry.getStatistics().getNvoxel(5) > 0) { + sLattice.defineDynamics(sGeometry, 5, &instances::getNoDynamics()); + + sOffLatticeBoundaryCondition2D sOffBoundaryCondition = grid.getOffLatticeBoundaryCondition(); + createBouzidiBoundaryCondition2D(sOffBoundaryCondition); + + const Vector cylinderOrigin {cylinderCenter[0], cylinderCenter[1]}; + IndicatorCircle2D obstacle(cylinderOrigin, cylinderD/2); + + sOffBoundaryCondition.addZeroVelocityBoundary(sGeometry, 5, obstacle); + } sBoundaryCondition.addVelocityBoundary(sGeometry, 2, omega); sBoundaryCondition.addVelocityBoundary(sGeometry, 3, omega); @@ -131,7 +143,6 @@ void prepareLattice(Grid2D& grid) sLattice.initialize(); clout << "Prepare lattice ... OK" << std::endl; - sGeometry.print(); } void setBoundaryValues(Grid2D& grid, int iT) -- cgit v1.2.3