Skip to content

Commit

Permalink
Merge branch 'fuel_tank'
Browse files Browse the repository at this point in the history
  • Loading branch information
ngomezve committed Feb 26, 2024
2 parents 2fa6ba3 + 0614f4a commit a231b09
Show file tree
Hide file tree
Showing 13 changed files with 306 additions and 288 deletions.
24 changes: 14 additions & 10 deletions example/cryo_input.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ name = "TASOPT Model with cryo fuel and HX"
insulation_segment_base_thickness = [0.2,0.2,0.2] #m
insulation_thicknesses_design_indices = [1,2,3]
insulation_material = ["rohacell31","rohacell31","rohacell31"] #Options: "rohacell31", "polyurethane"
skin_yield_strength = 172.4e6 #Pa
skin_yield_strength = "172e6 Pa"
tank_skin_density = 2825 #kg/m^3
maximum_boiloff_rate = 0.15 #%/hour
tank_aspect_ratio = 2.0
fuselage_clearance = 0.1 #m
tank_pressure = 2 #atm
fuselage_clearance = "0.3 ft"
tank_pressure = "2 atm"
stiffener_mass_fraction = 0.1
additional_mass_fraction = 0.1
heat_leak_factor = 1.3 #Factor to account for heat leakage through structural elements, piping, etc (qfac > 1)
Expand Down Expand Up @@ -132,20 +132,24 @@ name = "TASOPT Model with cryo fuel and HX"
HT_load_fuse_bend_relief = 0.4
VT_load_fuse_bend_relief = 0.7
# Overall fuselage layout
#Use provided layout (false) or recalculate it (true) for design pax keeping deltas
calculate_cabin_length = true

#Provided layout
x_nose_tip = "0 ft"
x_pressure_shell_fwd = "17 ft"
x_start_cylinder = "20 ft"
x_end_cylinder = "85 ft"
x_pressure_shell_aft = "87 ft"
x_cone_end = "102 ft"
x_end = "109 ft"
x_end_cylinder = "97 ft"
x_pressure_shell_aft = "102 ft"
x_cone_end = "117 ft"
x_end = "124 ft"

# Power systems and landing gear locations
x_HPE_sys = "62ft" #Hydraulic, Pneumatic and Electrical systems
x_nose_landing_gear = "14ft"
x_main_landing_gear_offset = "1 ft" # main LG offset behind the wing lift centroid

x_APU = "108 ft"
x_APU = "120 ft"

x_fixed_weight = "7ft" #Cockpit/ pilots etc

Expand Down Expand Up @@ -283,7 +287,7 @@ name = "TASOPT Model with cryo fuel and HX"
taper = 0.25
sweep = 26.0 #typically can be set to be the same as the wings
center_box_halfspan = "2.5 ft"
x_Htail = "102.5 ft"
x_Htail = "114.5 ft"
z_Htail = "0 ft"

max_tail_download = -0.5 # = CLh/CLmax. Tail download param at max load case.
Expand Down Expand Up @@ -320,7 +324,7 @@ name = "TASOPT Model with cryo fuel and HX"
taper = 0.30
sweep = 25.0
center_box_halfspan = 0.0
x_Vtail = "98 ft"
x_Vtail = "110 ft"
number_Vtails = 1.0

VTsize = "Vv" # Options are "Vv" or "OEI"
Expand Down
19 changes: 19 additions & 0 deletions src/IO/default_input.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,21 @@
fuel_temp = 280.0
fuel_density = 817.0 #kg/m3

[Fuel.Storage] #Default fuselage fuel storage parameters for cryogenic fuels
tank_placement = "front" #Location of tank in fuselage. Choices are "front", "rear", or "both".
insulation_segment_base_thickness = [0.2,0.2,0.2] #m
insulation_thicknesses_design_indices = [1,2,3]
insulation_material = ["rohacell31","rohacell31","rohacell31"] #Options: "rohacell31", "polyurethane"
skin_yield_strength = "172e6 Pa"
tank_skin_density = 2825 #kg/m^3
maximum_boiloff_rate = 0.15 #%/hour
tank_aspect_ratio = 2.0
fuselage_clearance = "0.3 ft"
tank_pressure = "2 atm"
stiffener_mass_fraction = 0.1
additional_mass_fraction = 0.1
heat_leak_factor = 1.3 #Factor to account for heat leakage through structural elements, piping, etc (qfac > 1)

[Mission]
N_missions = 2 # Number of missions to be modeled (first mission is the design mission)
pax = [180, 150] # Number of passengers in each mission
Expand Down Expand Up @@ -119,6 +134,10 @@
HT_load_fuse_bend_relief = 0.4
VT_load_fuse_bend_relief = 0.7
# Overall fuselage layout
#Use provided layout (false) or recalculate it (true) for design pax keeping deltas
calculate_cabin_length = false

