diff options
author | Claudius "keldu" Holeksa <mail@keldu.de> | 2025-03-19 14:31:38 +0100 |
---|---|---|
committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2025-03-19 14:31:38 +0100 |
commit | 45176fc5a35b5843dadf1712b297ab23abe1aec5 (patch) | |
tree | 17f783e8c20c2b76b9bd432f2cd2e74684c09dbf /c++ | |
parent | f26602ec57346cc84703fa5e06d378cbed2dad48 (diff) |
Compute the collision
Diffstat (limited to 'c++')
-rw-r--r-- | c++/examples/cavity_2d.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/c++/examples/cavity_2d.cpp b/c++/examples/cavity_2d.cpp index ccb6433..f0d6794 100644 --- a/c++/examples/cavity_2d.cpp +++ b/c++/examples/cavity_2d.cpp @@ -80,7 +80,7 @@ public: eq[i] = dfi::weights[i] * rho * ( 1 + vel_c_cs2 - + vel_c_cs2 * vel_c_cs2 + + vel_c_cs2 * vel_c_cs2 / 2. - ( vel[0] * vel[0] + vel[1] * vel[1] ) / ( 2. * dfi::cs2 ) ); } @@ -89,7 +89,7 @@ public: } void compute_rho_u( - saw::data<sch::DfCell<sch::D2Q5>>& dfs, + saw::data<sch::DfCell<Desc>>& dfs, typename saw::native_data_type<sch::T>::type& rho, std::array<typename saw::native_data_type<sch::T>::type, 2>& vel ){ @@ -107,6 +107,15 @@ public: vel[0] /= rho; vel[1] /= rho; } + + void apply(saw::data<sch::DfCell<Desc>>& dfs){ + for(uint64_t i = 0u; i < Desc::Q; ++i){ + typename saw::native_data_type<sch::T>::type rho; + std::array<typename saw::native_data_type<sch::T>::type, Desc::D> vel; + compute_rho_u(dfs,rho,vel); + auto eq = equilibrium(rho,vel); + } + } }; } } |