Skip to content

Commit

Permalink
Minor output fixes and output testing (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
askprash authored Feb 7, 2024
1 parent 8176d15 commit 4d37eb4
Show file tree
Hide file tree
Showing 8 changed files with 159 additions and 7 deletions.
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ version = "1.0.0-DEV"
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Dierckx = "39dd38d3-220a-591b-8e3c-4c3a8c710a94"
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
NLopt = "76087f3c-5699-56af-9a33-bf431cd00edd"
Expand Down
4 changes: 0 additions & 4 deletions src/IO/outputs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1473,7 +1473,6 @@ function high_res_airplane_plot(ac; ax = nothing, label_fs = 16, save_name = not
ax.plot( [xi.+lnace/2, xi.+1.0] , -1.0 .* [yi, yi], color = "k", lw = 2, zorder = wingz-2)



# Plot NP and CG range
ax.scatter(parg[igxNP], 0.0, color = "k", marker="o", zorder = 21, label = "NP")
ax.text(parg[igxNP], -1.0, "NP", fontsize=label_fs-2.0, ha="center", va="center", zorder = 21)
Expand All @@ -1498,7 +1497,6 @@ function high_res_airplane_plot(ac; ax = nothing, label_fs = 16, save_name = not
# ax.plot([parg[igxftank]-l/2, parg[igxftank]+l/2],[0.0, 0.0], zorder = 21)



# Annotations
ax.text(0, 16, @sprintf("PFEI = %5.3f J/Nm\nM\$_{cruise}\$ = %.2f\nWMTO = %.1f tonnes\nSpan = %5.1f m\nco = %5.1f m\n\$ \\Lambda \$ = %.1f\$^\\circ\$\nRfuse = %5.1f m\nL/D = %3.2f",
parm[imPFEI], para[iaMach, ipcruise1],parg[igWMTO]/9.81/1000, parg[igb], parg[igco], parg[igsweep], parg[igRfuse], para[iaCL, ipcruise1]/para[iaCD, ipcruise1]),
Expand Down Expand Up @@ -1559,8 +1557,6 @@ function high_res_airplane_plot(ac; ax = nothing, label_fs = 16, save_name = not

# Scale bar



return ax
end

Expand Down
27 changes: 27 additions & 0 deletions test/aero.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Aerodynamics:
--------------
Ref.Area= 139.48268 m²
L/D = 17.60833
CL = 0.57000
CD = 0.03237
CDfuse = 0.00681
CDi = 0.01116
CDwing = 0.00820
CDhtail = 0.00259
CDvtail = 0.00175
CDnace = 0.00186
CDBLIf = -0.00000
CDBLIw = -0.00000

Drag Areas = CD × Sref:
CL × Sref = 79.50513 m²
CD × Sref = 4.51520 m²
CDfuse × Sref = 0.95001 m²
CDi × Sref = 1.55662 m²
CDwing × Sref = 1.14362 m²
CDhtail× Sref = 0.36162 m²
CDvtail× Sref = 0.24445 m²
CDnace × Sref = 0.25888 m²
CDBLIf × Sref = -0.00000 m²
CDBLIw × Sref = -0.00000 m²

44 changes: 44 additions & 0 deletions test/geom.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Fuselage Layout:
--------------
xnose = 0.0 m ( 0.0 ft)
xend = 37.8 m ( 124.0 ft)
xwing = 18.8 m ( 61.7 ft)
xhtail = 36.2 m ( 118.9 ft)
xvtail = 35.1 m ( 115.0 ft)
xblend1 = 6.1 m ( 20.0 ft)
xblend2 = 29.6 m ( 97.0 ft)
xshell1 = 5.2 m ( 17.0 ft)
xshell2 = 31.1 m ( 102.0 ft)
xhbend = 31.0 m ( 101.7 ft)
xvbend = 31.2 m ( 102.3 ft)
xwbox = 16.0 m ( 52.6 ft)
xhbox = 34.9 m ( 114.5 ft)
xvbox = 33.5 m ( 110.0 ft)
xtshaft = 0.0 m ( 0.0 ft)
xgen = 0.0 m ( 0.0 ft)
xcat = 0.0 m ( 0.0 ft)
xftank = 0.0 m ( 0.0 ft)

Rfuse = 2.0 m ( 6.4 ft)

Stability:
--------------
xNP = 19.9 m ( 65.3 ft)
xCGfwd = 17.6 m ( 57.8 ft)
xCGaft = 19.6 m ( 64.4 ft)
xSMfwd = 0.5416
xSMaft = 0.0637

Wing Layout:
--------------
AR = 10.100
sweep = 26.000
lambdas = 0.700
lambdat = 0.250
co = 6.2 m ( 20.4 ft)
cs = 4.4 m ( 14.3 ft)
ct = 1.6 m ( 5.1 ft)
bo = 3.6 m ( 11.8 ft)
bs = 10.7 m ( 35.1 ft)
b = 37.5 m ( 123.1 ft)
S = 139.5 m²( 1501.4 ft²)
3 changes: 3 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@ using Test
@testset verbose=true "TASOPT" begin
include("unit_test_structures.jl")
include("unit_test_aero.jl")
include("unit_test_heat_exchanger.jl")
include("regression_test_wsize.jl")
include("unit_test_outputs.jl")

end
3 changes: 0 additions & 3 deletions test/unit_test_heat_exchanger.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
# exchanger in air. It assumes that air in flowing through the exchanger
# and heat is absorbed by a coolant fluid.

using TASOPT
using Test

#---------------------------------
# Test functions individually
#---------------------------------
Expand Down
32 changes: 32 additions & 0 deletions test/unit_test_outputs.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

@testset "outputs" verbose=true begin

ac = load_default_model()
size_aircraft!(ac; printiter=false);

@testset "output summaries" begin
f = open(io->TASOPT.weight_buildup(ac,io=io), "temp.txt", "w")
@test read("weights.txt", String) == read("temp.txt", String)
rm("temp.txt")

f = open(io->TASOPT.aero(ac,io=io), "temp.txt", "w")
@test read("aero.txt", String) == read("temp.txt", String)
rm("temp.txt")

f = open(io->TASOPT.geometry(ac,io=io), "temp.txt", "w")
@test read("geom.txt", String) == read("temp.txt", String)
rm("temp.txt")
end

@testset "output plots" begin

TASOPT.stickfig(ac)
@test 1 == 1
TASOPT.high_res_airplane_plot(ac)
@test 2 == 2
TASOPT.plot_details(ac)
@test 3 == 3

end

end
52 changes: 52 additions & 0 deletions test/weights.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
Weight build-up:
--------------
Wempty + 466014.1 N (104764.1 lb)
Wpay + 172146.2 N ( 38700.0 lb)
Wfuel + 233069.6 N ( 52396.1 lb)
--------------------
WMTO = 871229.9 N (195860.3 lb)

Wfuse + 195735.6 N ( 44003.1 lb)
Wwing + 128764.2 N ( 28947.3 lb)
Wvtail + 9899.4 N ( 2225.5 lb)
Whtail + 14759.3 N ( 3318.0 lb)
Wtesys + 0.0 N ( 0.0 lb)
Wftank + 0.0 N ( 0.0 lb)
Wadd + 56629.9 N ( 12730.9 lb)
--------------------
Wempty = 405788.5 N ( 91224.9 lb)

Wcap + 74931.7 N ( 16845.3 lb)
Wweb + 3583.1 N ( 805.5 lb)
Wflap + 15703.0 N ( 3530.2 lb)
Wslat + 7851.5 N ( 1765.1 lb)
Waile + 3140.6 N ( 706.0 lb)
Wlete + 7851.5 N ( 1765.1 lb)
Wribs + 11777.2 N ( 2647.6 lb)
Wspoi + 1570.3 N ( 353.0 lb)
Wwatt + 2355.4 N ( 529.5 lb)
--------------------
Wwing = 128764.2 N ( 28947.3 lb)

Wtshaft + 0.0 N ( 0.0 lb) × 2
Wcat + 0.0 N ( 0.0 lb) × 2
Waftfan + 0.0 N ( 0.0 lb) × 2
WaftGB + 0.0 N ( 0.0 lb) × 2
Wgen + 0.0 N ( 0.0 lb) × 4
Wrect + 0.0 N ( 0.0 lb) × 4
Wcables + 0.0 N ( 0.0 lb) ----
Winv + 0.0 N ( 0.0 lb) × 6
Wmot + 0.0 N ( 0.0 lb) × 6
Wfan + 0.0 N ( 0.0 lb) × 6
WfanGB + 0.0 N ( 0.0 lb) × 6
Wtms + 0.0 N ( 0.0 lb) ----
--------------------
Wtesys = 0.0 N ( 0.0 lb)

Wftnkins = 0.0 N ( 0.0 lb)
Wftank = 0.0 N ( 0.0 lb)

lftank = 0.0 m ( 0.0 ft)
Rftank = 0.0 m ( 0.0 ft)
ηtank = 100.0 %

0 comments on commit 4d37eb4

Please sign in to comment.