diff options
Use velocity walls in refined Poiseuille2d
Diffstat (limited to 'apps')
-rw-r--r-- | apps/adrian/poiseuille2d/poiseuille2d.cpp | 27 |
1 files 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<T,DESCRIPTOR>& grid, sLattice.defineDynamics(sGeometry, 0, &instances::getNoDynamics<T, DESCRIPTOR>()); sLattice.defineDynamics(sGeometry, 1, &bulkDynamics); // bulk - sLattice.defineDynamics(sGeometry, 2, &instances::getBounceBack<T, DESCRIPTOR>()); + sLattice.defineDynamics(sGeometry, 2, &instances::getNoDynamics<T, DESCRIPTOR>()); 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<T,DESCRIPTOR>& grid, std::vector<T> axisDirection{1, 0}; Poiseuille2D<T> 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(); |