@@ -8,22 +8,13 @@ Represents a wing section with leading edge, trailing edge, and aerodynamic prop
88- `LE_point::MVec3` = zeros(MVec3): Leading edge point coordinates
99- `TE_point::MVec3` = zeros(MVec3): Trailing edge point coordinates
1010- `aero_model`::AeroModel = INVISCID: [AeroModel](@ref)
11- - `aero_data` = nothing: Can be:
12- - nothing for INVISCID
13- - (`tube_diameter`, camber) for `LEI_AIRFOIL_BREUKELS`
14- - (`alpha_range`, `cl_vector`, `cd_vector`, `cm_vector`) for `POLAR_DATA`
15- - (`alpha_range`, `beta_range`, `cl_matrix`, `cd_matrix`, `cm_matrix`) for `POLAR_DATA`
11+ - `aero_data`::AeroData = nothing: See: [AeroData]
1612"""
1713@with_kw mutable struct Section
1814 LE_point:: MVec3 = zeros (MVec3)
1915 TE_point:: MVec3 = zeros (MVec3)
2016 aero_model:: AeroModel = INVISCID
21- aero_data:: Union {
22- Nothing,
23- NTuple{2 , Float64},
24- Tuple{Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Float64}},
25- Tuple{Vector{Float64}, Vector{Float64}, Matrix{Float64}, Matrix{Float64}, Matrix{Float64}}
26- } = nothing
17+ aero_data:: AeroData = nothing
2718end
2819"""
2920 Section(LE_point::Vector{Float64}, TE_point::Vector{Float64},
@@ -130,14 +121,10 @@ Add a new section to the wing.
130121- LE_point::PosVector: [PosVector](@ref) of the point on the side of the leading edge
131122- TE_point::PosVector: [PosVector](@ref) of the point on the side of the trailing edge
132123- `aero_model`::AeroModel: [AeroModel](@ref)
133- - `aero_data`: Can be:
134- - nothing for INVISCID
135- - (`tube_diameter`, camber) for `LEI_AIRFOIL_BREUKELS`
136- - (`alpha_range`, `cl_vector`, `cd_vector`, `cm_vector`) for `POLAR_DATA`
137- - (`alpha_range`, `beta_range`, `cl_matrix`, `cd_matrix`, `cm_matrix`) for `POLAR_DATA`
124+ - `aero_data`::AeroData: See [AeroData](@ref)
138125"""
139126function add_section! (wing:: Wing , LE_point:: Vector{Float64} ,
140- TE_point:: Vector{Float64} , aero_model:: AeroModel , aero_data= nothing )
127+ TE_point:: Vector{Float64} , aero_model:: AeroModel , aero_data:: AeroData = nothing )
141128 push! (wing. sections, Section (LE_point, TE_point, aero_model, aero_data))
142129 return nothing
143130end
@@ -258,15 +245,15 @@ function calculate_new_aero_data(aero_model,
258245 throw (ArgumentError (" Different aero models over the span are not supported" ))
259246 end
260247
261- if model_type === INVISCID
248+ if model_type == INVISCID
262249 return nothing
263250
264- elseif model_type === POLAR_DATA
251+ elseif model_type in (POLAR_VECTORS, POLAR_MATRICES)
265252 polar_left = aero_data[section_index]
266253 polar_right = aero_data[section_index + 1 ]
267254
268255 # Unpack polar data
269- if length (polar_left) == 4
256+ if model_type == POLAR_VECTORS
270257 alpha_left, CL_left, CD_left, CM_left = polar_left
271258 alpha_right, CL_right, CD_right, CM_right = polar_right
272259
@@ -281,7 +268,7 @@ function calculate_new_aero_data(aero_model,
281268
282269 return (alpha_left, CL_data, CD_data, CM_data)
283270
284- elseif length (polar_left) == 5
271+ elseif model_type == POLAR_MATRICES
285272 alpha_left, beta_left, CL_left, CD_left, CM_left = polar_left
286273 alpha_right, beta_right, CL_right, CD_right, CM_right = polar_right
287274
0 commit comments