diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/adrian/cylinder2d/common/model.h | 15 |
1 files changed, 13 insertions, 2 deletions
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<T,DESCRIPTOR>& 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<T,DESCRIPTOR>()); // cylinder + + // only set zero velocity boundary if cylinder covered by the grid + if (sGeometry.getStatistics().getNvoxel(5) > 0) { + sLattice.defineDynamics(sGeometry, 5, &instances::getNoDynamics<T,DESCRIPTOR>()); + + sOffLatticeBoundaryCondition2D<T,DESCRIPTOR> sOffBoundaryCondition = grid.getOffLatticeBoundaryCondition(); + createBouzidiBoundaryCondition2D<T,DESCRIPTOR>(sOffBoundaryCondition); + + const Vector<T,2> cylinderOrigin {cylinderCenter[0], cylinderCenter[1]}; + IndicatorCircle2D<T> 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<T,DESCRIPTOR>& grid) sLattice.initialize(); clout << "Prepare lattice ... OK" << std::endl; - sGeometry.print(); } void setBoundaryValues(Grid2D<T,DESCRIPTOR>& grid, int iT) |