summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorAdrian Kummerlaender2019-03-21 15:37:28 +0100
committerAdrian Kummerlaender2019-06-24 15:18:01 +0200
commit434c888eef53c4152cd99922a4a65df79ac0b2aa (patch)
tree7fb5ffd2befd5690c1bc776c97e384afcd3fd4b9 /apps
parentc0148c928ff827ee00b6266a4f41649a621698cf (diff)
downloadgrid_refinement_openlb-434c888eef53c4152cd99922a4a65df79ac0b2aa.tar
grid_refinement_openlb-434c888eef53c4152cd99922a4a65df79ac0b2aa.tar.gz
grid_refinement_openlb-434c888eef53c4152cd99922a4a65df79ac0b2aa.tar.bz2
grid_refinement_openlb-434c888eef53c4152cd99922a4a65df79ac0b2aa.tar.lz
grid_refinement_openlb-434c888eef53c4152cd99922a4a65df79ac0b2aa.tar.xz
grid_refinement_openlb-434c888eef53c4152cd99922a4a65df79ac0b2aa.tar.zst
grid_refinement_openlb-434c888eef53c4152cd99922a4a65df79ac0b2aa.zip
Use Bouzidi boundary condition for refined cylinder2d
Diffstat (limited to 'apps')
-rw-r--r--apps/adrian/cylinder2d/common/model.h15
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)