Skip to content

Commit

Permalink
further tail structuring
Browse files Browse the repository at this point in the history
  • Loading branch information
aditeyashukla committed Aug 6, 2024
1 parent beba205 commit 9aea92e
Show file tree
Hide file tree
Showing 16 changed files with 208 additions and 187 deletions.
14 changes: 7 additions & 7 deletions src/IO/outputs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,10 @@ function stickfig(ac::aircraft; ax = nothing, label_fs = 16)
xh = zeros(6)
yh = zeros(6)

boh = htail.outboard.b
boh = htail.outboard.layout.b
Sh = htail.layout.S
ARh = htail.layout.AR
lambdah = htail.outboard.λ
lambdah = htail.outboard.layout.λ
sweeph = htail.layout.sweep

bh = sqrt(Sh*ARh)
Expand Down Expand Up @@ -1210,10 +1210,10 @@ function high_res_airplane_plot(ac; ax = nothing, label_fs = 16, save_name = not
xh = zeros(6)
yh = zeros(6)

boh = htail.outboard.b
boh = htail.outboard.layout.b
Sh = htail.layout.S
ARh = htail.layout.AR
lambdah = htail.outboard.λ
lambdah = htail.outboard.layout.λ
sweeph = htail.layout.sweep
bh = sqrt(Sh*ARh)
coh = Sh/(boh + (bh-boh)*0.5*(1.0+lambdah))
Expand Down Expand Up @@ -1297,10 +1297,10 @@ function high_res_airplane_plot(ac; ax = nothing, label_fs = 16, save_name = not
xv = zeros(6)
yv = zeros(6)

bov = vtail.outboard.b
bov = vtail.outboard.layout.b
Sv = vtail.layout.S
ARv = vtail.layout.AR
lambdav = vtail.outboard.λ
lambdav = vtail.outboard.layout.λ
sweepv = vtail.layout.sweep

bv = vtail.layout.b
Expand Down Expand Up @@ -1442,7 +1442,7 @@ function high_res_airplane_plot(ac; ax = nothing, label_fs = 16, save_name = not
# ax.plot(xh, -yh, "-k", zorder = tailz)
ax.fill_between(xh, -yh, yh, facecolor = "w", alpha = 0.8, edgecolor = "k", zorder = tailz, linewidth = 2.0)
xvt = [-0.4, -0.3, -0.2, -0.15, 0.2, 0.6].*vtail.layout.chord .+ vtail.layout.box_x
tailthick = (vtail.layout.chord*vtail.outboard.chord_thickness/2)
tailthick = (vtail.layout.chord*vtail.outboard.layout.chord_thickness/2)
yvt = hcat([0.0 0.5*tailthick 0.9*tailthick ones(2)' .*tailthick 0.0])[:]
ax.fill_between(xvt, -yvt, yvt, facecolor = "k", alpha = 0.8, edgecolor = "k", zorder = 22)

Expand Down
12 changes: 6 additions & 6 deletions src/IO/read_input.jl
Original file line number Diff line number Diff line change
Expand Up @@ -544,9 +544,9 @@ readtails(x) = read_input(x, tails, dtails)

readhtail(x) = read_input(x, htail_input, dhtail)
htail.layout.AR = readhtail("AR_Htail")
htail.outboard.λ = readhtail("taper")
htail.outboard.layout.λ = readhtail("taper")
htail.layout.sweep = readhtail("sweep")
htail.outboard.b = 2*Distance(readhtail("center_box_halfspan"))
htail.outboard.layout.b = 2*Distance(readhtail("center_box_halfspan"))

htail.layout.box_x = Distance(readhtail("x_Htail"))
htail.layout.z = Distance(readhtail("z_Htail"))
Expand Down Expand Up @@ -602,17 +602,17 @@ readhtail(x) = read_input(x, htail_input, dhtail)
htail.weight_fraction_added = readhtail("added_weight_fraction")

htail.layout.box_width = readhtail("box_width_chord")
htail.outboard.chord_thickness = readhtail("box_height_chord")
htail.outboard.layout.chord_thickness = readhtail("box_height_chord")
htail.layout.hweb_to_hbox = readhtail("web_height_hbox")


vtail_input = readtails("Vtail")
dvtail = dtails["Vtail"]
readvtail(x) = read_input(x, vtail_input, dvtail)
vtail.layout.AR = readvtail("AR_Vtail")
vtail.outboard.λ = readvtail("taper")
vtail.outboard.layout.λ = readvtail("taper")
vtail.layout.sweep = readvtail("sweep")
vtail.outboard.b = Distance(readvtail("center_box_halfspan"))
vtail.outboard.layout.b = Distance(readvtail("center_box_halfspan"))
vtail.layout.box_x = Distance(readvtail("x_Vtail"))
vtail.ntails = readvtail("number_Vtails")

Expand All @@ -633,7 +633,7 @@ readvtail(x) = read_input(x, vtail_input, dvtail)

vtail.weight_fraction_added = readvtail("added_weight_fraction")
vtail.layout.box_width = readvtail("box_width_chord")
vtail.outboard.chord_thickness = readvtail("box_height_chord")
vtail.outboard.layout.chord_thickness = readvtail("box_height_chord")
vtail.layout.hweb_to_hbox = readvtail("web_height_hbox")

# ----- End Stabilizers -----
Expand Down
36 changes: 18 additions & 18 deletions src/IO/save_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ function reset_regression_test(fname, ac)
@printf(io, "# ------------------------------\n")
@printf(io,"htail = ac.htail\n")
@printf(io, "htail.weight = %20.20f \n", htail.weight)
@printf(io, "htail.dxW = %20.20f \n", htail.dxW)
@printf(io, "htail.outboard.dxW = %20.20f \n", htail.outboard.dxW)
@printf(io, "htail.weight_fraction_added = %20.20f \n", htail.weight_fraction_added)
@printf(io, "htail.layout.box_x = %20.20f \n", htail.layout.box_x)
@printf(io, "htail.layout.z = %20.20f \n", htail.layout.z)
Expand All @@ -848,21 +848,21 @@ function reset_regression_test(fname, ac)
@printf(io, "htail.SM_min = %20.20f \n", htail.SM_min)
@printf(io, "htail.layout.x = %20.20f \n", htail.layout.x)
@printf(io, "htail.layout.box_width = %20.20f \n", htail.layout.box_width)
@printf(io, "htail.outboard.chord_thickness = %20.20f \n", htail.outboard.chord_thickness)
@printf(io, "htail.outboard.layout.chord_thickness = %20.20f \n", htail.outboard.layout.chord_thickness)
@printf(io, "htail.layout.hweb_to_hbox = %20.20f \n", htail.layout.hweb_to_hbox)
@printf(io, "htail.thickness_web = %20.20f \n", htail.thickness_web)
@printf(io, "htail.outboard.thickness_web = %20.20f \n", htail.outboard.thickness_web)
@printf(io, "htail.move_wingbox = %20.20f \n", htail.move_wingbox)
@printf(io, "htail.CL_CLmax = %20.20f \n", htail.CL_CLmax)
@printf(io, "htail.size = %20.20f \n", htail.size)
@printf(io, "htail.volume = %20.20f \n", htail.volume)
@printf(io, "htail.thickness_cap = %20.20f \n", htail.thickness_cap)
@printf(io, "htail.GJ = %20.20f \n", htail.GJ)
@printf(io, "htail.EI_normal = %20.20f \n", htail.EI_normal)
@printf(io, "htail.EI_bending = %20.20f \n", htail.EI_bending)
@printf(io, "htail.outboard.thickness_cap = %20.20f \n", htail.outboard.thickness_cap)
@printf(io, "htail.outboard.GJ = %20.20f \n", htail.outboard.GJ)
@printf(io, "htail.outboard.EI_normal = %20.20f \n", htail.outboard.EI_normal)
@printf(io, "htail.outboard.EI_bending = %20.20f \n", htail.outboard.EI_bending)
@printf(io, "htail.layout.sweep = %20.20f \n", htail.layout.sweep)
@printf(io, "htail.layout.chord = %20.20f \n", htail.layout.chord)
@printf(io, "htail.outboard.λ = %20.20f \n", htail.outboard.λ)
@printf(io, "htail.outboard.b = %20.20f \n", htail.outboard.b)
@printf(io, "htail.outboard.layout.λ = %20.20f \n", htail.outboard.layout.λ)
@printf(io, "htail.outboard.layout.b = %20.20f \n", htail.outboard.layout.b)
@printf(io, "htail.layout.b = %20.20f \n", htail.layout.b)
@printf(io, "htail.layout.AR = %20.20f \n", htail.layout.AR)
@printf(io, "htail.layout.S = %20.20f \n", htail.layout.S)
Expand All @@ -872,29 +872,29 @@ function reset_regression_test(fname, ac)
@printf(io, "# ------------------------------\n")
@printf(io,"vtail = ac.vtail\n")
@printf(io, "vtail.weight = %20.20f \n", vtail.weight)
@printf(io, "vtail.dxW = %20.20f \n", vtail.dxW)
@printf(io, "vtail.outboard.dxW = %20.20f \n", vtail.outboard.dxW)
@printf(io, "vtail.weight_fraction_added = %20.20f \n", vtail.weight_fraction_added)
@printf(io, "vtail.layout.box_x = %20.20f \n", vtail.layout.box_x)
@printf(io, "vtail.CL_max = %20.20f \n", vtail.CL_max)
@printf(io, "vtail.layout.x = %20.20f \n", vtail.layout.x)
@printf(io, "vtail.layout.box_width = %20.20f \n", vtail.layout.box_width)
@printf(io, "vtail.outboard.chord_thickness = %20.20f \n", vtail.outboard.chord_thickness)
@printf(io, "vtail.outboard.layout.chord_thickness = %20.20f \n", vtail.outboard.layout.chord_thickness)
@printf(io, "vtail.layout.hweb_to_hbox = %20.20f \n", vtail.layout.hweb_to_hbox)
@printf(io, "vtail.ntails = %20.20f \n", vtail.ntails)
@printf(io, "vtail.volume = %20.20f \n", vtail.volume)
@printf(io, "vtail.thickness_web = %20.20f \n", vtail.thickness_web)
@printf(io, "vtail.thickness_cap = %20.20f \n", vtail.thickness_cap)
@printf(io, "vtail.GJ = %20.20f \n", vtail.GJ)
@printf(io, "vtail.EI_normal = %20.20f \n", vtail.EI_normal)
@printf(io, "vtail.EI_bending = %20.20f \n", vtail.EI_bending)
@printf(io, "vtail.outboard.thickness_web = %20.20f \n", vtail.outboard.thickness_web)
@printf(io, "vtail.outboard.thickness_cap = %20.20f \n", vtail.outboard.thickness_cap)
@printf(io, "vtail.outboard.GJ = %20.20f \n", vtail.outboard.GJ)
@printf(io, "vtail.outboard.EI_normal = %20.20f \n", vtail.outboard.EI_normal)
@printf(io, "vtail.outboard.EI_bending = %20.20f \n", vtail.outboard.EI_bending)
@printf(io, "vtail.layout.sweep = %20.20f \n", vtail.layout.sweep)
@printf(io, "vtail.layout.chord = %20.20f \n", vtail.layout.chord)
@printf(io, "vtail.outboard.λ = %20.20f \n", vtail.outboard.λ)
@printf(io, "vtail.outboard.layout.λ = %20.20f \n", vtail.outboard.layout.λ)
@printf(io, "vtail.layout.b = %20.20f \n", vtail.layout.b)
@printf(io, "vtail.layout.AR = %20.20f \n", vtail.layout.AR)
@printf(io, "vtail.layout.S = %20.20f \n", vtail.layout.S)
@printf(io, "vtail.size = %20.20f \n", vtail.size)
@printf(io, "vtail.dxW = %20.20f \n", vtail.dxW)
@printf(io, "vtail.outboard.dxW = %20.20f \n", vtail.outboard.dxW)

@printf(io, "# ------------------------------\n")
@printf(io, "# Flags - stored in pari array:\n")
Expand Down
16 changes: 8 additions & 8 deletions src/aero/cdsum.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,16 @@ function cdsum!(pari,parg,para,pare, wing, htail, vtail, icdfun)
fSnace = parg[igfSnace ]
bo = wing.outboard.layout.b
bs = wing.inboard.layout.b
boh = htail.outboard.b
bov = vtail.outboard.b
boh = htail.outboard.layout.b
bov = vtail.outboard.layout.b

lambdat = wing.outboard.layout.λ
lambdas = wing.inboard.layout.λ
gammat = wing.outboard.layout.λ*para[iarclt]
gammas = wing.inboard.layout.λ*para[iarcls]

lambdah = htail.outboard.λ
lambdav = vtail.outboard.λ
lambdah = htail.outboard.layout.λ
lambdav = vtail.outboard.layout.λ
sweeph = htail.layout.sweep
sweepv = vtail.layout.sweep
cosLs = wing.strut.cos_lambda
Expand Down Expand Up @@ -342,13 +342,13 @@ function cditrp(pari,parg,para, wing, htail, vtail)

#---- horizontal tail wake parameters
b[2] = htail.layout.b
bs[2] = htail.outboard.b
bo[2] = htail.outboard.b
bop[2] = htail.outboard.b
bs[2] = htail.outboard.layout.b
bo[2] = htail.outboard.layout.b
bop[2] = htail.outboard.layout.b

zcent[2] = htail.layout.z
gammas[2] = 1.0
gammat[2] = htail.outboard.λ
gammat[2] = htail.outboard.layout.λ
po[2] = 1.0
CLsurfsp[2] = CLhtail

Expand Down
14 changes: 7 additions & 7 deletions src/balance/balance.jl
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,16 @@ function balance(pari, parg, para, fuse, wing, htail, vtail, rfuel, rpay, ξpay,
fuse.moment + xWtesys + xWftank +
Wwing * wing.layout.box_x + wing.dxW +
Wstrut * wing.layout.box_x + wing.strut.dxW +
(Whtail * htail.layout.box_x + htail.dxW) * Sh / Sh1 +
Wvtail * vtail.layout.box_x + vtail.dxW +
(Whtail * htail.layout.box_x + htail.outboard.dxW) * Sh / Sh1 +
Wvtail * vtail.layout.box_x + vtail.outboard.dxW +
Weng * parg[igxeng] +
Whpesys * fuse.HPE_sys.r.x +
Wlgnose * parg[igxlgnose] +
Wlgmain * (wing.layout.box_x + dxlg)

xW_xwbox = xWfuel_xwbox + Wwing + Wstrut + Wlgmain

xW_Sh = (Whtail * htail.layout.box_x + htail.dxW) / Sh1
xW_Sh = (Whtail * htail.layout.box_x + htail.outboard.dxW) / Sh1

#---- total aero moment and derivatives
CMw0 = para[iaCMw0]
Expand Down Expand Up @@ -348,8 +348,8 @@ function htsize(pari, parg, paraF, paraB, paraC,fuse,wing, htail, vtail)

dxWwing = wing.dxW
dxWstrut = wing.strut.dxW
dxWhtail = htail.dxW
dxWvtail = vtail.dxW
dxWhtail = htail.outboard.dxW
dxWvtail = vtail.outboard.dxW

xeng = parg[igxeng]
xlgnose = parg[igxlgnose]
Expand Down Expand Up @@ -713,8 +713,8 @@ function cglpay(pari, parg, fuse, wing, htail, vtail)
fuse.moment + parg[igxWtesys] + parg[igxWftank] +
Wwing * wing.layout.box_x + wing.dxW +
Wstrut * wing.layout.box_x + wing.strut.dxW +
Whtail * htail.layout.box_x + htail.dxW +
Wvtail * vtail.layout.box_x + vtail.dxW +
Whtail * htail.layout.box_x + htail.outboard.dxW +
Wvtail * vtail.layout.box_x + vtail.outboard.dxW +
Weng * parg[igxeng] +
Whpesys * fuse.HPE_sys.r.x +
Wlgnose * parg[igxlgnose] +
Expand Down
17 changes: 10 additions & 7 deletions src/misc/tail.jl
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
@kwdef mutable struct Tail
layout::WingLayout = WingLayout()
outboard::WingSectionLayout = WingSectionLayout()
outboard::TailSection = TailSection()
weight::Float64 = 0
dxW::Float64 = 0
EI_bending::Float64 = 0 #igEIch or igEIcv
EI_normal::Float64 = 0 #igEInh or igEInv
GJ::Float64 = 0 #igGJh or igGJv
thickness_cap::Float64 = 0 #igtbcaph or igtbcapv
thickness_web::Float64 = 0 #igtbwebh or igtbwebv

#MOVE TO OUTBOARD
# EI_bending::Float64 = 0 #igEIch or igEIcv
# EI_normal::Float64 = 0 #igEInh or igEInv
# GJ::Float64 = 0 #igGJh or igGJv
# thickness_cap::Float64 = 0 #igtbcaph or igtbcapv
# thickness_web::Float64 = 0 #igtbwebh or igtbwebv
# dxW::Float64 = 0

weight_fraction_added::Float64 = 0
CL_max::Float64 = 0
volume::Float64 = 0
Expand Down
43 changes: 0 additions & 43 deletions src/misc/wing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,49 +3,6 @@ using DocStringExtensions
"""
$TYPEDEF
Strut Webs and Caps
$TYPEDFIELDS
"""
@kwdef mutable struct Web_Cap_Strut
"""Bending Stiffness [N m^2] """
EI_bending::Float64 = 0
"""Normal Stiffness [N m^2] """
EI_normal::Float64 = 0
"""Torsional Rigidity [N m^2]"""
GJ::Float64 = 0
end

"""
$TYPEDEF
Wing Section
$TYPEDFIELDS
"""
@kwdef mutable struct WingSection
material::StructuralAlloy = StructuralAlloy("TASOPT-Al")
"""Wing Section layout"""
layout::WingSectionLayout = WingSectionLayout()
"""Wing Section webs"""
webs::StructuralMember = StructuralMember(material=material)
"""Wing Section caps"""
caps::StructuralMember = StructuralMember(material=material)
"""Wing Strut web and caps"""
web_cap::Web_Cap_Strut = Web_Cap_Strut() # TODO REMOVE THIS somehow
"""Max shear load [N]"""
max_shear_load::Float64 = 0
"""Moment [N m]"""
moment::Float64 = 0
"""Weight [N]"""
weight::Float64 = 0
"""Wing root moment contribution from wing weight section of engine [N m]"""
dyW::Float64 = 0
end

"""
$TYPEDEF
Wing Strut
$TYPEDFIELDS
Expand Down
60 changes: 60 additions & 0 deletions src/misc/wingSections.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
abstract type AbstractWingSection end

"""
$TYPEDEF
Strut Webs and Caps
$TYPEDFIELDS
"""
@kwdef mutable struct Web_Cap_Strut
"""Bending Stiffness [N m^2] """
EI_bending::Float64 = 0
"""Normal Stiffness [N m^2] """
EI_normal::Float64 = 0
"""Torsional Rigidity [N m^2]"""
GJ::Float64 = 0
end

"""
$TYPEDEF
Wing Section
$TYPEDFIELDS
"""
@kwdef mutable struct WingSection <: AbstractWingSection
material::StructuralAlloy = StructuralAlloy("TASOPT-Al")
"""Wing Section layout"""
layout::WingSectionLayout = WingSectionLayout()
"""Wing Section webs"""
webs::StructuralMember = StructuralMember(material=material)
"""Wing Section caps"""
caps::StructuralMember = StructuralMember(material=material)
"""Wing Strut web and caps"""
web_cap::Web_Cap_Strut = Web_Cap_Strut()
"""Max shear load [N]"""
max_shear_load::Float64 = 0
"""Moment [N m]"""
moment::Float64 = 0
"""Weight [N]"""
weight::Float64 = 0
"""Wing root moment contribution from wing weight section of engine [N m]"""
dyW::Float64 = 0
end

@kwdef mutable struct TailSection <: AbstractWingSection
"""Tail Section layout"""
layout::WingSectionLayout = WingSectionLayout()
"""Bending Stiffness [N m^2] """
EI_bending::Float64 = 0
"""Normal Stiffness [N m^2] """
EI_normal::Float64 = 0
"""Torsional Rigidity [N m^2]"""
GJ::Float64 = 0
"""Caps Thickness [m]"""
thickness_cap::Float64 = 0
"""Webs Thickness [m]"""
thickness_web::Float64 = 0
dxW::Float64 = 0
end
Loading

0 comments on commit 9aea92e

Please sign in to comment.