#Provided layout
x_nose_tip = "0 ft"
x_pressure_shell_fwd = "17 ft"
x_start_cylinder = "20 ft"
Expand Down
166 changes: 44 additions & 122 deletions src/IO/outputs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ function stickfig(ac::aircraft; ax = nothing, label_fs = 16)
yh[ 6] = ycTEh

#Initialize seat start x-position
xseats0 = parg[igxshell1 ] + 10.0*ft_to_m
xseats0 = parg[igxshell1 ]
# Fuel tank
ntank = 8
Rtank = Rfuse - 0.1 # Account for clearance_fuse
Expand All @@ -393,13 +393,13 @@ function stickfig(ac::aircraft; ax = nothing, label_fs = 16)
tank_placement = ac.fuse_tank.placement
if tank_placement == "front"
xtanks = [parg[igxftank]]
xseats0 = xtanks[1] + l/2 + 5.0 * ft_to_m #move seats backwards
xseats0 = xtanks[1] + l/2 + 1.0 * ft_to_m #move seats backwards
elseif tank_placement == "rear"
xtanks = [parg[igxftankaft]]
xseats0 = parg[igxshell1 ] + 10.0*ft_to_m
xseats0 = parg[igxshell1 ]
elseif tank_placement == "both"
xtanks = [parg[igxftank], parg[igxftankaft]]
xseats0 = xtanks[1] + l/2 + 5.0 * ft_to_m #move seats backwards
xseats0 = xtanks[1] + l/2 + 1.0 * ft_to_m #move seats backwards
end

xt = zeros(nftanks, ntank*2 )
Expand Down Expand Up @@ -448,26 +448,14 @@ function stickfig(ac::aircraft; ax = nothing, label_fs = 16)
end

pax = parg[igWpay]/parm[imWperpax]
seat_pitch = 30.0 * in_to_m
seat_width = 19.0 * in_to_m
aisle_halfwidth = 10.0 * in_to_m # per CFR § 25.815

seats_per_row = Int(2*parg[igRfuse] ÷ (seat_width + aisle_halfwidth/3))
rows = Int(ceil(pax / seats_per_row))
_, xseats, seats_per_row = place_cabin_seats(pax, parg[igRfuse])
xseats = xseats .+ xseats0
rows = length(xseats)

println("Seats per row = $seats_per_row, Total rows = $rows")
yseats, symmetric_seats = arrange_seats(seats_per_row, parg[igRfuse])

xseats = zeros(rows)'
xseats[1] = xseats0
for r in 2:rows
emergency_exit = 0.0
if (r == 12 || r == 13)
emergency_exit = seat_pitch/2
end
xseats[r] = xseats[r-1] + seat_pitch + emergency_exit
end

