diff options
| author | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-03-23 17:33:24 +0100 |
|---|---|---|
| committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-03-23 17:33:24 +0100 |
| commit | 889710232771ce78be5e815d5e12dc42a57ffcb0 (patch) | |
| tree | 79d7b84a7a5054a962db7f736b528d73a2d107f6 /examples/poiseulle_particles_2d_psm_gpu/sim.cpp | |
| parent | 15bb1ae31583b53b448bf8f6300384ddf0025668 (diff) | |
| parent | 571e79c4d0b72202186fd11314cf268723b1844d (diff) | |
| download | libs-lbm-889710232771ce78be5e815d5e12dc42a57ffcb0.tar.gz | |
Merge branch 'dev'
Diffstat (limited to 'examples/poiseulle_particles_2d_psm_gpu/sim.cpp')
| -rw-r--r-- | examples/poiseulle_particles_2d_psm_gpu/sim.cpp | 45 |
1 files changed, 32 insertions, 13 deletions
diff --git a/examples/poiseulle_particles_2d_psm_gpu/sim.cpp b/examples/poiseulle_particles_2d_psm_gpu/sim.cpp index a8aeabb..7702808 100644 --- a/examples/poiseulle_particles_2d_psm_gpu/sim.cpp +++ b/examples/poiseulle_particles_2d_psm_gpu/sim.cpp @@ -83,7 +83,24 @@ saw::error_or<void> setup_initial_conditions( info_f.get_dims(), {{1u,1u}} ); - + // Corners + /// Inflow + iterator<Desc::D>::apply( + [&](auto& index){ + info_f.at(index).set(5u); + }, + {{0u,0u}}, + {{1u,dim_y}} + ); + /// Outflow + iterator<Desc::D>::apply( + [&](auto& index){ + info_f.at(index).set(5u); + }, + {{dim_x-1u,0u}}, + {{dim_x, dim_y}} + ); + // Overwrite with // Inflow iterator<Desc::D>::apply( [&](auto& index){ @@ -202,7 +219,7 @@ saw::error_or<void> step( q.submit([&](acpp::sycl::handler& h){ - component<T,Desc,cmpt::PSM,encode::Sycl<saw::encode::Native>> collision{0.65}; + component<T,Desc,cmpt::PSM,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; @@ -243,15 +260,19 @@ saw::error_or<void> step( collision.apply(fields,macros,index,t_i); break; case 3u: - //flow_in.apply(fields,index,t_i); - equi.apply(fields,index,t_i); + flow_in.apply(fields,index,t_i); + //equi.apply(fields,index,t_i); collision.apply(fields,macros,index,t_i); break; case 4u: - // flow_out.apply(fields,index,t_i); - equi.apply(fields,index,t_i); + flow_out.apply(fields,index,t_i); + // equi.apply(fields,index,t_i); collision.apply(fields,macros,index,t_i); - break; + break; + case 5u: + // Corners + bb.apply(fields,index,t_i); + break; default: break; } @@ -295,12 +316,12 @@ saw::error_or<void> lbm_main(int argc, char** argv){ converter<T> conv { // delta_x - {{1.0}}, + {{1e-3}}, // delta_t - {{1.0}} + {{1e-06}} }; - print_lbm_meta<T,Desc>(conv,{0.05},{0.01},{0.4 * dim_y}); + print_lbm_meta<T,Desc>(conv,{0.1},{1e-2},{0.4 * dim_y *1e-3}); // saw::data<sch::FixedArray<sch::UInt64,Desc::D>> meta{{dim_x,dim_y}}; auto lbm_data_ptr = saw::heap<saw::data<sch::ChunkStruct<T,Desc>>>(); @@ -382,8 +403,7 @@ saw::error_or<void> lbm_main(int argc, char** argv){ } } sycl_q.wait(); - /* - { + if(i.get() % 1 == 0u){ { auto eov = dev.copy_to_host(lbm_sycl_macro_data,*lbm_macro_data_ptr); if(eov.is_error()){ @@ -397,7 +417,6 @@ saw::error_or<void> lbm_main(int argc, char** argv){ } } } - */ /* { { |
