diff options
author | Claudius "keldu" Holeksa <mail@keldu.de> | 2025-07-24 16:34:18 +0200 |
---|---|---|
committer | Claudius "keldu" Holeksa <mail@keldu.de> | 2025-07-24 16:34:18 +0200 |
commit | d9fb04fe614c67f5a7850fc3f32338757b1b2987 (patch) | |
tree | 9b747e8007729cf0c1a16414fdb40285727fa577 /examples/poiseulle_channel_2d.cpp | |
parent | 163eb5b4436876d4163cf6aa33ce633b5b7957d0 (diff) |
Worked out the formula for the channel
Diffstat (limited to 'examples/poiseulle_channel_2d.cpp')
-rw-r--r-- | examples/poiseulle_channel_2d.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/examples/poiseulle_channel_2d.cpp b/examples/poiseulle_channel_2d.cpp index 376ba84..7506318 100644 --- a/examples/poiseulle_channel_2d.cpp +++ b/examples/poiseulle_channel_2d.cpp @@ -212,15 +212,21 @@ void set_geometry(saw::data<kel::lbm::sch::CavityFieldD2Q9>& latt){ auto& info = cell.template get<"info">(); saw::data<sch::FixedArray<sch::UInt64,2u>> area{{meta.at({0u})-8u, meta.at({1u})-2u}}; - double ch_width = area.at({1u}).get() * (0.6 * 0.5); - double ch_length = area.at({0u}).get() * (0.8 * 0.5); + double safety_start = 0.1*area.at({0u}).get(); + double safety_width = 0.2*area.at({1u}).get(); + + + double ch_width = (area.at({1u}).get()-safety_width) * 0.5; + double ch_length = (area.at({0u}).get()-safety_start) * 0.5; saw::data<sch::FixedArray<sch::UInt64,2u>> middle{{meta.at({0u})/2u, meta.at({1u})/2u}}; - double r = ch_length + ch_width * ch_width * 0.25 / ch_length; + // r^2 = (r-w/2)^2 + l^2 + double r_c = ch_length * ch_length; + double r = r_c / (2.0 * ch_width); - double top_pos = middle.at({1u}).get() + r; - double bot_pos = middle.at({1u}).get() - r; + double top_pos = middle.at({1u}).get() + r + safety_width; + double bot_pos = middle.at({1u}).get() - r - safety_width; double mid = middle.at({0u}).get(); double r_2 = r*r; |