## Plot
if ax === nothing
# plt.style.use(["../miscellaneous/prash.mplstyle"]) # HACK
Expand Down Expand Up @@ -1335,10 +1323,28 @@ function high_res_airplane_plot(ac; ax = nothing, label_fs = 16, save_name = not
yv[ 5] = yoTEv
yv[ 6] = ycTEv

#Initialize seat start x-position
xseats0 = parg[igxshell1 ]
# Fuel tank
Rtank = Rfuse - 0.1 # Account for clearance_fuse
l = parg[iglftankin]
ARtank = 2.0
ntank = 8
Rtank = Rfuse - 0.1 # Account for clearance_fuse
l = max(parg[iglftankin], parg[iglftank])
nftanks = pari[iinftanks] #Number of fuel tanks
ARtank = 2.0

if nftanks != 0
tank_placement = ac.fuse_tank.placement
if tank_placement == "front"
xtanks = [parg[igxftank]]
xseats0 = xtanks[1] + l/2 + 1.0 * ft_to_m #move seats backwards
elseif tank_placement == "rear"
xtanks = [parg[igxftankaft]]
xseats0 = parg[igxshell1 ]
elseif tank_placement == "both"
xtanks = [parg[igxftank], parg[igxftankaft]]
xseats0 = xtanks[1] + l/2 + 1.0 * ft_to_m #move seats backwards
end

xcyl0 = parg[igxftank] - l/2 + Rtank/ARtank
xcyl1 = parg[igxftank] + l/2 - Rtank/ARtank
ntank = 8
Expand All @@ -1363,51 +1369,32 @@ function high_res_airplane_plot(ac; ax = nothing, label_fs = 16, save_name = not
xt[k] = xcyl1 + (xcyl1 + Rtank/ARtank - xcyl1)*fracx
yt[k] = sqrt(Rtank^2 * max((1 - ((xt[k]-xcyl1)/(Rtank/ARtank))^2), 0.0) )
end

end
# xt = LinRange(xcyl0 - Rfuse/ARtank , xcyl0, 20 )
# yt = zeros(length(xt))
# @. yt = sqrt(Rfuse^2 * max((1 - ((xt-xcyl0)/(Rfuse/ARtank))^2), 0.0) )

xshell = zeros(ntank)
yshell = zeros(ntank)
AR = 3.0
xshellcenter = parg[igxshell2] - Rfuse/AR
for i = 1: ntank
fraci = float(i-1)/float(ntank-1)
fracx = sin(0.5*pi*fraci)

k = i
xshell[k] = xshellcenter + Rfuse/AR *fracx
yshell[k] = sqrt(Rfuse^2 * max((1 - ((xshell[k]-xshellcenter)/(Rfuse/AR))^2), 0.0) )
end
xshell = zeros(ntank)
yshell = zeros(ntank)
AR = 3.0
xshellcenter = parg[igxshell2] - Rfuse/AR
for i = 1: ntank
fraci = float(i-1)/float(ntank-1)
fracx = sin(0.5*pi*fraci)

k = i
xshell[k] = xshellcenter + Rfuse/AR *fracx
yshell[k] = sqrt(Rfuse^2 * max((1 - ((xshell[k]-xshellcenter)/(Rfuse/AR))^2), 0.0) )
end

#Seats
pax = parg[igWpay]/parm[imWperpax]
seat_pitch = 30.0 * in_to_m
seat_width = 19.0 * in_to_m
aisle_halfwidth = 10.0 * in_to_m # per CFR § 25.815
_, xseats, seats_per_row = place_cabin_seats(pax, parg[igRfuse])
xseats = xseats .+ xseats0
rows = length(xseats)

seats_per_row = Int(2*parg[igRfuse] ÷ (seat_width + aisle_halfwidth/3))
rows = Int(ceil(pax / seats_per_row))

println("Seats per row = $seats_per_row, Total rows = $rows")
yseats, symmetric_seats = arrange_seats(seats_per_row, parg[igRfuse])

if seats_per_row <= 10
emergency_rows = [12, 13]
else
emergency_rows = [19, 20]
end

xseats = zeros(rows)'
xseats[1] = parg[igxshell1 ] + 10.0*ft_to_m
for r in 2:rows
emergency_exit = 0.0
if (r in emergency_rows)
emergency_exit = seat_pitch/2
end
xseats[r] = xseats[r-1] + seat_pitch + emergency_exit
end

## Plot
if ax === nothing
Expand Down Expand Up @@ -1590,71 +1577,6 @@ function high_res_airplane_plot(ac; ax = nothing, label_fs = 16, save_name = not
return ax
end

"""
arrange_seats(seats_per_row, Rfuse,
seat_width = 19.0 * in_to_m,
aisle_halfwidth = 10.0 * in_to_m)
Helper function to arrange seats given a number of `seats_per_row`
and fuselage radius. Assumes default `seat_width = 19"` and `aisle_halfwidth = 10"`,
but can be supplied by the user.
"""
function arrange_seats(seats_per_row, Rfuse,
seat_width = 19.0 * in_to_m,
aisle_halfwidth = 10.0 * in_to_m)

#Seats
# Conditions:
# - No more than 2 seats between any seat and the aisle
seats_per_row % 2 == 0 ? symmetric_seats = true : symmetric_seats = false

if symmetric_seats # seating can be symmetric
half_seats_per_row = seats_per_row ÷ 2
yseats = zeros(half_seats_per_row)

if half_seats_per_row <= 3 #Single aisle
yseats[1] = aisle_halfwidth + seat_width/2 #Aisle in the center
for col = 2:half_seats_per_row
yseats[col] = yseats[col-1] + seat_width #offset every seat by width
end
else # twin aisle
#If symmetric no more than 2 seats next to each other at the
# centerline (I'm not evil enough to create a x-6-x seating arrangement even if "technically" allowed)
yseats[1] = seat_width/2.0
yseats[2] = yseats[1] + seat_width
#Aisle
half_seats_remaining = half_seats_per_row - 2
if half_seats_remaining > 4
@warn "Potentially trying to design a 3 aisle aircraft?
Seating arrangement not (yet) automatically handled, so check carefully."
end
yseats[3] = yseats[2] + aisle_halfwidth*2 + seat_width
for col = 4:half_seats_per_row
yseats[col] = yseats[col-1] + seat_width
end
end

else
@info "Asymmetric seating only deals with 3 or 5 seats at the moment"
seating_excess_space = 2*Rfuse - seats_per_row*seat_width - 2*aisle_halfwidth
yseats = zeros(seats_per_row)
# Start from edge and give some space based on the excess space available.
ind = 1
yseats[ind] = -Rfuse + seating_excess_space/2 + seat_width/2
ind+=1
if seats_per_row > 3
yseats[ind] = yseats[ind-1] + seat_width
ind+=1
end
yseats[ind] = yseats[ind-1] + aisle_halfwidth*2 + seat_width
ind+=1
for col = ind:seats_per_row
yseats[col] = yseats[col-1] + seat_width
end
end
return yseats, symmetric_seats
end # function arrange_seats

"""
PayloadRange(ac_og, Rpts, Ppts, filename, OEW, itermax)
Expand Down
Loading

0 comments on commit a231b09

Please sign in to comment.