From edbf8355a4b50c20c26b1bcb02c4b3c48b7496ad Mon Sep 17 00:00:00 2001 From: Nicolas Gomez Date: Mon, 15 Jul 2024 13:07:08 -0400 Subject: [PATCH] fixed inconsistency in effect wcabin with hseat --- src/IO/outputs.jl | 6 ++++-- src/structures/size_cabin.jl | 15 +++++++++------ src/structures/update_fuse.jl | 2 +- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/IO/outputs.jl b/src/IO/outputs.jl index 21e86115..b9285bac 100644 --- a/src/IO/outputs.jl +++ b/src/IO/outputs.jl @@ -449,9 +449,10 @@ function stickfig(ac::aircraft; ax = nothing, label_fs = 16) end if pari[iidoubledeck] == 0 #Only show seats in single deck arrangements + h_seat = parg[igseatheight] pax = parg[igWpay]/parm[imWperpax] θ = find_floor_angles(false, parg[igRfuse], parg[igdRfuse], h_seat = parg[igseatheight]) #Find the floor angle - wcabin = find_cabin_width(parg[igRfuse], parg[igwfb], parg[ignfweb], θ) #Cabin width + wcabin = find_cabin_width(parg[igRfuse], parg[igwfb], parg[ignfweb], θ, h_seat) #Cabin width _, xseats, seats_per_row = place_cabin_seats(pax, wcabin) xseats = xseats .+ xseats0 @@ -1400,9 +1401,10 @@ function high_res_airplane_plot(ac; ax = nothing, label_fs = 16, save_name = not #Seats if pari[iidoubledeck] == 0 #Only show seats in single deck arrangements + h_seat = parg[igseatheight] pax = parg[igWpay]/parm[imWperpax] θ = find_floor_angles(false, parg[igRfuse], parg[igdRfuse], h_seat = parg[igseatheight]) #Find the floor angle - wcabin = find_cabin_width(parg[igRfuse], parg[igwfb], parg[ignfweb], θ) #Cabin width + wcabin = find_cabin_width(parg[igRfuse], parg[igwfb], parg[ignfweb], θ, h_seat) #Cabin width _, xseats, seats_per_row = place_cabin_seats(pax, wcabin) xseats = xseats .+ xseats0 diff --git a/src/structures/size_cabin.jl b/src/structures/size_cabin.jl index 4e1e2969..f5b5708d 100644 --- a/src/structures/size_cabin.jl +++ b/src/structures/size_cabin.jl @@ -129,7 +129,7 @@ function aisle_flag(idx, layout) end """ - find_cabin_width(Rfuse::Float64, wfb::Float64, nfweb::Float64, θ::Float64) + find_cabin_width(Rfuse::Float64, wfb::Float64, nfweb::Float64, θ::Float64, h_seat::Float64) This function can be used to calculate the width of the passenger cabin from the double-bubble parameters and the floor angular position. @@ -140,13 +140,16 @@ and the floor angular position. - `wfb::Float64`: lateral shift of double bubble (m) - `nfweb::Float64`: number of vertical webs in fuselage - `θ::Float64`: angle of floor wrt upper bubble center (rad) + - `h_seat::Float64`: seat height (m) **Outputs:** - `w::Float64`: width of cabin (m). """ -function find_cabin_width(Rfuse::Float64, wfb::Float64, nfweb::Float64, θ::Float64) +function find_cabin_width(Rfuse::Float64, wfb::Float64, nfweb::Float64, θ::Float64, h_seat::Float64) #Use trigonometry to find cabin width - w = nfweb*2*wfb + 2*Rfuse*cos(θ) + θseat = asin((h_seat + Rfuse * sin(θ)) / Rfuse) + cosθ = min(cos(θ), cos(θseat)) #For the effective cabin width, take the minimum of the widths at the floor and at the seat height + w = nfweb*2*wfb + 2*Rfuse*cosθ return w end @@ -183,7 +186,7 @@ function find_floor_angles(fdoubledecker::Bool, Rfuse::Float64, dRfuse::Float64; θ1 = -asin(h_seat / (2*Rfuse)) #This angle maximizes the cabin width return θ1 else #If it is a double decker with no lower bubble, the main cabin could be anywhere => Use provided angle - θ2 = asin((h_seat + d_floor + Rfuse * sin(θ1)) / Rfuse) + θ2 = asin((h_seat + d_floor) / Rfuse) return θ1, θ2 end end @@ -232,8 +235,8 @@ function find_double_decker_cabin_length(x::Vector{Float64}, parg, parm) end #Find width of each cabin - w1 = find_cabin_width(Rfuse, wfb, nfweb, θ1) - w2 = find_cabin_width(Rfuse, wfb, nfweb, θ2) + w1 = find_cabin_width(Rfuse, wfb, nfweb, θ1, h_seat) + w2 = find_cabin_width(Rfuse, wfb, nfweb, θ2, h_seat) #Find length of each cabin l1, _, pax_per_row_main = place_cabin_seats(paxmain, w1, seat_pitch, seat_width, aisle_halfwidth) diff --git a/src/structures/update_fuse.jl b/src/structures/update_fuse.jl index 4c786a13..8b1b6d03 100644 --- a/src/structures/update_fuse.jl +++ b/src/structures/update_fuse.jl @@ -89,7 +89,7 @@ function update_fuse_for_pax!(pari, parg, parm, fuse_tank) else θ = find_floor_angles(false, Rfuse, dRfuse, h_seat = h_seat) #Find the floor angle paxsize = parg[igWpaymax]/parm[imWperpax,1] #maximum number of passengers - w = find_cabin_width(Rfuse, wfb, nfweb, θ) #Cabin width + w = find_cabin_width(Rfuse, wfb, nfweb, θ, h_seat) #Cabin width lcyl, _, seats_per_row = place_cabin_seats(paxsize, w, seat_pitch, seat_width, aisle_halfwidth) #Cabin length end