From bffab324ca4d71c0eacb2389f1441638ac465b2e Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Fri, 27 Jun 2025 10:00:10 +0200 Subject: Moving towards poiseulle --- examples/particle_ibm.cpp | 94 ----------------------------------------------- 1 file changed, 94 deletions(-) (limited to 'examples/particle_ibm.cpp') diff --git a/examples/particle_ibm.cpp b/examples/particle_ibm.cpp index 0ce034e..d54dbdc 100644 --- a/examples/particle_ibm.cpp +++ b/examples/particle_ibm.cpp @@ -49,100 +49,6 @@ using MacroStruct = Struct< using CavityFieldD2Q9 = CellField>; } -namespace cmpt { -struct BounceBack{}; -struct MovingWall {}; -struct BGK {}; -struct ConstRhoBGK {}; -} - -/** - * A reason for why a component based design is really good can be seen in my LR solver example - * - * Add Expression Templates and you're golden. - */ -template -class component; - -/** - * Full-Way BounceBack. I suspect that the moving wall requires half-way bounce back. - */ -template -class component { -public: - - void apply(saw::data>& dfs){ - using dfi = df_info; - - // Technically use .copy() - auto df_cpy = dfs; - - for(uint64_t i = 1u; i < Desc::Q; ++i){ - dfs({i}) = df_cpy({dfi::opposite_index.at(i)}); - } - } -}; - -/** - * Full-Way moving wall Bounce back, something is not right here. - * Technically it should reflect properly. - */ -template -class component { -public: - std::array::type, Desc::D> lid_vel; - -public: - void apply( - saw::data>& dfs - ){ - using dfi = df_info; - - // Technically use .copy() - /* - auto dfs_cpy = dfs; - - for(uint64_t i = 0u; i < Desc::Q; ++i){ - dfs({dfi::opposite_index.at(i)}) = dfs_cpy({i}) - 2.0 * dfi::weights[i] * 1.0 * ( lid_vel[0] * dfi::directions[i][0] + lid_vel[1] * dfi::directions[i][1]) * dfi::inv_cs2; - } - */ - } -}; - -template -class component { -public: - typename saw::native_data_type::type relaxation_; -public: - void apply(saw::data>& dfs){ - typename saw::native_data_type::type rho; - std::array::type, Desc::D> vel; - compute_rho_u(dfs,rho,vel); - auto eq = equilibrium(rho,vel); - - for(uint64_t i = 0u; i < Desc::Q; ++i){ - dfs({i}).set(dfs({i}).get() + (1.0 / relaxation_) * (eq[i] - dfs({i}).get())); - } - } -}; - -template -class component { -public: - typename saw::native_data_type::type relaxation_; - typename saw::native_data_type::type rho_; -public: - void apply(saw::data>& dfs){ - std::array::type, Desc::D> vel; - compute_const_rho_u(dfs,rho_,vel); - auto eq = equilibrium(rho_,vel); - - for(uint64_t i = 0u; i < Desc::Q; ++i){ - dfs({i}).set(dfs({i}).get() + (1.0 / relaxation_) * (eq[i] - dfs({i}).get())); - } - } -}; - } } -- cgit v1.2.3