Skip to content

Commit cec063d

Browse files
committed
Add y to BodyAerodynamics
1 parent c84e821 commit cec063d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/body_aerodynamics.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Main structure for calculating aerodynamic properties of bodies.
3333
work_vectors::NTuple{10,MVec3} = ntuple(_ -> zeros(MVec3), 10)
3434
AIC::Array{Float64, 3} = zeros(3, P, P)
3535
projected_area::Float64 = one(Float64)
36+
y::Vector{Float64} = zeros(Float64, P)
3637
end
3738

3839
"""
@@ -355,8 +356,10 @@ function calculate_circulation_distribution_elliptical_wing(gamma_i, body_aero::
355356
@debug "Wing span: $wing_span"
356357

357358
# Calculate y-coordinates of control points
358-
# TODO: pre-allocate y
359-
y = [panel.control_point[2] for panel in body_aero.panels]
359+
y = body_aero.y
360+
for (i, panel) in pairs(body_aero.panels)
361+
y[i] = panel.control_point[2]
362+
end
360363

361364
# Calculate elliptical distribution
362365
gamma_i .= gamma_0 * sqrt.(1 .- (2 .* y ./ wing_span).^2)

0 commit comments

Comments
 (0)