From 6e9ee22dc5806b542b07bb93a700ece408d03c48 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Mon, 21 Jan 2019 12:34:38 +0100 Subject: Use velocity walls in refined Poiseuille2d --- apps/adrian/poiseuille2d/poiseuille2d.cpp | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/apps/adrian/poiseuille2d/poiseuille2d.cpp b/apps/adrian/poiseuille2d/poiseuille2d.cpp index b49f24c..6d0c86f 100644 --- a/apps/adrian/poiseuille2d/poiseuille2d.cpp +++ b/apps/adrian/poiseuille2d/poiseuille2d.cpp @@ -36,11 +36,11 @@ typedef double T; #define DESCRIPTOR descriptors::D2Q9Descriptor -const T lx = 4.0; // length of the channel -const T ly = 1.0; // height of the channel -const int N = 50; // resolution of the model -const T Re = 100.; // Reynolds number -const T uMax = 0.02; // Max lattice speed +const T lx = 4.0; // length of the channel +const T ly = 1.0; // height of the channel +const int N = 10; // resolution of the model +const T Re = 10.; // Reynolds number +const T uMax = 0.01; // Max lattice speed const T maxPhysT = 60.; // max. simulation time in s, SI unit const T physInterval = 0.25; // interval for the convergence check in s const T residuum = 1e-5; // residuum for the convergence check @@ -105,12 +105,13 @@ void prepareLattice(Grid2D& grid, sLattice.defineDynamics(sGeometry, 0, &instances::getNoDynamics()); sLattice.defineDynamics(sGeometry, 1, &bulkDynamics); // bulk - sLattice.defineDynamics(sGeometry, 2, &instances::getBounceBack()); + sLattice.defineDynamics(sGeometry, 2, &instances::getNoDynamics()); sLattice.defineDynamics(sGeometry, 3, &bulkDynamics); // inflow sLattice.defineDynamics(sGeometry, 4, &bulkDynamics); // outflow + sBoundaryCondition.addVelocityBoundary(sGeometry, 2, omega); sBoundaryCondition.addVelocityBoundary(sGeometry, 3, omega); - sBoundaryCondition.addVelocityBoundary(sGeometry, 4, omega); + sBoundaryCondition.addPressureBoundary(sGeometry, 4, omega); const T Lx = converter.getLatticeLength(lx); const T Ly = converter.getLatticeLength(ly); @@ -123,15 +124,9 @@ void prepareLattice(Grid2D& grid, std::vector axisDirection{1, 0}; Poiseuille2D u(axisPoint, axisDirection, maxVelocity, radius); - sLattice.defineRhoU(sGeometry, 1, rho, u); - sLattice.iniEquilibrium(sGeometry, 1, rho, u); - sLattice.defineRhoU(sGeometry, 2, rho, u); - sLattice.iniEquilibrium(sGeometry, 2, rho, u); - - sLattice.defineRhoU(sGeometry, 3, rho, u); - sLattice.iniEquilibrium(sGeometry, 3, rho, u); - sLattice.defineRhoU(sGeometry, 4, rho, u); - sLattice.iniEquilibrium(sGeometry, 4, rho, u); + auto materials = sGeometry.getMaterialIndicator({1,2,3,4}); + sLattice.defineRhoU(materials, rho, u); + sLattice.iniEquilibrium(materials, rho, u); sLattice.initialize(); -- cgit v1.2.3