diff options
| author | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-07-01 00:15:41 +0200 |
|---|---|---|
| committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-07-01 00:15:41 +0200 |
| commit | 89b1992988569add71f3b2f858a38a001d141d3b (patch) | |
| tree | b4d4519bb6df9b1f91778484cd5bc361c9356a47 /lib/core/c++/fplbm.hpp | |
| parent | 53ecaeeee3a24c016b4fd3c6a577ac22ac47775a (diff) | |
| parent | 761e4912e14324ccf713b9309336816cd3283b38 (diff) | |
| download | libs-lbm-89b1992988569add71f3b2f858a38a001d141d3b.tar.gz | |
Merge branch 'dev'
Diffstat (limited to 'lib/core/c++/fplbm.hpp')
| -rw-r--r-- | lib/core/c++/fplbm.hpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/core/c++/fplbm.hpp b/lib/core/c++/fplbm.hpp index 61def6b..c974472 100644 --- a/lib/core/c++/fplbm.hpp +++ b/lib/core/c++/fplbm.hpp @@ -114,6 +114,19 @@ public: auto& vel_f = macros.template get<"velocity">(); auto& por_f = macros.template get<"porosity">(); + // Temporary find a better way + auto& force_f = macros.template get<"force">(); + + + /** + * The other methods all work with a flipped porosity. + * For compat reasons this is also flipped + */ + auto porosity = por_f.at(index); + saw::data<sch::Scalar<T>> one; + one.at({}) = 1.0; + auto flip_porosity = one - porosity; + saw::data<sch::Scalar<T>>& rho = rho_f.at(index); saw::data<sch::Scalar<T>> half; @@ -128,12 +141,13 @@ public: saw::data<sch::Scalar<T>> min_two; min_two.at({}).set(-2); - auto force = vel * rho * min_two * por_f.at(index); + // Maybe ? + auto& force = force_f.at(index); + force = vel * rho * min_two * flip_porosity; saw::data<sch::Scalar<T>> dfi_inv_cs2; dfi_inv_cs2.at({}).set(dfi::inv_cs2); - // auto vel = vel_f.at(index); for(uint64_t i = 0u; i < Descriptor::Q; ++i){ |
