Skip to content

Commit 5929820

Browse files
committed
replace WingAerodynamics with BodyAerodynamics
1 parent 0bfbbe7 commit 5929820

File tree

13 files changed

+42
-42
lines changed

13 files changed

+42
-42
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ add_section!(wing,
105105
"inviscid")
106106

107107
# Step 3: Initialize aerodynamics
108-
wa = WingAerodynamics([wing])
108+
wa = BodyAerodynamics([wing])
109109

110110
# Set inflow conditions
111111
vel_app = [cos(alpha), 0.0, sin(alpha)] .* v_a

docs/src/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ add_section!(wing,
106106
"inviscid")
107107

108108
# Step 3: Initialize aerodynamics
109-
wa = WingAerodynamics([wing])
109+
wa = BodyAerodynamics([wing])
110110

111111
# Set inflow conditions
112112
vel_app = [cos(alpha), 0.0, sin(alpha)] .* v_a

docs/src/types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ CurrentModule = VortexStepMethod
1515
BoundFilament
1616
Panel
1717
PanelProperties
18-
WingAerodynamics
18+
BodyAerodynamics
1919
```

examples/ram_air_kite.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ using DataFrames
1010

1111
# Create wing geometry
1212
wing = KiteWing("data/ram_air_kite_body.obj", "data/ram_air_kite_foil.dat")
13-
wing_aero = WingAerodynamics([wing])
13+
wing_aero = BodyAerodynamics([wing])
1414

1515
# Create solvers
1616
VSM = Solver(

examples/rectangular_wing.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ add_section!(wing,
2525
"inviscid")
2626

2727
# Step 3: Initialize aerodynamics
28-
wa = WingAerodynamics([wing])
28+
wa = BodyAerodynamics([wing])
2929

3030
# Set inflow conditions
3131
vel_app = [cos(alpha), 0.0, sin(alpha)] .* v_a

examples/stall_model.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ CAD_wing = Wing(n_panels; spanwise_panel_distribution)
3838
for rib in rib_list
3939
add_section!(CAD_wing, rib[1], rib[2], rib[3])
4040
end
41-
wing_aero_CAD_19ribs = WingAerodynamics([CAD_wing])
41+
wing_aero_CAD_19ribs = BodyAerodynamics([CAD_wing])
4242

4343
# Create solvers
4444
VSM = Solver(

src/VortexStepMethod.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ using SharedArrays
1616

1717
# Export public interface
1818
export Wing, Section, KiteWing
19-
export WingAerodynamics
19+
export BodyAerodynamics
2020
export Solver, solve
2121
export calculate_results, solve_circulation_distribution
2222
export add_section!, set_va!
@@ -57,7 +57,7 @@ include("kite_geometry.jl")
5757
include("filament.jl")
5858
include("panel.jl")
5959
include("wake.jl")
60-
include("wing_aerodynamics.jl")
60+
include("body_aerodynamics.jl")
6161
include("solver.jl")
6262

6363
# include plotting
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11

22
"""
3-
WingAerodynamics
3+
BodyAerodynamics
44
5-
Main structure for calculating aerodynamic properties of wings.
5+
Main structure for calculating aerodynamic properties of bodies.
66
77
# Fields
88
- panels::Vector{Panel}: Vector of Panel structs
99
- n_panels::Int64: number of panels
10-
- wings::Vector{AbstractWing}: a vector of wings; but why more than one?
10+
- wings::Vector{AbstractWing}: a vector of wings; a body can have multiple wings
1111
- `_va`::Union{Nothing, Vector{Float64}, Tuple{Vector{Float64}, Float64}}: A vector of the apparent wind speed,
1212
or a tuple of the v_a vector and yaw rate (rad/s).
1313
- ` gamma_distribution`::Union{Nothing, Vector{Float64}}: unclear, please defined
1414
- `alpha_uncorrected`::Union{Nothing, Vector{Float64}}: unclear, please define
1515
- `alpha_corrected`::Union{Nothing, Vector{Float64}}: unclear, please define
1616
- `stall_angle_list`::Vector{Float64}: unclear, please define
1717
"""
18-
mutable struct WingAerodynamics
18+
mutable struct BodyAerodynamics
1919
panels::Vector{Panel}
2020
n_panels::Int64 # TODO: Why is this needed? Just use length(panels)
2121
wings::Vector{AbstractWing} # TODO: Why not a concrete type? And why a vector?
@@ -29,7 +29,7 @@ mutable struct WingAerodynamics
2929
v_a_array::Vector{Float64}
3030
work_vectors::NTuple{10,Vector{Float64}}
3131

32-
function WingAerodynamics(
32+
function BodyAerodynamics(
3333
wings::Vector{T};
3434
aerodynamic_center_location::Float64=0.25,
3535
control_point_location::Float64=0.75
@@ -88,14 +88,14 @@ mutable struct WingAerodynamics
8888
end
8989
end
9090

91-
function Base.getproperty(obj::WingAerodynamics, sym::Symbol)
91+
function Base.getproperty(obj::BodyAerodynamics, sym::Symbol)
9292
if sym === :va
9393
return getfield(obj, :_va)
9494
end
9595
return getfield(obj, sym)
9696
end
9797

98-
function Base.setproperty!(obj::WingAerodynamics, sym::Symbol, val)
98+
function Base.setproperty!(obj::BodyAerodynamics, sym::Symbol, val)
9999
if sym === :va
100100
set_va!(obj, val)
101101
else
@@ -227,7 +227,7 @@ function calculate_panel_properties(section_list::Vector{Section}, n_panels::Int
227227
end
228228

229229
"""
230-
calculate_AIC_matrices(wa::WingAerodynamics, model::String,
230+
calculate_AIC_matrices(wa::BodyAerodynamics, model::String,
231231
core_radius_fraction::Float64,
232232
va_norm_array::Vector{Float64},
233233
va_unit_array::Matrix{Float64})
@@ -237,7 +237,7 @@ Calculate Aerodynamic Influence Coefficient matrices.
237237
Returns:
238238
Tuple of (AIC_x, AIC_y, AIC_z) matrices
239239
"""
240-
function calculate_AIC_matrices(wa::WingAerodynamics, model::String,
240+
function calculate_AIC_matrices(wa::BodyAerodynamics, model::String,
241241
core_radius_fraction::Float64,
242242
va_norm_array::Vector{Float64},
243243
va_unit_array::Matrix{Float64})
@@ -279,14 +279,14 @@ function calculate_AIC_matrices(wa::WingAerodynamics, model::String,
279279
end
280280

281281
"""
282-
calculate_circulation_distribution_elliptical_wing(wa::WingAerodynamics, gamma_0::Float64=1.0)
282+
calculate_circulation_distribution_elliptical_wing(wa::BodyAerodynamics, gamma_0::Float64=1.0)
283283
284284
Calculate circulation distribution for an elliptical wing.
285285
286286
Returns:
287287
Vector{Float64}: Circulation distribution along the wing
288288
"""
289-
function calculate_circulation_distribution_elliptical_wing(wa::WingAerodynamics, gamma_0::Float64=1.0)
289+
function calculate_circulation_distribution_elliptical_wing(wa::BodyAerodynamics, gamma_0::Float64=1.0)
290290
length(wa.wings) == 1 || throw(ArgumentError("Multiple wings not yet implemented"))
291291

292292
wing_span = wa.wings[1].span
@@ -350,7 +350,7 @@ function calculate_stall_angle_list(panels::Vector{Panel};
350350
end
351351

352352
"""
353-
update_effective_angle_of_attack_if_VSM(wa::WingAerodynamics, gamma::Vector{Float64},
353+
update_effective_angle_of_attack_if_VSM(wa::BodyAerodynamics, gamma::Vector{Float64},
354354
core_radius_fraction::Float64,
355355
x_airf_array::Matrix{Float64},
356356
y_airf_array::Matrix{Float64},
@@ -363,7 +363,7 @@ Update angle of attack at aerodynamic center for VSM method.
363363
Returns:
364364
Vector{Float64}: Updated angles of attack
365365
"""
366-
function update_effective_angle_of_attack_if_VSM(wa::WingAerodynamics,
366+
function update_effective_angle_of_attack_if_VSM(wa::BodyAerodynamics,
367367
gamma::Vector{Float64},
368368
core_radius_fraction::Float64,
369369
x_airf_array::Matrix{Float64},
@@ -395,7 +395,7 @@ function update_effective_angle_of_attack_if_VSM(wa::WingAerodynamics,
395395
end
396396

397397
"""
398-
calculate_results(wa::WingAerodynamics, gamma_new::Vector{Float64},
398+
calculate_results(wa::BodyAerodynamics, gamma_new::Vector{Float64},
399399
density::Float64, aerodynamic_model_type::String,
400400
core_radius_fraction::Float64, mu::Float64,
401401
alpha_array::Vector{Float64}, v_a_array::Vector{Float64},
@@ -410,7 +410,7 @@ Calculate final aerodynamic results.
410410
Returns:
411411
Dict: Results including forces, coefficients and distributions
412412
"""
413-
function calculate_results(wa::WingAerodynamics,
413+
function calculate_results(wa::BodyAerodynamics,
414414
gamma_new::Vector{Float64},
415415
density::Float64,
416416
aerodynamic_model_type::String,
@@ -619,14 +619,14 @@ end
619619

620620

621621
"""
622-
set_va!(wa::WingAerodynamics, va::Union{Vector{Float64}, Tuple{Vector{Float64}, Float64}})
622+
set_va!(wa::BodyAerodynamics, va::Union{Vector{Float64}, Tuple{Vector{Float64}, Float64}})
623623
624624
Set velocity array and update wake filaments.
625625
626626
# Arguments
627627
- `va`: Either a velocity vector or tuple of (velocity vector, yaw_rate)
628628
"""
629-
function set_va!(wa::WingAerodynamics, va)
629+
function set_va!(wa::BodyAerodynamics, va)
630630
# Add length check for va_vec
631631
if va isa Vector{Float64} && length(va) != 3 && length(va) != wa.n_panels
632632
throw(ArgumentError("va must be length 3 or match number of panels"))

src/plotting.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -143,20 +143,20 @@ function set_axes_equal!(ax; zoom=1.8)
143143
end
144144

145145
"""
146-
create_geometry_plot(wing_aero::WingAerodynamics, title, view_elevation, view_azimuth; zoom=1.8)
146+
create_geometry_plot(wing_aero::BodyAerodynamics, title, view_elevation, view_azimuth; zoom=1.8)
147147
148148
Create a 3D plot of wing geometry including panels and filaments.
149149
150150
# Arguments
151-
- wing_aero: struct of type WingAerodynamics
151+
- wing_aero: struct of type BodyAerodynamics
152152
- title: plot title
153153
- view_elevation: initial view elevation angle [°]
154154
- view_azimuth: initial view azimuth angle [°]
155155
156156
# Keyword arguments
157157
- zoom: zoom factor (default: 1.8)
158158
"""
159-
function create_geometry_plot(wing_aero::WingAerodynamics, title, view_elevation, view_azimuth;
159+
function create_geometry_plot(wing_aero::BodyAerodynamics, title, view_elevation, view_azimuth;
160160
zoom=1.8)
161161
set_plot_style(28)
162162

@@ -241,15 +241,15 @@ function create_geometry_plot(wing_aero::WingAerodynamics, title, view_elevation
241241
end
242242

243243
"""
244-
plot_geometry(wing_aero::WingAerodynamics, title;
244+
plot_geometry(wing_aero::BodyAerodynamics, title;
245245
data_type=".pdf", save_path=nothing,
246246
is_save=false, is_show=false,
247247
view_elevation=15, view_azimuth=-120)
248248
249249
Plot wing geometry from different viewpoints and optionally save/show plots.
250250
251251
# Arguments:
252-
- `wing_aero`: struct of type WingAerodynamics
252+
- `wing_aero`: struct of type BodyAerodynamics
253253
- title: plot title
254254
255255
# Keyword arguments:
@@ -261,7 +261,7 @@ Plot wing geometry from different viewpoints and optionally save/show plots.
261261
- `view_azimuth`: initial view azimuth angle (default: -120) [°]
262262
263263
"""
264-
function plot_geometry(wing_aero::WingAerodynamics, title;
264+
function plot_geometry(wing_aero::BodyAerodynamics, title;
265265
data_type=".pdf",
266266
save_path=nothing,
267267
is_save=false,
@@ -467,7 +467,7 @@ function plot_distribution(y_coordinates_list, results_list, label_list;
467467
end
468468

469469
"""
470-
generate_polar_data(solver, wing_aero::WingAerodynamics, angle_range;
470+
generate_polar_data(solver, wing_aero::BodyAerodynamics, angle_range;
471471
angle_type="angle_of_attack", angle_of_attack=0.0,
472472
side_slip=0.0, v_a=10.0)
473473
@@ -489,7 +489,7 @@ Generate polar data for aerodynamic analysis over a range of angles.
489489
"""
490490
function generate_polar_data(
491491
solver,
492-
wing_aero::WingAerodynamics,
492+
wing_aero::BodyAerodynamics,
493493
angle_range;
494494
angle_type="angle_of_attack",
495495
angle_of_attack=0.0,

src/solver.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ struct Solver
5555
end
5656

5757
"""
58-
solve(solver::Solver, wing_aero::WingAerodynamics, gamma_distribution=nothing)
58+
solve(solver::Solver, wing_aero::BodyAerodynamics, gamma_distribution=nothing)
5959
6060
Main solving routine for the aerodynamic model.
6161
"""
62-
function solve(solver::Solver, wing_aero::WingAerodynamics, gamma_distribution=nothing)
62+
function solve(solver::Solver, wing_aero::BodyAerodynamics, gamma_distribution=nothing)
6363
isnothing(wing_aero.panels[1].va) && throw(ArgumentError("Inflow conditions are not set, use set_va!(wing_aero, va)"))
6464

6565
# Initialize variables
@@ -181,7 +181,7 @@ Main iteration loop for calculating circulation distribution.
181181
"""
182182
function gamma_loop(
183183
solver::Solver,
184-
wing_aero::WingAerodynamics,
184+
wing_aero::BodyAerodynamics,
185185
gamma_new::Vector{Float64},
186186
AIC_x::Matrix{Float64},
187187
AIC_y::Matrix{Float64},

0 commit comments

Comments
 (0)