diff options
| author | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-02-06 20:20:05 +0100 |
|---|---|---|
| committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-02-06 20:20:05 +0100 |
| commit | 22659a4a4af8be137bcd702b89f1f44cd0fe2455 (patch) | |
| tree | eea5ca79f2798b3e8bf4347e1941cc09d26dc0ca | |
| parent | 8b35555ef3093fc7900366306ae8c99550459714 (diff) | |
| download | libs-lbm-22659a4a4af8be137bcd702b89f1f44cd0fe2455.tar.gz | |
Equilibrium boundaries
| -rw-r--r-- | examples/poiseulle_particles_2d_gpu/sim.cpp | 2 | ||||
| -rw-r--r-- | lib/core/c++/boundary.hpp | 24 |
2 files changed, 25 insertions, 1 deletions
diff --git a/examples/poiseulle_particles_2d_gpu/sim.cpp b/examples/poiseulle_particles_2d_gpu/sim.cpp index f9ee85b..d53a00c 100644 --- a/examples/poiseulle_particles_2d_gpu/sim.cpp +++ b/examples/poiseulle_particles_2d_gpu/sim.cpp @@ -121,7 +121,7 @@ saw::error_or<void> step( component<T,Desc,cmpt::BounceBack,encode::Sycl<saw::encode::Native>> bb; component<T,Desc,cmpt::ZouHeHorizontal<true>,encode::Sycl<saw::encode::Native>> flow_in{ [&](){ - uint64_t target_t_i = 128u; + uint64_t target_t_i = 256u; if(t_i.get() < target_t_i){ return 1.0 + (0.001 / target_t_i) * t_i.get(); } diff --git a/lib/core/c++/boundary.hpp b/lib/core/c++/boundary.hpp index 6d83c79..b70ffbf 100644 --- a/lib/core/c++/boundary.hpp +++ b/lib/core/c++/boundary.hpp @@ -11,6 +11,8 @@ struct BounceBack {}; template<bool East> struct ZouHeHorizontal{}; +struct Equilibrium {}; + template<bool North> struct ZouHeVertical{}; } @@ -64,6 +66,28 @@ public: } }; +template<typename FP, typename Descriptor, typename Encode> +class component<FP, Descriptor, cmpt::Equilibrium, Encode> final { +private: + saw::data<FP> density_; + saw::data<FP> velocity_; +public: + component( + saw::data<FP> density__, + saw::Data<FP> velocity__ + ): + density_{density__}, + velocity_{velocity__} + {} + + template<typename CellFieldSchema> + void apply(const saw::data<CellFieldSchema, Encode>& field, const saw::data<sch::FixedArray<sch::UInt64,Descriptor::D>>& index, saw::data<sch::UInt64> time_step)const{ + using dfi = df_info<T,Descriptor>; + + auto& dfs_old_f = (is_even) ? field.template get<"dfs_old">() : field.template get<"dfs">(); + } +}; + /** * This is massively hacky and expects a lot of conditions * Either this or mirrored along the horizontal line works |
