summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2026-02-20 17:46:58 +0100
committerClaudius "keldu" Holeksa <mail@keldu.de>2026-02-20 17:46:58 +0100
commitb330a03a1088d5cdeaa6dd7893b38e5c4ef0a9e7 (patch)
tree9188d9bca15917b5e1ded0a9f3d0f335381d9ccf
parentcb514e099515934322d9400d559a65b831cf4c5f (diff)
downloadlibs-lbm-b330a03a1088d5cdeaa6dd7893b38e5c4ef0a9e7.tar.gz
Adding PSM component to default include. Porosity in HLBM reset turned
off
-rw-r--r--examples/poiseulle_particles_2d_gpu/sim.cpp15
-rw-r--r--lib/core/c++/hlbm.hpp2
-rw-r--r--lib/core/c++/lbm.hpp1
-rw-r--r--lib/core/c++/psm.hpp2
4 files changed, 8 insertions, 12 deletions
diff --git a/examples/poiseulle_particles_2d_gpu/sim.cpp b/examples/poiseulle_particles_2d_gpu/sim.cpp
index 8e522b4..ae197f9 100644
--- a/examples/poiseulle_particles_2d_gpu/sim.cpp
+++ b/examples/poiseulle_particles_2d_gpu/sim.cpp
@@ -89,7 +89,7 @@ saw::error_or<void> setup_initial_conditions(
info_f.at(index).set(3u);
},
{{0u,0u}},
- {{1u, dim_y}},
+ {{1u,dim_y}},
{{0u,1u}}
);
@@ -129,7 +129,7 @@ saw::error_or<void> setup_initial_conditions(
auto& rho = rho_f.at(index);
rho.at({}) = {1};
auto& vel = vel_f.at(index);
- vel.at({{0u}}) = 0.1;
+ vel.at({{0u}}) = 0.0;
auto eq = equilibrium<T,Desc>(rho,vel);
df = eq;
@@ -202,7 +202,8 @@ saw::error_or<void> step(
q.submit([&](acpp::sycl::handler& h){
// Need nicer things to handle the flow. I see improvement here
// component<T,Desc,cmpt::BGK, encode::Sycl<saw::encode::Native>> collision{0.6};
- component<T,Desc,cmpt::HLBM,encode::Sycl<saw::encode::Native>> collision{0.6};
+ // component<T,Desc,cmpt::HLBM,encode::Sycl<saw::encode::Native>> collision{0.6};
+ component<T,Desc,cmpt::PSM,encode::Sycl<saw::encode::Native>> collision{0.6};
component<T,Desc,cmpt::BounceBack,encode::Sycl<saw::encode::Native>> bb;
saw::data<sch::Scalar<T>> rho_b;
@@ -378,7 +379,7 @@ saw::error_or<void> lbm_main(int argc, char** argv){
}
}
sycl_q.wait();
- saw::data<sch::UInt64> time_steps{1024ul};
+ saw::data<sch::UInt64> time_steps{8096ul};
for(saw::data<sch::UInt64> i{0u}; i < time_steps and krun; ++i){
{
@@ -401,12 +402,6 @@ saw::error_or<void> lbm_main(int argc, char** argv){
return eov;
}
}
- {
- auto eov = dev.copy_to_host(lbm_sycl_data,*lbm_data_ptr);
- if(eov.is_error()){
- return eov;
- }
- }
wait.poll();
if(print_status){
diff --git a/lib/core/c++/hlbm.hpp b/lib/core/c++/hlbm.hpp
index 4afe274..41e2e27 100644
--- a/lib/core/c++/hlbm.hpp
+++ b/lib/core/c++/hlbm.hpp
@@ -60,7 +60,7 @@ public:
dfs_old_f.at(index).at({i}) = dfs_old_f.at(index).at({i}) + frequency_ * (eq.at(i) - dfs_old_f.at(index).at({i}));
}
- porosity.at({}) = 1.0;
+ // porosity.at({}) = 1.0;
D.at({}) = 0.0;
}
};
diff --git a/lib/core/c++/lbm.hpp b/lib/core/c++/lbm.hpp
index df89a69..27a7df3 100644
--- a/lib/core/c++/lbm.hpp
+++ b/lib/core/c++/lbm.hpp
@@ -15,6 +15,7 @@
#include "hlbm.hpp"
#include "macroscopic.hpp"
#include "memory.hpp"
+#include "psm.hpp"
#include "stream.hpp"
#include "write_vtk.hpp"
#include "util.hpp"
diff --git a/lib/core/c++/psm.hpp b/lib/core/c++/psm.hpp
index 94d5ccd..74ba58e 100644
--- a/lib/core/c++/psm.hpp
+++ b/lib/core/c++/psm.hpp
@@ -20,7 +20,7 @@ private:
saw::data<sch::Scalar<T>> frequency_;
public:
component(
- saw::data<sch::Scalar<T>> relaxation__
+ typename saw::native_data_type<T>::type relaxation__
):
relaxation_{relaxation__}
{