diff --git a/src/script_interface/walberla/LBFluid.hpp b/src/script_interface/walberla/LBFluid.hpp index 036f408729..b2d733decb 100644 --- a/src/script_interface/walberla/LBFluid.hpp +++ b/src/script_interface/walberla/LBFluid.hpp @@ -77,7 +77,7 @@ class LBFluid : public LatticeModel<::LBWalberlaBase, LBVTKHandle> { [this]() { return m_instance->get_lattice().get_grid_dimensions(); }}, {"kT", AutoParameter::read_only, [this]() { return m_instance->get_kT() / m_conv_energy; }}, - {"seed", AutoParameter::read_only, [this]() { return m_seed; }}, + {"seed", AutoParameter::read_only, [this]() { return m_instance->get_seed(); }}, {"rng_state", [this](Variant const &v) { auto const rng_state = get_value(v); diff --git a/src/walberla_bridge/include/walberla_bridge/lattice_boltzmann/LBWalberlaBase.hpp b/src/walberla_bridge/include/walberla_bridge/lattice_boltzmann/LBWalberlaBase.hpp index c0dd6406cc..a09dfdc272 100644 --- a/src/walberla_bridge/include/walberla_bridge/lattice_boltzmann/LBWalberlaBase.hpp +++ b/src/walberla_bridge/include/walberla_bridge/lattice_boltzmann/LBWalberlaBase.hpp @@ -257,6 +257,9 @@ class LBWalberlaBase : public LatticeModel { /** @brief Get the fluid temperature (if thermalized). */ virtual double get_kT() const noexcept = 0; + /** @brief Get the fluid thermostat (if thermalized). */ + virtual int get_seed() const noexcept = 0; + /** @brief Set the RNG counter (if thermalized). */ [[nodiscard]] virtual std::optional get_rng_state() const = 0; diff --git a/src/walberla_bridge/src/lattice_boltzmann/LBWalberlaImpl.hpp b/src/walberla_bridge/src/lattice_boltzmann/LBWalberlaImpl.hpp index 1f1a8bb24e..93ea2f0186 100644 --- a/src/walberla_bridge/src/lattice_boltzmann/LBWalberlaImpl.hpp +++ b/src/walberla_bridge/src/lattice_boltzmann/LBWalberlaImpl.hpp @@ -257,6 +257,7 @@ class LBWalberlaImpl : public LBWalberlaBase { FloatType m_viscosity; /// kinematic viscosity FloatType m_density; FloatType m_kT; + int m_seed; // Block data access handles BlockDataID m_pdf_field_id; @@ -1366,6 +1367,10 @@ class LBWalberlaImpl : public LBWalberlaBase { return numeric_cast(m_kT); } + [[nodiscard]] int get_seed() const noexcept override { + return m_seed; + } + [[nodiscard]] std::optional get_rng_state() const override { auto const cm = std::get_if(&*m_collision_model); if (!cm or m_kT == 0.) {