Skip to content

Commit 860f38d

Browse files
committed
Dist for per panel, unrefined_dist for per unrefined section
1 parent c536ba9 commit 860f38d

File tree

2 files changed

+176
-176
lines changed

2 files changed

+176
-176
lines changed

src/body_aerodynamics.jl

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ Main structure for calculating aerodynamic properties of bodies. Use the constru
1313
- `alpha_uncorrected`=zeros(Float64, P): angles of attack per panel
1414
- `alpha_corrected`=zeros(Float64, P): corrected angles of attack per panel
1515
- `stall_angle_list`=zeros(Float64, P): stall angle per panel
16-
- `alpha_array::MVector{P, Float64}` = zeros(Float64, P)
17-
- `v_a_array::MVector{P, Float64}` = zeros(Float64, P)
16+
- `alpha_dist::MVector{P, Float64}` = zeros(Float64, P)
17+
- `v_a_dist::MVector{P, Float64}` = zeros(Float64, P)
1818
- `work_vectors`::NTuple{10, MVec3} = ntuple(_ -> zeros(MVec3), 10)
1919
- `AIC::Array{Float64, 3}` = zeros(3, P, P)
2020
- `projected_area::Float64` = 1.0: The area projected onto the xy-plane of the kite body reference frame [m²]
@@ -30,8 +30,8 @@ Main structure for calculating aerodynamic properties of bodies. Use the constru
3030
alpha_uncorrected::MVector{P, Float64} = zeros(P)
3131
alpha_corrected::MVector{P, Float64} = zeros(P)
3232
stall_angle_list::MVector{P, Float64} = zeros(P)
33-
alpha_array::MVector{P, Float64} = zeros(P)
34-
v_a_array::MVector{P, Float64} = zeros(P)
33+
alpha_dist::MVector{P, Float64} = zeros(P)
34+
v_a_dist::MVector{P, Float64} = zeros(P)
3535
work_vectors::NTuple{10,MVec3} = ntuple(_ -> zeros(MVec3), 10)
3636
AIC::Array{Float64, 3} = zeros(3, P, P)
3737
projected_area::Float64 = one(Float64)
@@ -186,8 +186,8 @@ function reinit!(body_aero::BodyAerodynamics;
186186
# Initialize rest of the struct
187187
body_aero.projected_area = sum(calculate_projected_area, body_aero.wings)
188188
calculate_stall_angle_list!(body_aero.stall_angle_list, body_aero.panels)
189-
body_aero.alpha_array .= 0.0
190-
body_aero.v_a_array .= 0.0
189+
body_aero.alpha_dist .= 0.0
190+
body_aero.v_a_dist .= 0.0
191191
body_aero.AIC .= 0.0
192192
set_va!(body_aero, va, omega)
193193
return nothing
@@ -418,7 +418,7 @@ end
418418
calculate_results(body_aero::BodyAerodynamics, gamma_new,
419419
density, aerodynamic_model_type::Model,
420420
core_radius_fraction, mu,
421-
alpha_array, v_a_array,
421+
alpha_dist, v_a_dist,
422422
chord_array, x_airf_array,
423423
y_airf_array, z_airf_array,
424424
va_array, va_norm_array,
@@ -438,8 +438,8 @@ function calculate_results(
438438
aerodynamic_model_type::Model,
439439
core_radius_fraction,
440440
mu,
441-
alpha_array,
442-
v_a_array,
441+
alpha_dist,
442+
v_a_dist,
443443
chord_array,
444444
x_airf_array,
445445
y_airf_array,
@@ -462,15 +462,15 @@ function calculate_results(
462462

463463
# Calculate coefficients for each panel
464464
for (i, panel) in enumerate(panels)
465-
cl_array[i] = calculate_cl(panel, alpha_array[i])
466-
cd_array[i], cm_array[i] = calculate_cd_cm(panel, alpha_array[i])
465+
cl_array[i] = calculate_cl(panel, alpha_dist[i])
466+
cd_array[i], cm_array[i] = calculate_cd_cm(panel, alpha_dist[i])
467467
panel_width_array[i] = panel.width
468468
end
469469

470470
# Calculate forces
471-
lift = reshape((cl_array .* 0.5 .* density .* v_a_array.^2 .* chord_array), :, 1)
472-
drag = reshape((cd_array .* 0.5 .* density .* v_a_array.^2 .* chord_array), :, 1)
473-
moment = reshape((cm_array .* 0.5 .* density .* v_a_array.^2 .* chord_array), :, 1)
471+
lift = reshape((cl_array .* 0.5 .* density .* v_a_dist.^2 .* chord_array), :, 1)
472+
drag = reshape((cd_array .* 0.5 .* density .* v_a_dist.^2 .* chord_array), :, 1)
473+
moment = reshape((cm_array .* 0.5 .* density .* v_a_dist.^2 .* chord_array), :, 1)
474474

475475
# Calculate alpha corrections based on model type
476476
if correct_aoa
@@ -486,7 +486,7 @@ function calculate_results(
486486
va_unit_array
487487
)
488488
else
489-
alpha_corrected .= alpha_array
489+
alpha_corrected .= alpha_dist
490490
end
491491

492492
# Verify va is not distributed
@@ -632,7 +632,7 @@ function calculate_results(
632632
"cfy" => (sum(f_body_3D[2,:]) / (q_inf * projected_area)),
633633
"cfz" => (sum(f_body_3D[3,:]) / (q_inf * projected_area)),
634634
"alpha_at_ac" => alpha_corrected,
635-
"alpha_uncorrected" => alpha_array,
635+
"alpha_uncorrected" => alpha_dist,
636636
"alpha_geometric" => alpha_geometric,
637637
"gamma_distribution" => gamma_new,
638638
"area_all_panels" => area_all_panels,

0 commit comments

Comments
 (0)