-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
893 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
[deps] | ||
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" | ||
DuctAPE = "ad8e49fd-fab7-444e-af4a-0daba3b8bf11" | ||
FLOWMath = "6cb5d3fb-0fe8-4cc2-bd89-9fe0b19a99d3" | ||
GR = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71" | ||
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f" | ||
Measures = "442fdcdd-2543-5da2-b0f3-8c86c306513e" | ||
NURBS = "dde13934-061e-461b-aa91-2c0fad390a0d" | ||
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" | ||
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
afparams = DuctAPE.c4b.DFDCairfoil(; | ||
alpha0=0.0, | ||
clmax=1.5, | ||
clmin=-1.0, | ||
dclda=6.28, | ||
dclda_stall=0.5, | ||
dcl_stall=0.2, | ||
cdmin=0.012, | ||
clcdmin=0.1, | ||
dcddcl2=0.005, | ||
cmcon=0.0, | ||
Re_ref=2e5, | ||
Re_exp=0.35, | ||
mcrit=0.7, | ||
) | ||
|
||
airfoils = fill(afparams, length(r)) # specify the airfoil array | ||
|
||
rotorstator_parameters = dt.RotorStatorParameters( | ||
[5], | ||
[rotorzloc], | ||
r, | ||
[Rhub+0.01], | ||
[Rtip-0.025], | ||
c, | ||
t, | ||
[0.0], # currently only zero tip gaps work. | ||
airfoils, | ||
[0.0], # can flip the cl lookups on the fly if desired, say, for stator sections | ||
) | ||
|
||
# Freestream | ||
Vinf = 0.0 # hover condition | ||
rhoinf = 1.226 | ||
asound = 340.0 | ||
muinf = 1.78e-5 | ||
|
||
# Rotation Rate | ||
RPM = 8000.0 | ||
Omega = RPM * pi / 30 # if using RPM, be sure to convert to rad/s | ||
|
||
# utilizing the constructor function to put things in vector types | ||
operating_point = dt.OperatingPoint(Vinf, rhoinf, muinf, asound, Omega) | ||
|
||
nduct_inlet = 50 | ||
ncenterbody_inlet = 30 | ||
npanels = [50, 10, 30] # the 1 is due to the fact that the duct and center body trailing edges are not quite aligned. | ||
dte_minus_cbte = 1.0 # the duct trailing edge is ahead of the centerbody trailing edge. | ||
nwake_sheets = 22 | ||
wake_length = 0.2 | ||
|
||
paneling_constants = dt.PanelingConstants( | ||
nduct_inlet, ncenterbody_inlet, npanels, dte_minus_cbte, nwake_sheets, wake_length | ||
) | ||
|
||
Vref = 50.0 #this turns out to be close to the average axial velocity at the rotor in our case | ||
Rref = Rtip | ||
|
||
reference_parameters = dt.ReferenceParameters([Vref], [Rref]) | ||
|
||
dz = [reverse(cz); nz[2:end]] | ||
dr = [reverse(cr); nr[2:end]] | ||
|
||
propulsor = dt.Propulsor( | ||
[dz dr], | ||
[cbz cbr], | ||
rotorstator_parameters, | ||
operating_point, | ||
paneling_constants, | ||
reference_parameters, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
using Plots | ||
using FLOWMath | ||
using DuctAPE | ||
const dt = DuctAPE | ||
|
||
include("geometry.jl") | ||
|
||
##### ----- COLORS ----- ##### | ||
|
||
julia_blue = RGB(0.251, 0.388, 0.847) | ||
julia_green = RGB(0.22, 0.596, 0.149) | ||
julia_purple = RGB(0.584, 0.345, 0.698) | ||
julia_red = RGB(0.796, 0.235, 0.2) | ||
|
||
##### ----- GEOMETRY ----- ##### | ||
|
||
Rtip = 0.75 | ||
Rhub = 0.25 | ||
duct_chord = 2.0 | ||
duct_le_radius = 0.025 | ||
te_camber_angle = 9.0 | ||
wedge_angle = 10.0 | ||
|
||
# - Plotting Options - # | ||
plot(; axis=false) | ||
lw = 3 | ||
fa = 1 / 3 | ||
|
||
# blue rotor | ||
rotorzloc = 0.35 * duct_chord | ||
r = range(Rhub + 0.01, Rtip - 0.025, 11) | ||
c = range(0.25, 0.2, 11) .* Rtip | ||
t = range(70.0, 30.0, 11) | ||
|
||
lez = rotorzloc .- c .* 0.25 .* sind.(t) | ||
tez = rotorzloc .+ c .* 0.75 .* sind.(t) | ||
|
||
plot!( | ||
lez, | ||
r; | ||
label="", | ||
color=julia_blue, | ||
# linewidth=lw, | ||
fillrange=Rhub * ones(11), | ||
fillcolor=julia_blue, | ||
fillalpha=fa, | ||
) | ||
plot!( | ||
tez, | ||
r; | ||
label="", | ||
color=julia_blue, | ||
# linewidth=lw, | ||
fillrange=Rhub * ones(11), | ||
fillcolor=julia_blue, | ||
fillalpha=fa, | ||
) | ||
plot!( | ||
[lez[end]; tez[end]], | ||
[Rtip; Rtip] .- 0.02; | ||
label="", | ||
linewidth=0, | ||
fillrange=Rhub * ones(11), | ||
fillcolor=julia_blue, | ||
fillalpha=fa, | ||
) | ||
|
||
# green duct | ||
nz, nr, cz, cr, _, _ = duct_geom( | ||
Rtip, duct_chord, duct_le_radius, te_camber_angle, wedge_angle; duct_alpha=2, N=60 | ||
) | ||
nr .+= Rtip | ||
cr .+= Rtip | ||
|
||
plot!( | ||
cz, | ||
cr; | ||
aspectratio=1, | ||
label="", | ||
fillrange=nr, | ||
color=julia_green, | ||
fillcolor=julia_green, | ||
fillalpha=fa, | ||
linewidth=lw, | ||
) | ||
plot!(nz, nr; label="", color=julia_green, linewidth=lw) | ||
|
||
# red center body | ||
cbz, cbr, _, _, _ = centerbody_geom( | ||
Rhub, | ||
duct_chord; | ||
cb_nc_le=0.125, | ||
cb_nc_stop=0.35, | ||
cb_tc_start=0.5, | ||
cb_ncp_z=0.125, | ||
cb_tcp_z=0.5, | ||
cb_te_r=0.0, | ||
cb_te_z=0.9, | ||
N=60, | ||
fmspline=(x, y) -> FLOWMath.Akima(x, y), | ||
smooth=true, | ||
) | ||
|
||
plot!( | ||
cbz[2:(end - 2)], | ||
cbr[2:(end - 2)]; | ||
label="", | ||
color=julia_red, | ||
linewidth=lw, | ||
fillrange=zero(cbr), | ||
fillcolor=julia_red, | ||
fillalpha=fa, | ||
) | ||
cbr[end] = 0.0 | ||
|
||
# purple wake | ||
# TODO: need to load DuctAPE and run the wake generation functions | ||
|
||
# assemble propulsor | ||
include("define_propulsor.jl") | ||
|
||
# get wake geometry | ||
problem_dimensions, prepost_containers, _, _, _, _, _, _ = dt.setup_analysis( | ||
propulsor, dt.set_options(; finterp=FLOWMath.akima) | ||
) | ||
wg = prepost_containers.wake_grid | ||
for i in 2:2:size(wg, 3) | ||
plot!(wg[1, :, i], wg[2, :, i]; color=julia_purple, label="", linewidth=lw / 2) | ||
end | ||
|
||
# finish rotor bits | ||
plot!( | ||
rotorzloc .* ones(length(wg[2, 1, 2:2:end])), | ||
wg[2, 1, 2:2:end]; | ||
label="", | ||
color=julia_blue, | ||
markerstrokecolor=julia_blue, | ||
# markershape=:hline, | ||
markersize=3, | ||
linewidth=3, | ||
seriestype=:scatter, | ||
) | ||
|
||
# axis of rotation | ||
plot!([nz[1], wg[1, end, 1]], -0.001 * ones(2); color=:black, label="", lw=1) | ||
plot!(nz[13] * ones(2), [-0.05, 0.05]; color=:black, label="") | ||
plot!(nz[13] * ones(2) .+ 0.03, [-0.05, 0.05]; color=:black, label="") | ||
plot!(wg[1, end - 5, 1] * ones(2), [-0.05, 0.05]; color=:black, label="") | ||
plot!(wg[1, end - 5, 1] * ones(2) .- 0.03, [-0.05, 0.05]; color=:black, label="") | ||
|
||
##### ----- SAVE ----- ##### | ||
savefig("assets/logo.svg") |
Oops, something went wrong.