summaryrefslogtreecommitdiff
path: root/examples/poiseulle_particles_2d_hlbm_gpu/sim.cpp
diff options
context:
space:
mode:
authorClaudius "keldu" Holeksa <mail@keldu.de>2026-06-30 23:52:02 +0200
committerClaudius "keldu" Holeksa <mail@keldu.de>2026-06-30 23:52:02 +0200
commit2bae8b93faf614b1acb5df7269087b4f3786da5a (patch)
treea6db1328ed035c6130b6b29110e0891f6c78c7e4 /examples/poiseulle_particles_2d_hlbm_gpu/sim.cpp
parentb88d59477a7973bdee102aaf0e26c13c9059048b (diff)
downloadlibs-lbm-2bae8b93faf614b1acb5df7269087b4f3786da5a.tar.gz
Final run
Diffstat (limited to 'examples/poiseulle_particles_2d_hlbm_gpu/sim.cpp')
-rw-r--r--examples/poiseulle_particles_2d_hlbm_gpu/sim.cpp47
1 files changed, 22 insertions, 25 deletions
diff --git a/examples/poiseulle_particles_2d_hlbm_gpu/sim.cpp b/examples/poiseulle_particles_2d_hlbm_gpu/sim.cpp
index b09aa64..b1bd37d 100644
--- a/examples/poiseulle_particles_2d_hlbm_gpu/sim.cpp
+++ b/examples/poiseulle_particles_2d_hlbm_gpu/sim.cpp
@@ -48,6 +48,7 @@ template<typename T, typename Desc>
using MacroStruct = Struct<
Member<VelChunk<T,Desc>, "velocity">,
Member<RhoChunk<T>, "density">,
+ Member<VelChunk<T,Desc>, "force">,
Member<ScalarChunk<T,Desc>, "porosity">
>;
@@ -140,7 +141,8 @@ saw::error_or<void> setup_initial_conditions(
df_f.get_dims(),
{{1u,1u}}
);
-
+
+ /*
iterator<Desc::D>::apply(
[&](auto& index){
saw::data<sch::Vector<T,Desc::D>> middle, ind_vec;
@@ -159,6 +161,7 @@ saw::error_or<void> setup_initial_conditions(
{},// 0-index
df_f.get_dims()
);
+ */
return saw::make_void();
}
@@ -176,16 +179,23 @@ saw::error_or<void> step(
// auto coll_ev =
q.submit([&](acpp::sycl::handler& h){
- component<T,Desc,cmpt::Hlbm,encode::Sycl<saw::encode::Native>> collision{0.65};
+ component<T,Desc,cmpt::BGK, encode::Sycl<saw::encode::Native>> bgk{0.8};
+ component<T,Desc,cmpt::Hlbm,encode::Sycl<saw::encode::Native>> collision{0.8};
component<T,Desc,cmpt::BounceBack,encode::Sycl<saw::encode::Native>> bb;
component<T,Desc,cmpt::AntiBounceBack<0u>,encode::Sycl<saw::encode::Native>> abb;
- saw::data<sch::Scalar<T>> rho_b;
- rho_b.at({}) = 1.0;
- saw::data<sch::Vector<T,Desc::D>> vel_b;
- vel_b.at({{0u}}) = 0.015;
-
- component<T,Desc,cmpt::Equilibrium,encode::Sycl<saw::encode::Native>> equi{rho_b,vel_b};
+ saw::data<sch::Scalar<T>> eps;
+ eps.at({}).set(1.5f);
+ saw::data<sch::Scalar<T>> rad;
+ rad.at({}).set(dim_y*0.1);
+ saw::data<sch::Vector<T,Desc::D>> p_pos;
+ {
+ p_pos.at({{0u}}) = dim_x * 0.25;
+ p_pos.at({{1u}}) = dim_y * 0.5;
+ }
+ component<T,Desc,cmpt::OneParticleAt,encode::Sycl<saw::encode::Native>> opa{p_pos,rad,eps};
+
+ component<T,Desc,cmpt::ForceGather, encode::Sycl<saw::encode::Native>> fg;
component<T,Desc,cmpt::ZouHeHorizontal<true>,encode::Sycl<saw::encode::Native>> flow_in{
[&](){
@@ -214,32 +224,19 @@ saw::error_or<void> step(
bb.apply(fields,index,t_i);
break;
case 2u:
+ opa.apply(macros,index,t_i);
collision.apply(fields,macros,index,t_i);
- {
- saw::data<sch::Vector<T,Desc::D>> middle;
- middle.at({{0u}}) = dim_x * 0.25;
- middle.at({{1u}}) = dim_y * 0.5;
-
- saw::data<sch::Vector<T,Desc::D>> ind_vec;
- ind_vec.at({{0u}}) = index.at({{0u}}).template cast_to<T>();
- ind_vec.at({{1u}}) = index.at({{1u}}).template cast_to<T>();
-
- auto dist = middle - ind_vec;
- auto dist_2 = saw::math::dot(dist,dist);
- if(dist_2.at({}).get() < dim_y*dim_y*0.01){
- porous_f.at(index).at({}) = 0.0;
- }
- }
+ fg.apply(fields,macros,index,t_i);
break;
case 3u:
flow_in.apply(fields,index,t_i);
// equi.apply(fields,index,t_i);
- collision.apply(fields,macros,index,t_i);
+ bgk.apply(fields,macros,index,t_i);
break;
case 4u:
flow_out.apply(fields,index,t_i);
// equi.apply(fields,index,t_i);
- collision.apply(fields,macros,index,t_i);
+ bgk.apply(fields,macros,index,t_i);
break;
default:
break;