diff --git a/docs/src/types.md b/docs/src/types.md index f9a54b96..0c0d9e4c 100644 --- a/docs/src/types.md +++ b/docs/src/types.md @@ -3,7 +3,7 @@ CurrentModule = VortexStepMethod ``` ## Basic Vectors ```@docs - MVec3 + SVec3 PosVector VelVector ``` diff --git a/src/VortexStepMethod.jl b/src/VortexStepMethod.jl index 27483333..411a61cf 100644 --- a/src/VortexStepMethod.jl +++ b/src/VortexStepMethod.jl @@ -25,25 +25,25 @@ export plot_wing, plot_circulation_distribution, plot_geometry, plot_distributio export show_plot, save_plot, menu """ - const MVec3 = MVector{3, Float64} + const SVec3 = MVector{3, Float64} Basic 3-dimensional vector, stack allocated, mutable. """ -const MVec3 = MVector{3, Float64} +const SVec3 = MVector{3, Float64} """ - const PosVector=Union{MVec3, Vector} + const PosVector=Union{SVec3, Vector} -Position vector, either a `MVec3` or a `Vector` for use in function signatures. +Position vector, either a `SVec3` or a `Vector` for use in function signatures. """ -const PosVector=Union{MVec3, Vector, SizedVector{3, Float64, Vector{Float64}}} +const PosVector=Union{SVec3, Vector, SizedVector{3, Float64, Vector{Float64}}} """ - const VelVector=Union{MVec3, Vector} + const VelVector=Union{SVec3, Vector} -Velocity vector, either a `MVec3` or a `Vector` for use in function signatures. +Velocity vector, either a `SVec3` or a `Vector` for use in function signatures. """ -const VelVector=Union{MVec3, Vector, SizedVector{3, Float64, Vector{Float64}}} +const VelVector=Union{SVec3, Vector, SizedVector{3, Float64, Vector{Float64}}} @enum Model VSM LLT diff --git a/src/body_aerodynamics.jl b/src/body_aerodynamics.jl index 0182a4ff..99476d04 100644 --- a/src/body_aerodynamics.jl +++ b/src/body_aerodynamics.jl @@ -6,7 +6,7 @@ Main structure for calculating aerodynamic properties of bodies. # Fields - panels::Vector{Panel}: Vector of Panel structs - wings::Vector{AbstractWing}: a vector of wings; a body can have multiple wings -- `_va`::Union{Nothing, Vector{Float64}, Tuple{MVec3, Float64}}: A vector of the apparent wind speed, +- `_va`::Union{Nothing, Vector{Float64}, Tuple{SVec3, Float64}}: A vector of the apparent wind speed, or a tuple of the v_a vector and yaw rate (rad/s). - `gamma_distribution`::Union{Nothing, Vector{Float64}}: unclear, please defined - `alpha_uncorrected`::Union{Nothing, Vector{Float64}}: unclear, please define @@ -16,7 +16,7 @@ Main structure for calculating aerodynamic properties of bodies. mutable struct BodyAerodynamics panels::Vector{Panel} wings::Vector{AbstractWing} # can be a vector of Wings, or of KiteWings - _va::Union{Nothing, Vector{Float64}, Tuple{MVec3, Float64}} + _va::Union{Nothing, Vector{Float64}, Tuple{SVec3, Float64}} gamma_distribution::Union{Nothing, Vector{Float64}} alpha_uncorrected::Union{Nothing, Vector{Float64}} alpha_corrected::Union{Nothing, Vector{Float64}} @@ -105,20 +105,20 @@ end Structure to hold calculated panel properties. # Fields -- `aero_centers`::Vector{MVec3} -- `control_points`::Vector{MVec3} -- `bound_points_1`::Vector{MVec3} -- `bound_points_2`::Vector{MVec3} +- `aero_centers`::Vector{SVec3} +- `control_points`::Vector{SVec3} +- `bound_points_1`::Vector{SVec3} +- `bound_points_2`::Vector{SVec3} - `x_airf`::Vector{Vector{Float64}}: unclear, please define - `y_airf`::Vector{Vector{Float64}}: unclear, please define - `z_airf`::Vector{Vector{Float64}}: unclear, please define """ struct PanelProperties - aero_centers::Vector{MVec3} - control_points::Vector{MVec3} - bound_points_1::Vector{MVec3} - bound_points_2::Vector{MVec3} + aero_centers::Vector{SVec3} + control_points::Vector{SVec3} + bound_points_1::Vector{SVec3} + bound_points_2::Vector{SVec3} x_airf::Vector{Vector{Float64}} y_airf::Vector{Vector{Float64}} z_airf::Vector{Vector{Float64}} diff --git a/src/filament.jl b/src/filament.jl index 41730627..c89fa874 100644 --- a/src/filament.jl +++ b/src/filament.jl @@ -14,16 +14,16 @@ const NU = 1.48e-5 # Kinematic viscosity of air Represents a bound vortex filament defined by two points. # Fields -- x1::MVec3: First point -- x2::MVec3: Second point +- x1::SVec3: First point +- x2::SVec3: Second point - length: Filament length -- r0::MVec3: Vector from x1 to x2 +- r0::SVec3: Vector from x1 to x2 """ struct BoundFilament <: Filament - x1::MVec3 # First point - x2::MVec3 # Second point + x1::SVec3 # First point + x2::SVec3 # Second point length::Float64 # Filament length - r0::MVec3 # Vector from x1 to x2 + r0::SVec3 # Vector from x1 to x2 function BoundFilament(x1::PosVector, x2::PosVector) new(x1, x2, norm(x2 - x1), x2 - x1) @@ -152,8 +152,8 @@ end Represents a semi-infinite vortex filament. """ struct SemiInfiniteFilament <: Filament - x1::MVec3 # Starting point - direction::MVec3 # Direction vector + x1::SVec3 # Starting point + direction::SVec3 # Direction vector vel_mag::Float64 # Velocity magnitude filament_direction::Int64 # Direction indicator (-1 or 1) end diff --git a/src/kite_geometry.jl b/src/kite_geometry.jl index 511a56bd..a21fa553 100644 --- a/src/kite_geometry.jl +++ b/src/kite_geometry.jl @@ -177,7 +177,7 @@ Represents a curved wing that inherits from Wing with additional geometric prope - All fields from Wing: - `n_panels::Int`: Number of panels in aerodynamic mesh - `spanwise_panel_distribution::String`: Panel distribution type - - `spanwise_direction::MVec3`: Wing span direction vector + - `spanwise_direction::SVec3`: Wing span direction vector - `sections::Vector{Section}`: List of wing sections - Additional fields: - `center_of_mass::Vector{Float64}`: Center of mass coordinates @@ -190,7 +190,7 @@ Same as Wing mutable struct KiteWing <: AbstractWing n_panels::Int64 spanwise_panel_distribution::String - spanwise_direction::MVec3 + spanwise_direction::SVec3 sections::Vector{Section} # Additional fields for KiteWing diff --git a/src/panel.jl b/src/panel.jl index 78aee0c0..8b76a6ce 100644 --- a/src/panel.jl +++ b/src/panel.jl @@ -6,44 +6,44 @@ using LinearAlgebra Represents a panel in a vortex step method simulation. # Fields -- `TE_point_1::MVec3`: First trailing edge point -- `LE_point_1::MVec3`: First leading edge point -- `TE_point_2::Vector{MVec3}`: Second trailing edge point -- `LE_point_2::Vector{MVec3}`: Second leading edge point +- `TE_point_1::SVec3`: First trailing edge point +- `LE_point_1::SVec3`: First leading edge point +- `TE_point_2::Vector{SVec3}`: Second trailing edge point +- `LE_point_2::Vector{SVec3}`: Second leading edge point - `chord::Float64`: Panel chord length -- `va::Union{Nothing, MVec3}`: Panel velocity +- `va::Union{Nothing, SVec3}`: Panel velocity - `corner_points::Matrix{Float64}`: Panel corner points - `aero_model::String`: Aerodynamic model type - `aerodynamic_center::Vector{Float64}`: Panel aerodynamic center -- `control_point::Vector{MVec3}`: Panel control point -- `bound_point_1::Vector{MVec3}`: First bound point -- `bound_point_2::Vector{MVec3}`: Second bound point -- `x_airf::MVec3`: Unit vector perpendicular to chord line -- `y_airf::MVec3`: Unit vector parallel to chord line -- `z_airf::MVec3`: Unit vector in spanwise direction +- `control_point::Vector{SVec3}`: Panel control point +- `bound_point_1::Vector{SVec3}`: First bound point +- `bound_point_2::Vector{SVec3}`: Second bound point +- `x_airf::SVec3`: Unit vector perpendicular to chord line +- `y_airf::SVec3`: Unit vector parallel to chord line +- `z_airf::SVec3`: Unit vector in spanwise direction - `width::Float64`: Panel width - `filaments::Vector{BoundFilament}`: Panel filaments """ mutable struct Panel{P} - TE_point_1::MVec3 - LE_point_1::MVec3 - TE_point_2::MVec3 - LE_point_2::MVec3 + TE_point_1::SVec3 + LE_point_1::SVec3 + TE_point_2::SVec3 + LE_point_2::SVec3 chord::Float64 - va::Union{Nothing, MVec3} + va::Union{Nothing, SVec3} corner_points::Matrix{Float64} aero_model::String cl_coefficients::Union{Nothing,Vector{Float64}} cd_coefficients::Union{Nothing,Vector{Float64}} cm_coefficients::Union{Nothing,Vector{Float64}} polar_data::P - aerodynamic_center::MVec3 - control_point::MVec3 - bound_point_1::MVec3 - bound_point_2::MVec3 - x_airf::MVec3 - y_airf::MVec3 - z_airf::MVec3 + aerodynamic_center::SVec3 + control_point::SVec3 + bound_point_1::SVec3 + bound_point_2::SVec3 + x_airf::SVec3 + y_airf::SVec3 + z_airf::SVec3 width::Float64 filaments::Vector{Union{BoundFilament, SemiInfiniteFilament}} diff --git a/src/wing_geometry.jl b/src/wing_geometry.jl index 4a71deff..d402d616 100644 --- a/src/wing_geometry.jl +++ b/src/wing_geometry.jl @@ -5,16 +5,16 @@ Represents a wing section with leading edge, trailing edge, and aerodynamic properties. # Fields -- `LE_point::MVec3`: Leading edge point coordinates -- `TE_point::MVec3`: Trailing edge point coordinates +- `LE_point::SVec3`: Leading edge point coordinates +- `TE_point::SVec3`: Trailing edge point coordinates - `aero_input::Vector{Any}`: Aerodynamic input data for the section: - `("inviscid")`: Inviscid aerodynamics - `("polar_data", [alpha_column,CL_column,CD_column,CM_column])`: Polar data aerodynamics - `("lei_airfoil_breukels", [d_tube,camber])`: LEI airfoil with Breukels parameters """ struct Section{T} - LE_point::MVec3 - TE_point::MVec3 + LE_point::SVec3 + TE_point::SVec3 aero_input::T function Section( @@ -52,7 +52,7 @@ mutable struct Wing <: AbstractWing function Wing(n_panels::Int; spanwise_panel_distribution::String="linear", - spanwise_direction::PosVector=MVec3([0.0, 1.0, 0.0])) + spanwise_direction::PosVector=SVec3([0.0, 1.0, 0.0])) new(n_panels, spanwise_panel_distribution, spanwise_direction,