From e821d617802ebbfff756844e4d9720342fc78a4e Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Fri, 13 Nov 2026 14:12:49 +0100 Subject: Swarm POC --- examples/throat_clog_2d/step.hpp | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) (limited to 'examples/throat_clog_2d/step.hpp') diff --git a/examples/throat_clog_2d/step.hpp b/examples/throat_clog_2d/step.hpp index 1605cf0..71df661 100644 --- a/examples/throat_clog_2d/step.hpp +++ b/examples/throat_clog_2d/step.hpp @@ -41,7 +41,7 @@ kel::lbm::error_or step( index.at({{i}}).set(idx[i]); } - hlbm_one_part.apply(fields,macros,particles,index,t_i,{0u}); + hlbm_one_part.apply(fields,macros,particles,index,t_i,{1u}); }); }).wait(); @@ -75,7 +75,7 @@ kel::lbm::error_or step( kel::lbm::data scale; { scale.set([&](){ - if(t_i.get() > 1024u){ + if(t_i.get() >= 0u){// > 1024u return 1.0f; } @@ -84,7 +84,7 @@ kel::lbm::error_or step( } { auto y_si = conv.meter_lbm_to_si(as_unit>(index.at({{1u}}).template cast_to())).handle(); - vel.at({{0u}}) = conv.velocity_si_to_lbm({static_cast::type>((0.1 / 0.64) * y_si.get() - (0.1 / (0.64*0.64)) * y_si.get() * y_si.get())}).handle() * scale; + vel.at({{0u}}) = conv.velocity_si_to_lbm({static_cast::type>((0.01 / 0.64) * y_si.get() - (0.01 / (0.64*0.64)) * y_si.get() * y_si.get())}).handle(); vel.at({{1u}}) = 0.0f; } return vel; @@ -116,24 +116,9 @@ kel::lbm::error_or step( }); }).wait(); - /** - * Particle step, split so contact lands between the fluid gather and - * the integration. With 20 particles in a converging throat they jam - * against one another, so without a contact pass they would simply - * pass through each other and through the walls. - */ q.submit([&](acpp::sycl::handler& h){ - component> p_reset; - component> p_gather; - component> p_integrate; - - /** - * Stiffness is sized so an impact at the inflow speed stays well - * under a tenth of a radius of overlap; see dem_stiffness_for. - */ - dem_params p_dem{2.0e-2, 0.4, 0.0, 0.0}; - kel::lbm::data> p_extent{{dim_x,dim_y}}; - component> p_contact{p_dem,p_extent}; + kel::lbm::data>> grav; // body acceleration + component> fplbm_one_part{grav}; h.parallel_for(acpp::sycl::range<1u>{particle_amount}, [=](acpp::sycl::id<1u> idx){ kel::lbm::data> index; @@ -141,10 +126,7 @@ kel::lbm::error_or step( index.at({{i}}).set(idx[i]); } - p_reset.apply(particles,index,t_i); - p_gather.apply(fields,macros,particles,index,t_i,{4u}); - p_contact.apply(particles,index,t_i,{4u}); - p_integrate.apply(particles,index,t_i,{4u}); + fplbm_one_part.apply(fields,macros,particles,index,t_i,{1u}); }); }).wait(); @@ -220,7 +202,7 @@ kel::lbm::error_or step( index.at({{i}}).set(idx[i]); } - fplbm_one_part.apply(fields,macros,particles,index,t_i,{0u}); + fplbm_one_part.apply(fields,macros,particles,index,t_i,{2u}); }); }).wait(); -- cgit v1.3.1