summaryrefslogtreecommitdiff
path: root/examples/one_particle_sedimentation_2d
diff options
context:
space:
mode:
Diffstat (limited to 'examples/one_particle_sedimentation_2d')
-rw-r--r--examples/one_particle_sedimentation_2d/sim.cpp21
-rw-r--r--examples/one_particle_sedimentation_2d/step.hpp11
2 files changed, 22 insertions, 10 deletions
diff --git a/examples/one_particle_sedimentation_2d/sim.cpp b/examples/one_particle_sedimentation_2d/sim.cpp
index 0cb3ce0..86a7b1c 100644
--- a/examples/one_particle_sedimentation_2d/sim.cpp
+++ b/examples/one_particle_sedimentation_2d/sim.cpp
@@ -48,10 +48,13 @@ saw::error_or<void> lbm_main(const saw::data<args::LbmArgs>& args){
// delta_x
{{0.02 / dim_x}},
// delta_t
- {{1.5e-6}}
+ {{3e-7}}
};
+ saw::data<sch::SiKinematicViscosity<T>> kin_vis_si{1e-3};
+ auto kin_vis_lbm = conv.kinematic_viscosity_si_to_lbm(kin_vis_si);
+ auto tau = conv.template kinematic_viscosity_lbm_to_tau<Desc>(kin_vis_lbm);
- print_lbm_meta<T,Desc>(conv,{1e-3},{1e-4},{2});
+ print_lbm_meta<T,Desc>(conv,kin_vis_si,{1e-4},{2});
std::cout<<"Position: "<<conv.meter_si_to_lbm({{0.01}}).handle().get()<<", "<<conv.meter_si_to_lbm({{0.04}}).handle().get()<<std::endl;
// saw::data<sch::FixedArray<sch::UInt64,Desc::D>> meta{{dim_x,dim_y}};
@@ -123,21 +126,29 @@ saw::error_or<void> lbm_main(const saw::data<args::LbmArgs>& args){
auto lsdm_view = make_view(lbm_sycl_macro_data);
auto lsdp_view = make_view(lbm_sycl_particle_data);
- saw::data<sch::UInt64> time_steps{64u*1024ul};
+ saw::data<sch::UInt64> time_steps{1024ul * 1024ul};
auto& info_f = lsd_view.template get<"info">();
for(saw::data<sch::UInt64> i{0u}; i < time_steps and krun; ++i){
// BC + Collision
{
- auto eov = step<T,Desc,Coll>(conv,lsd_view,lsdm_view,lsdp_view,i,dev);
+ auto eov = step<T,Desc,Coll>(
+ conv,
+ tau,
+ lsd_view,
+ lsdm_view,
+ lsdp_view,
+ i,
+ dev
+ );
if(eov.is_error()){
return eov;
}
}
sycl_q.wait();
- if(i.get() % 64u == 0u){
+ if(i.get() % 1024u == 0u){
{
auto eov = dev.copy_to_host(lbm_sycl_macro_data,*lbm_macro_data_ptr);
if(eov.is_error()){
diff --git a/examples/one_particle_sedimentation_2d/step.hpp b/examples/one_particle_sedimentation_2d/step.hpp
index c3a3b8a..4bc9dde 100644
--- a/examples/one_particle_sedimentation_2d/step.hpp
+++ b/examples/one_particle_sedimentation_2d/step.hpp
@@ -8,6 +8,7 @@ namespace lbm {
template<typename T, typename Desc, typename Coll>
saw::error_or<void> step(
const converter<T>& conv,
+ const saw::data<sch::Pure<T>>& tau,
saw::data<sch::Ptr<sch::ChunkStruct<T,Desc>>,encode::Sycl<saw::encode::Native>>& fields,
saw::data<sch::Ptr<sch::MacroStruct<T,Desc>>,encode::Sycl<saw::encode::Native>>& macros,
saw::data<sch::Ptr<sch::ParticleSpheroidGroup<T,Desc>>,encode::Sycl<saw::encode::Native>>& particles,
@@ -47,7 +48,7 @@ saw::error_or<void> step(
}).wait();
q.submit([&](acpp::sycl::handler& h){
- component<T,Desc,cmpt::Hlbm,encode::Sycl<saw::encode::Native>> collision{1.0};
+ component<T,Desc,cmpt::Hlbm,encode::Sycl<saw::encode::Native>> collision{tau};
component<T,Desc,cmpt::BounceBack,encode::Sycl<saw::encode::Native>> bb;
h.parallel_for(acpp::sycl::range<Desc::D>{dim_x,dim_y}, [=](acpp::sycl::id<Desc::D> idx){
@@ -99,14 +100,14 @@ saw::error_or<void> step(
index.at({{i}}).set(idx[i]);
}
- fplbm_one_part.apply(fields,macros,particles,index,t_i,{16u});
+ fplbm_one_part.apply(fields,macros,particles,index,t_i,{32u});
});
}).wait();
// auto coll_ev =
q.submit([&](acpp::sycl::handler& h){
- component<T,Desc,cmpt::BGK,encode::Sycl<saw::encode::Native>> bgk{1.0};
- component<T,Desc,cmpt::FpLbm,encode::Sycl<saw::encode::Native>> collision{1.0};
+ component<T,Desc,cmpt::BGK,encode::Sycl<saw::encode::Native>> bgk{tau};
+ component<T,Desc,cmpt::FpLbm,encode::Sycl<saw::encode::Native>> collision{tau};
component<T,Desc,cmpt::BounceBack,encode::Sycl<saw::encode::Native>> bb;
component<T,Desc,cmpt::ZouHeHorizontal<false>,encode::Sycl<saw::encode::Native>> flow_out{1.0};
@@ -182,7 +183,7 @@ saw::error_or<void> step(
// auto coll_ev =
q.submit([&](acpp::sycl::handler& h){
component<T,Desc,cmpt::BGK,encode::Sycl<saw::encode::Native>> bgk{1.0};
- component<T,Desc,cmpt::Psm,encode::Sycl<saw::encode::Native>> collision{1.0};
+ component<T,Desc,cmpt::Psm,encode::Sycl<saw::encode::Native>> collision{tau};
component<T,Desc,cmpt::BounceBack,encode::Sycl<saw::encode::Native>> bb;
component<T,Desc,cmpt::ZouHeHorizontal<false>,encode::Sycl<saw::encode::Native>> flow_out{1.0};