57 double kT,
unsigned int seed) {
58 auto const omega = shear_mode_relaxation_rate();
59 auto const omega_odd = odd_mode_relaxation_rate(omega);
63 auto obj =
typename Kernels::StreamCollisionModelThermalized(
65 omega, omega, omega_odd, omega, seed, uint32_t{0u});
67 m_run_stream_collide_sweep = StreamCollideSweepVisitor(blocks);
81 std::unique_ptr<LeesEdwardsPack> &&lees_edwards_pack) {
83#if defined(__CUDACC__) and defined(WALBERLA_BUILD_WITH_CUDA)
85 throw std::runtime_error(
"Lees-Edwards LB doesn't support GPU yet");
88 auto const shear_direction = lees_edwards_pack->shear_direction;
89 auto const shear_plane_normal = lees_edwards_pack->shear_plane_normal;
90 auto const shear_vel =
FloatType_c(lees_edwards_pack->get_shear_velocity());
91 auto const omega = shear_mode_relaxation_rate();
92 auto const omega_odd = odd_mode_relaxation_rate(omega);
93 if (shear_plane_normal != 1u) {
94 throw std::domain_error(
95 "Lees-Edwards LB only supports shear_plane_normal=\"y\"");
98 if (shear_direction != 0u) {
99 throw std::domain_error(
100 "Lees-Edwards LB only supports shear_direction=\"x\"");
103 auto const n_ghost_layers = lattice.get_ghost_layers();
104 auto const blocks = lattice.get_blocks();
105 if (lattice.get_node_grid()[shear_direction] != 1 or
106 blocks->getSize(shear_direction) != 1ul or
107 blocks->getSize(shear_plane_normal) !=
108 lattice.get_node_grid()[shear_plane_normal]) {
109 throw std::domain_error(
"LB LEbc doesn't support domain decomposition "
110 "along the shear direction, nor multiple blocks "
111 "along the normal direction");
113 auto const &grid_dimensions = lattice.get_grid_dimensions();
114 auto const block_origin = lattice.get_local_grid_range(
false).first;
115 auto const lebc_slab_origin = block_origin[shear_plane_normal];
116 auto const lebc_slab_total_thickness = grid_dimensions[shear_plane_normal];
117 auto const lebc_bot_index = 0 - lebc_slab_origin;
118 auto const lebc_top_index = lebc_slab_total_thickness - lebc_slab_origin;
120 typename Kernels::StreamCollisionModelLeesEdwards(
122 lebc_top_index, omega, omega, omega_odd, omega, shear_vel));
124 m_run_stream_collide_sweep =
127 std::make_shared<InterpolateAndShiftAtBoundary<_PdfField, FloatType>>(
129 shear_direction, shear_plane_normal,
132 std::make_shared<InterpolateAndShiftAtBoundary<_VectorField, FloatType>>(
134 shear_direction, shear_plane_normal,
138 std::make_shared<InterpolateAndShiftAtBoundary<_VectorField, FloatType>>(
140 n_ghost_layers, shear_direction, shear_plane_normal,