diff options
| author | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-07-07 20:41:45 +0200 |
|---|---|---|
| committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-07-07 20:41:45 +0200 |
| commit | 544c842c63cd048160f4277a6d0ca3a1f89bd9d1 (patch) | |
| tree | 01b33ea777f234d1c1f8ba6a4b7282d4cf3f706b /examples | |
| parent | 43d795c0afa3c613fb3aee10de7ddf579cf78645 (diff) | |
| download | libs-lbm-544c842c63cd048160f4277a6d0ca3a1f89bd9d1.tar.gz | |
Changing the initial velocity
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/stokes_drag_particle_2d_fplbm_gpu/sim.cpp | 4 | ||||
| -rw-r--r-- | examples/stokes_drag_particle_2d_hlbm_gpu/sim.cpp | 4 | ||||
| -rw-r--r-- | examples/stokes_drag_particle_2d_psm_gpu/sim.cpp | 46 |
3 files changed, 3 insertions, 51 deletions
diff --git a/examples/stokes_drag_particle_2d_fplbm_gpu/sim.cpp b/examples/stokes_drag_particle_2d_fplbm_gpu/sim.cpp index 5de963d..98c72a2 100644 --- a/examples/stokes_drag_particle_2d_fplbm_gpu/sim.cpp +++ b/examples/stokes_drag_particle_2d_fplbm_gpu/sim.cpp @@ -135,6 +135,7 @@ saw::error_or<void> setup_initial_conditions( por_f.at(index).at({}) = {0}; rho.at({}) = {1}; auto& vel = vel_f.at(index); + vel.at({{0u}}) = 0.0002f; auto eq = equilibrium<T,Desc>(rho,vel); df = eq; @@ -149,9 +150,6 @@ saw::error_or<void> setup_initial_conditions( auto& rho = rho_f.at(index); rho.at({}) = {1}; auto& vel = vel_f.at(index); - if(info_f.at(index).get() == 2u){ - vel.at({{0u}}) = 0.0002f; - } auto eq = equilibrium<T,Desc>(rho,vel); df = eq; diff --git a/examples/stokes_drag_particle_2d_hlbm_gpu/sim.cpp b/examples/stokes_drag_particle_2d_hlbm_gpu/sim.cpp index 68c0b35..e0cbda2 100644 --- a/examples/stokes_drag_particle_2d_hlbm_gpu/sim.cpp +++ b/examples/stokes_drag_particle_2d_hlbm_gpu/sim.cpp @@ -132,6 +132,7 @@ saw::error_or<void> setup_initial_conditions( por_f.at(index).at({}) = {1}; rho.at({}) = {1}; auto& vel = vel_f.at(index); + vel.at({{0u}}) = 0.0002f; auto eq = equilibrium<T,Desc>(rho,vel); df = eq; @@ -146,9 +147,6 @@ saw::error_or<void> setup_initial_conditions( auto& rho = rho_f.at(index); rho.at({}) = {1}; auto& vel = vel_f.at(index); - if(info_f.at(index).get() == 2u){ - vel.at({{0u}}) = 0.0002f; - } auto eq = equilibrium<T,Desc>(rho,vel); df = eq; diff --git a/examples/stokes_drag_particle_2d_psm_gpu/sim.cpp b/examples/stokes_drag_particle_2d_psm_gpu/sim.cpp index 3ab3dda..9d678a8 100644 --- a/examples/stokes_drag_particle_2d_psm_gpu/sim.cpp +++ b/examples/stokes_drag_particle_2d_psm_gpu/sim.cpp @@ -134,6 +134,7 @@ saw::error_or<void> setup_initial_conditions( por_f.at(index).at({}) = {1}; rho.at({}) = {1}; auto& vel = vel_f.at(index); + vel.at({{0u}}) = 0.0002f; auto eq = equilibrium<T,Desc>(rho,vel); @@ -149,9 +150,6 @@ saw::error_or<void> setup_initial_conditions( auto& rho = rho_f.at(index); rho.at({}) = {1}; auto& vel = vel_f.at(index); - if(info_f.at(index).get() == 2u){ - vel.at({{0u}}) = 0.0002f; - } auto eq = equilibrium<T,Desc>(rho,vel); df = eq; @@ -161,48 +159,6 @@ saw::error_or<void> setup_initial_conditions( {{1u,1u}} ); - 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.5; - p_pos.at({{1u}}) = dim_y * 0.5; - } - - /* - component<T,Desc,cmpt::OneParticleAt> opa{p_pos,rad,eps}; - iterator<Desc::D>::apply( - [&](auto& index){ - opa.apply(macros,index,{}); - }, - {},// 0-index - df_f.get_dims() - ); - */ - - /* - iterator<Desc::D>::apply( - [&](auto& index){ - saw::data<sch::Vector<T,Desc::D>> middle, ind_vec; - middle.at({{0u}}) = dim_x * 0.25; - middle.at({{1u}}) = dim_y * 0.5; - - 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; - } - }, - {},// 0-index - df_f.get_dims() - ); - */ - return saw::make_void(); } |
