summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorAdrian Kummerlaender2019-01-21 12:34:38 +0100
committerAdrian Kummerlaender2019-06-24 15:17:09 +0200
commit6e9ee22dc5806b542b07bb93a700ece408d03c48 (patch)
tree876fc1c37acb465620f4f8cebcb4a84549d961bd /apps
parentf234abc7b3474a4ea3d2a1544108a151f1189fd5 (diff)
downloadgrid_refinement_openlb-6e9ee22dc5806b542b07bb93a700ece408d03c48.tar
grid_refinement_openlb-6e9ee22dc5806b542b07bb93a700ece408d03c48.tar.gz
grid_refinement_openlb-6e9ee22dc5806b542b07bb93a700ece408d03c48.tar.bz2
grid_refinement_openlb-6e9ee22dc5806b542b07bb93a700ece408d03c48.tar.lz
grid_refinement_openlb-6e9ee22dc5806b542b07bb93a700ece408d03c48.tar.xz
grid_refinement_openlb-6e9ee22dc5806b542b07bb93a700ece408d03c48.tar.zst
grid_refinement_openlb-6e9ee22dc5806b542b07bb93a700ece408d03c48.zip
Use velocity walls in refined Poiseuille2d
Diffstat (limited to 'apps')
-rw-r--r--apps/adrian/poiseuille2d/poiseuille2d.cpp27
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();