diff options
| author | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-11-11 01:16:44 +0100 |
|---|---|---|
| committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2026-11-11 01:16:44 +0100 |
| commit | 0c0087ef9482634273ec1a23d3a915754f94926d (patch) | |
| tree | 972a8e48c1fae67af23b982d7a9e1a506fc8705f /examples/throat_clog_2d | |
| parent | 2e63c4a31f946a8bafa92c49c1a0a116c0eb6dae (diff) | |
| download | libs-lbm-0c0087ef9482634273ec1a23d3a915754f94926d.tar.gz | |
Snapshot. Migration to Lbm Unit
Diffstat (limited to 'examples/throat_clog_2d')
| -rw-r--r-- | examples/throat_clog_2d/common.hpp | 2 | ||||
| -rw-r--r-- | examples/throat_clog_2d/init.hpp | 10 | ||||
| -rw-r--r-- | examples/throat_clog_2d/sim.cpp | 4 | ||||
| -rw-r--r-- | examples/throat_clog_2d/step.hpp | 12 |
4 files changed, 14 insertions, 14 deletions
diff --git a/examples/throat_clog_2d/common.hpp b/examples/throat_clog_2d/common.hpp index 84baeb3..8fb9840 100644 --- a/examples/throat_clog_2d/common.hpp +++ b/examples/throat_clog_2d/common.hpp @@ -62,7 +62,7 @@ using RhoChunk = Chunk<Scalar<T>, 0u, dim_x, dim_y>; template<typename T, typename Desc> using MacroStruct = Struct< - Member<VelChunk<T,Desc>, "momentum">, + Member<VelChunk<T,Desc>, "velocity">, Member<RhoChunk<T>, "density">, Member<ScalarChunk<T,Desc>, "porosity">, Member<VelChunk<T,Desc>, "force"> diff --git a/examples/throat_clog_2d/init.hpp b/examples/throat_clog_2d/init.hpp index e03bd5e..fab51b3 100644 --- a/examples/throat_clog_2d/init.hpp +++ b/examples/throat_clog_2d/init.hpp @@ -120,7 +120,7 @@ kel::lbm::error_or<void> init( // auto& df_f = fields.template get<"dfs_old">(); auto& rho_f = macros.template get<"density">(); - auto& vel_f = macros.template get<"momentum">(); + auto& vel_f = macros.template get<"velocity">(); auto& por_f = macros.template get<"porosity">(); iterator<Desc::D>::apply( @@ -157,8 +157,8 @@ kel::lbm::error_or<void> init( ); { - kel::lbm::data<sch::Scalar<T>> radius_p; - radius_p.at({}).set(conv.meter_si_to_lbm({{0.05}}).handle().get()); + kel::lbm::data<sch::LbmMeter<sch::Scalar<T>>> radius_p; + radius_p.at({}).set(conv.meter_si_to_lbm({0.05}).handle().get()); std::cout<<"RADIUS: "<<radius_p.at({}).get()<<std::endl; kel::lbm::data<sch::Scalar<T>> dense_p; dense_p.at({}).set(1); @@ -175,8 +175,8 @@ kel::lbm::error_or<void> init( const auto radius = radius_p.at({}).get(); const auto pitch = radius * 2.4; - const auto x0 = conv.meter_si_to_lbm({{0.10}}).handle().get(); - const auto y_mid = conv.meter_si_to_lbm({{0.25}}).handle().get(); + const auto x0 = conv.meter_si_to_lbm({0.10}).handle().get(); + const auto y_mid = conv.meter_si_to_lbm({0.25}).handle().get(); constexpr uint64_t per_column = 4ul; diff --git a/examples/throat_clog_2d/sim.cpp b/examples/throat_clog_2d/sim.cpp index 89741ca..a25c1a3 100644 --- a/examples/throat_clog_2d/sim.cpp +++ b/examples/throat_clog_2d/sim.cpp @@ -33,9 +33,9 @@ kel::lbm::error_or<void> lbm_main(std::string_view coupling){ converter<T> conv { // delta_x - {{0.64 / dim_y}}, + {0.64 / dim_y}, // delta_t - {{1.067e-2}} + {1.067e-2} }; print_lbm_meta<T,Desc>(conv,{1e-3},{1e-4},{0.2 * dim_y}); diff --git a/examples/throat_clog_2d/step.hpp b/examples/throat_clog_2d/step.hpp index 5bb889e..1605cf0 100644 --- a/examples/throat_clog_2d/step.hpp +++ b/examples/throat_clog_2d/step.hpp @@ -83,8 +83,8 @@ kel::lbm::error_or<void> step( }()); } { - auto y_si = conv.meter_lbm_to_si(index.at({{1u}}).template cast_to<T>()).handle(); - vel.at({{0u}}) = conv.velocity_si_to_lbm({{static_cast<typename kel::lbm::native_data_type<T>::type>((0.1 / 0.64) * y_si.get() - (0.1 / (0.64*0.64)) * y_si.get() * y_si.get())}}).handle() * scale; + auto y_si = conv.meter_lbm_to_si(as_unit<sch::LbmMeter<T>>(index.at({{1u}}).template cast_to<T>())).handle(); + vel.at({{0u}}) = conv.velocity_si_to_lbm({static_cast<typename kel::lbm::native_data_type<T>::type>((0.1 / 0.64) * y_si.get() - (0.1 / (0.64*0.64)) * y_si.get() * y_si.get())}).handle() * scale; vel.at({{1u}}) = 0.0f; } return vel; @@ -178,8 +178,8 @@ kel::lbm::error_or<void> step( [&]() -> kel::lbm::data<sch::Vector<T,Desc::D>> { kel::lbm::data<sch::Vector<T,Desc::D>> vel; { - auto y_si = conv.meter_lbm_to_si(index.at({{1u}}).template cast_to<T>()).handle(); - vel.at({{0u}}) = conv.velocity_si_to_lbm({{static_cast<typename kel::lbm::native_data_type<T>::type>((0.01 / 0.64) * y_si.get() - (0.01 / (0.64*0.64)) * y_si.get() * y_si.get())}}).handle(); + auto y_si = conv.meter_lbm_to_si(as_unit<sch::LbmMeter<T>>(index.at({{1u}}).template cast_to<T>())).handle(); + vel.at({{0u}}) = conv.velocity_si_to_lbm({static_cast<typename kel::lbm::native_data_type<T>::type>((0.01 / 0.64) * y_si.get() - (0.01 / (0.64*0.64)) * y_si.get() * y_si.get())}).handle(); vel.at({{1u}}) = 0.0f; } return vel; @@ -254,8 +254,8 @@ kel::lbm::error_or<void> step( [&]() -> kel::lbm::data<sch::Vector<T,Desc::D>> { kel::lbm::data<sch::Vector<T,Desc::D>> vel; { - auto y_si = conv.meter_lbm_to_si(index.at({{1u}}).template cast_to<T>()).handle(); - vel.at({{0u}}) = conv.velocity_si_to_lbm({{static_cast<typename kel::lbm::native_data_type<T>::type>((1.2 / 0.64) * y_si.get() - (1.2 / (0.64*0.64)) * y_si.get() * y_si.get())}}).handle(); + auto y_si = conv.meter_lbm_to_si(as_unit<sch::LbmMeter<T>>(index.at({{1u}}).template cast_to<T>())).handle(); + vel.at({{0u}}) = conv.velocity_si_to_lbm({static_cast<typename kel::lbm::native_data_type<T>::type>((1.2 / 0.64) * y_si.get() - (1.2 / (0.64*0.64)) * y_si.get() * y_si.get())}).handle(); vel.at({{1u}}) = 0.0f; } return vel; |
