Skip to content

Commit 650bf72

Browse files
committed
rename Umag to v_a
1 parent 20baa8f commit 650bf72

File tree

3 files changed

+9
-53
lines changed

3 files changed

+9
-53
lines changed

data/HL5_ram_air_kite_foil.dat

Lines changed: 0 additions & 46 deletions
This file was deleted.

examples/rectangular_wing.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ using LinearAlgebra
22
using ControlPlots
33
using VortexStepMethod
44

5+
plot = false
6+
57
# Step 1: Define wing parameters
68
n_panels = 20 # Number of panels
79
span = 20.0 # Wing span [m]
@@ -53,7 +55,7 @@ println("CD = $(round(results_vsm["cd"], digits=4))")
5355
println("Projected area = $(round(results_vsm["projected_area"], digits=4))")
5456

5557
# Step 6: Plot geometry
56-
plot_geometry(
58+
plot && plot_geometry(
5759
wa,
5860
"Rectangular_wing_geometry";
5961
data_type=".pdf",
@@ -66,7 +68,7 @@ nothing
6668
# Step 7: Plot spanwise distributions
6769
y_coordinates = [panel.aerodynamic_center[2] for panel in wa.panels]
6870

69-
plot_distribution(
71+
plot && plot_distribution(
7072
[y_coordinates, y_coordinates],
7173
[results_vsm, results_llt],
7274
["VSM", "LLT"],
@@ -75,7 +77,7 @@ plot_distribution(
7577

7678
# Step 8: Plot polar curves
7779
angle_range = range(0, 20, 20)
78-
plot_polars(
80+
plot && plot_polars(
7981
[llt_solver, vsm_solver],
8082
[wa, wa],
8183
["LLT", "VSM"];

src/solver.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ function gamma_loop(
199199
converged = false
200200
n_panels = wing_aero.n_panels
201201
alpha_array = wing_aero.alpha_array
202-
Umag_array = wing_aero.Umag_array
203-
Umagw_array = similar(Umag_array)
202+
v_a_array = wing_aero.v_a_array
203+
Umagw_array = similar(v_a_array)
204204

205205
gamma = copy(gamma_new)
206206
abs_gamma_new = copy(gamma_new)
@@ -242,14 +242,14 @@ function gamma_loop(
242242
alpha_array .= atan.(v_normal_array, v_tangential_array)
243243

244244
for i in 1:n_panels
245-
@views Umag_array[i] = norm(relative_velocity_crossz[i, :])
245+
@views v_a_array[i] = norm(relative_velocity_crossz[i, :])
246246
@views Umagw_array[i] = norm(Uinfcrossz_array[i, :])
247247
end
248248

249249
for (i, (panel, alpha)) in enumerate(zip(panels, alpha_array))
250250
cl_array[i] = calculate_cl(panel, alpha)
251251
end
252-
gamma_new .= 0.5 .* Umag_array.^2 ./ Umagw_array .* cl_array .* chord_array
252+
gamma_new .= 0.5 .* v_a_array.^2 ./ Umagw_array .* cl_array .* chord_array
253253

254254
# Apply damping if needed
255255
if solver.is_with_artificial_damping

0 commit comments

Comments
 (0)