From d9fb04fe614c67f5a7850fc3f32338757b1b2987 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Thu, 24 Jul 2025 16:34:18 +0200 Subject: Worked out the formula for the channel --- examples/poiseulle_channel_2d.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'examples/poiseulle_channel_2d.cpp') 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& latt){ auto& info = cell.template get<"info">(); saw::data> 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> 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; -- cgit v1.2.3