Skip to content

Commit

Permalink
Add seed to LBWalberlaImpl
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbbeyer committed Sep 2, 2024
1 parent a2fc1f5 commit ecc8430
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/core/lb/LBWalberla.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ void LBWalberla::update_collision_model() {
});
set_collision_model(std::move(lees_edwards_object));
} else {
set_collision_model(lb_kT, 42);
auto const seed = lb_fluid->get_seed();
set_collision_model(lb_kT, seed);
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/script_interface/walberla/LBFluid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,9 @@ void LBFluid::do_construct(VariantMap const &params) {
return get_shear_velocity(system.get_sim_time(), *le_protocol) *
(m_lb_params->get_tau() / m_lb_params->get_agrid());
});
m_instance->set_collision_model(std::move(lees_edwards_object));
//m_instance->set_collision_model(std::move(lees_edwards_object));
//m_instance->set_collision_model(std::move(lees_edwards_object));
::System::get_system().lb.set_collision_model(std::move(lees_edwards_object))
} else {
m_instance->set_collision_model(lb_kT, m_seed);
}
Expand Down
3 changes: 2 additions & 1 deletion src/walberla_bridge/src/lattice_boltzmann/LBWalberlaImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ class LBWalberlaImpl : public LBWalberlaBase {
LBWalberlaImpl(std::shared_ptr<LatticeWalberla> lattice, double viscosity,
double density)
: m_viscosity(FloatType_c(viscosity)), m_density(FloatType_c(density)),
m_kT(FloatType{0}), m_lattice(std::move(lattice)) {
m_kT(FloatType{0}), m_lattice(std::move(lattice)), m_seed(0) {

auto const &blocks = m_lattice->get_blocks();
auto const n_ghost_layers = m_lattice->get_ghost_layers();
Expand Down Expand Up @@ -593,6 +593,7 @@ class LBWalberlaImpl : public LBWalberlaBase {
auto const omega_odd = odd_mode_relaxation_rate(omega);
auto const blocks = get_lattice().get_blocks();
m_kT = FloatType_c(kT);
m_seed = seed;
auto obj = CollisionModelThermalized(m_last_applied_force_field_id,
m_pdf_field_id, m_kT, omega, omega,
omega_odd, omega, seed, uint32_t{0u});
Expand Down

0 comments on commit ecc8430

Please sign in to comment.