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
8989end
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)
9696end
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
227227end
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.
237237Returns:
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,
279279end
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
284284Calculate circulation distribution for an elliptical wing.
285285
286286Returns:
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};
350350end
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.
363363Returns:
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,
395395end
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.
410410Returns:
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
624624Set 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" ))
0 commit comments