11"""
22 @with_kw mutable struct BodyAerodynamics{P}
33
4- Main structure for calculating aerodynamic properties of bodies.
4+ Main structure for calculating aerodynamic properties of bodies. Use the constructor to initialize.
55
66# Fields
77- panels::Vector{Panel}: Vector of [Panel](@ref) structs
88- wings::Union{Vector{Wing}, Vector{RamAirWing}}: A vector of wings; a body can have multiple wings
9- - `_va` ::MVec3 = zeros(MVec3): A vector of the apparent wind speed, see: [MVec3](@ref)
9+ - `va ::MVec3` = zeros(MVec3): A vector of the apparent wind speed, see: [MVec3](@ref)
1010- `omega`::MVec3 = zeros(MVec3): A vector of the turn rates around the kite body axes
1111- `gamma_distribution`=zeros(Float64, P): A vector of the circulation
1212 of the velocity field; Length: Number of segments. [m²/s]
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` = zeros(Float64, P)
17- - `v_a_array` = zeros(Float64, P)
16+ - `alpha_array::MVector{P, Float64} ` = zeros(Float64, P)
17+ - `v_a_array::MVector{P, Float64} ` = zeros(Float64, P)
1818- `work_vectors`::NTuple{10, MVec3} = ntuple(_ -> zeros(MVec3), 10)
19- - AIC::Array{Float64, 3} = zeros(3, P, P)
20- - `projected_area`::Float64 = 1.0: The area projected onto the xy-plane of the kite body reference frame [m²]
19+ - `AIC::Array{Float64, 3}` = zeros(3, P, P)
20+ - `projected_area::Float64` = 1.0: The area projected onto the xy-plane of the kite body reference frame [m²]
21+ - `y::MVector{P, Float64}` = zeros(MVector{P, Float64})
22+ - `cache::Vector{PreallocationTools.LazyBufferCache{typeof(identity), typeof(identity)}}` = [LazyBufferCache() for _ in 1:5]
2123"""
2224@with_kw mutable struct BodyAerodynamics{P}
2325 panels:: Vector{Panel}
4345
4446Construct a [BodyAerodynamics](@ref) object for aerodynamic calculations.
4547
48+ This constructor handles initialization of panels, coordinate transformations, and
49+ aerodynamic properties, returning a fully initialized structure ready for simulation.
50+
4651# Arguments
4752- `wings::Vector{T}`: Vector of wings to analyze, where T is an AbstractWing type
4853
@@ -53,6 +58,12 @@ Construct a [BodyAerodynamics](@ref) object for aerodynamic calculations.
5358
5459# Returns
5560- [BodyAerodynamics](@ref) object initialized with panels and wings
61+
62+ # Example
63+ ```julia
64+ wing = RamAirWing("body.obj", "foil.dat")
65+ body_aero = BodyAerodynamics([wing], va=[15.0, 0.0, 0.0], omega=zeros(3))
66+ ```
5667"""
5768function BodyAerodynamics (
5869 wings:: Vector{T} ;
304315Update angle of attack at aerodynamic center for VSM method.
305316
306317Returns:
307- Vector{Float64}: Updated angles of attack
318+ nothing
308319"""
309320function update_effective_angle_of_attack! (alpha_corrected,
310321 body_aero:: BodyAerodynamics ,
0 commit comments