From 2b153a0e0263e5a76550b15382e2609f7b5a5d41 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Mon, 24 Aug 2026 17:15:52 +0200 Subject: Stuff --- examples/one_particle_sedimentation_2d/common.hpp | 14 ++++++++------ examples/one_particle_sedimentation_2d/init.hpp | 4 ++-- examples/one_particle_sedimentation_2d/sim.cpp | 2 +- examples/one_particle_sedimentation_2d/step.hpp | 1 - examples/schaefer_turek_durst_krause_rannbacher/sim.cpp | 9 +++++++-- 5 files changed, 18 insertions(+), 12 deletions(-) (limited to 'examples') diff --git a/examples/one_particle_sedimentation_2d/common.hpp b/examples/one_particle_sedimentation_2d/common.hpp index 37e0402..954557d 100644 --- a/examples/one_particle_sedimentation_2d/common.hpp +++ b/examples/one_particle_sedimentation_2d/common.hpp @@ -14,15 +14,17 @@ namespace kel { namespace lbm { /** - * length 2.2m - * height 0.41m + * length 20mm + * height 80mm * viscosity 10^-3 - * particle diameter 0.1m - * position at (0.16m,0.2m) + * particle radius 1.25mm + * position at (10mm,40mm) + * particle density 0.00125g/mm³ + * fluid density 0.001g/mm³ */ -constexpr uint64_t dim_y = 512ul; -constexpr uint64_t dim_x = 256ul; +constexpr uint64_t dim_y = 800ul; +constexpr uint64_t dim_x = 200ul; constexpr uint64_t particle_amount = 1ul; diff --git a/examples/one_particle_sedimentation_2d/init.hpp b/examples/one_particle_sedimentation_2d/init.hpp index a35c6e8..d9b8a37 100644 --- a/examples/one_particle_sedimentation_2d/init.hpp +++ b/examples/one_particle_sedimentation_2d/init.hpp @@ -87,8 +87,8 @@ saw::error_or init( auto& prb = p.template get<"rigid_body">(); auto& p_pos = prb.template get<"position">(); auto& p_posold = prb.template get<"position_old">(); - p_pos.at({{0u}}) = conv.meter_si_to_lbm({{0.16}}).handle(); - p_pos.at({{1u}}) = conv.meter_si_to_lbm({{0.2}}).handle(); + p_pos.at({{0u}}) = conv.meter_si_to_lbm({{0.01}}).handle(); + p_pos.at({{1u}}) = conv.meter_si_to_lbm({{0.04}}).handle(); p_posold = p_pos; } diff --git a/examples/one_particle_sedimentation_2d/sim.cpp b/examples/one_particle_sedimentation_2d/sim.cpp index 7c9a56c..b0b374c 100644 --- a/examples/one_particle_sedimentation_2d/sim.cpp +++ b/examples/one_particle_sedimentation_2d/sim.cpp @@ -46,7 +46,7 @@ saw::error_or lbm_main(const saw::data& args){ converter conv { // delta_x - {{0.41 / dim_y}}, + {{0.02 / dim_x}}, // delta_t {{1.067e-4}} }; diff --git a/examples/one_particle_sedimentation_2d/step.hpp b/examples/one_particle_sedimentation_2d/step.hpp index 07f51d1..20b7f4b 100644 --- a/examples/one_particle_sedimentation_2d/step.hpp +++ b/examples/one_particle_sedimentation_2d/step.hpp @@ -30,7 +30,6 @@ saw::error_or step( for(uint64_t i = 0u; i < Desc::D; ++i){ index.at({{i}}).set(idx[i]); } - hlbm_reset.apply(fields,macros,index,t_i); }); }).wait(); diff --git a/examples/schaefer_turek_durst_krause_rannbacher/sim.cpp b/examples/schaefer_turek_durst_krause_rannbacher/sim.cpp index b9b3778..4d015c9 100644 --- a/examples/schaefer_turek_durst_krause_rannbacher/sim.cpp +++ b/examples/schaefer_turek_durst_krause_rannbacher/sim.cpp @@ -144,7 +144,7 @@ saw::error_or lbm_main(const saw::data& args){ } } { - auto eov = write_csv_file(out_dir,"stdkr_2d",i.get(), *lbm_macro_data_ptr); + auto eov = write_vtk_file(out_dir,std::string{"stdkr_2d_"}+an.template get<"coupling">().stl_string(),i.get(), *lbm_macro_data_ptr); if(eov.is_error()){ return eov; } @@ -189,7 +189,12 @@ saw::error_or lbm_main(const saw::data& args){ return eov; } } - + { + auto eov = write_csv_file(out_dir,"stdkr_2d",time_steps.get(), *lbm_macro_data_ptr); + if(eov.is_error()){ + return eov; + } + } sycl_q.wait(); return saw::make_void(); } -- cgit v1.2.3 From f5d88c1ae8948724f11d30c1c2af385cc093eed2 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Mon, 24 Aug 2026 19:02:51 +0200 Subject: Fixing FpLBM, because I messed up guo forcing --- .../schaefer_turek_durst_krause_rannbacher/sim.cpp | 2 +- .../step.hpp | 23 ++++++++++++++++------ 2 files changed, 18 insertions(+), 7 deletions(-) (limited to 'examples') diff --git a/examples/schaefer_turek_durst_krause_rannbacher/sim.cpp b/examples/schaefer_turek_durst_krause_rannbacher/sim.cpp index 4d015c9..ff6a43a 100644 --- a/examples/schaefer_turek_durst_krause_rannbacher/sim.cpp +++ b/examples/schaefer_turek_durst_krause_rannbacher/sim.cpp @@ -48,7 +48,7 @@ saw::error_or lbm_main(const saw::data& args){ // delta_x {{0.41 / dim_y}}, // delta_t - {{1.067e-4}} + {{1.067e-4 * 0.5}} }; print_lbm_meta(conv,{1e-3},{1e-4},{0.5 * dim_y}); diff --git a/examples/schaefer_turek_durst_krause_rannbacher/step.hpp b/examples/schaefer_turek_durst_krause_rannbacher/step.hpp index cbdfd10..9748ec8 100644 --- a/examples/schaefer_turek_durst_krause_rannbacher/step.hpp +++ b/examples/schaefer_turek_durst_krause_rannbacher/step.hpp @@ -8,6 +8,7 @@ namespace lbm { template saw::error_or step( const converter& conv, + const saw::data>& tau, saw::data>,encode::Sycl>& fields, saw::data>,encode::Sycl>& macros, saw::data>,encode::Sycl>& particles, @@ -48,7 +49,7 @@ saw::error_or step( }).wait(); q.submit([&](acpp::sycl::handler& h){ - component> collision{1.0}; + component> collision{0.75}; component> bb; component,encode::Sycl> flow_out{1.0}; @@ -74,9 +75,19 @@ saw::error_or step( component,encode::Sycl> flow_in{ [&]() -> saw::data> { saw::data> vel; + saw::data scale; + { + scale.set([&](){ + if(t_i.get() > 2048u){ + return 1.0f; + } + + return t_i.get() / 2048.0f; + }()); + } { auto y_si = conv.meter_lbm_to_si(index.at({{1u}}).template cast_to()).handle(); - vel.at({{0u}}) = conv.velocity_si_to_lbm({{static_cast::type>((1.2 / 0.41) * y_si.get() - (1.2 / (0.41*0.41)) * y_si.get() * y_si.get())}}).handle(); + vel.at({{0u}}) = conv.velocity_si_to_lbm({{static_cast::type>((1.2 / 0.41) * y_si.get() - (1.2 / (0.41*0.41)) * y_si.get() * y_si.get())}}).handle() * scale; vel.at({{1u}}) = 0.0f; } return vel; @@ -123,8 +134,8 @@ saw::error_or step( // auto coll_ev = q.submit([&](acpp::sycl::handler& h){ - component> bgk{1.0}; - component> collision{1.0}; + component> bgk{0.75}; + component> collision{0.75}; component> bb; component,encode::Sycl> flow_out{1.0}; @@ -199,8 +210,8 @@ saw::error_or step( // auto coll_ev = q.submit([&](acpp::sycl::handler& h){ - component> bgk{1.0}; - component> collision{1.0}; + component> bgk{0.75}; + component> collision{0.75}; component> bb; component,encode::Sycl> flow_out{1.0}; -- cgit v1.2.3 From 76dea4c1035bf063802ca0cc650d69aef8047b9f Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Mon, 24 Aug 2026 19:19:45 +0200 Subject: Fixing examples --- examples/schaefer_turek_durst_krause_rannbacher/sim.cpp | 4 +++- examples/schaefer_turek_durst_krause_rannbacher/step.hpp | 7 ++----- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'examples') diff --git a/examples/schaefer_turek_durst_krause_rannbacher/sim.cpp b/examples/schaefer_turek_durst_krause_rannbacher/sim.cpp index ff6a43a..59f61d9 100644 --- a/examples/schaefer_turek_durst_krause_rannbacher/sim.cpp +++ b/examples/schaefer_turek_durst_krause_rannbacher/sim.cpp @@ -122,7 +122,7 @@ saw::error_or lbm_main(const saw::data& args){ auto lsdm_view = make_view(lbm_sycl_macro_data); auto lsdp_view = make_view(lbm_sycl_particle_data); - saw::data time_steps{64u*1024ul}; + saw::data time_steps{128u*1024ul}; auto& info_f = lsd_view.template get<"info">(); @@ -136,6 +136,7 @@ saw::error_or lbm_main(const saw::data& args){ } sycl_q.wait(); + /* if(i.get() % 64u == 0u){ { auto eov = dev.copy_to_host(lbm_sycl_macro_data,*lbm_macro_data_ptr); @@ -150,6 +151,7 @@ saw::error_or lbm_main(const saw::data& args){ } } } + */ // Stream sycl_q.submit([&](acpp::sycl::handler& h){ component> stream; diff --git a/examples/schaefer_turek_durst_krause_rannbacher/step.hpp b/examples/schaefer_turek_durst_krause_rannbacher/step.hpp index 9748ec8..beb123b 100644 --- a/examples/schaefer_turek_durst_krause_rannbacher/step.hpp +++ b/examples/schaefer_turek_durst_krause_rannbacher/step.hpp @@ -8,7 +8,6 @@ namespace lbm { template saw::error_or step( const converter& conv, - const saw::data>& tau, saw::data>,encode::Sycl>& fields, saw::data>,encode::Sycl>& macros, saw::data>,encode::Sycl>& particles, @@ -20,8 +19,6 @@ saw::error_or step( auto& q = dev.get_handle(); auto& info_f = fields.template get<"info">(); auto& porous_f = macros.template get<"porosity">(); - - if constexpr ( std::is_same_v ){ q.submit([&](acpp::sycl::handler& h){ @@ -78,11 +75,11 @@ saw::error_or step( saw::data scale; { scale.set([&](){ - if(t_i.get() > 2048u){ + if(t_i.get() > 1024u){ return 1.0f; } - return t_i.get() / 2048.0f; + return t_i.get() / 1024.0f; }()); } { -- cgit v1.2.3