Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/src/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ CurrentModule = VortexStepMethod
```
## Basic Vectors
```@docs
MVec3
SVec3
PosVector
VelVector
```
Expand Down
16 changes: 8 additions & 8 deletions src/VortexStepMethod.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
20 changes: 10 additions & 10 deletions src/body_aerodynamics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}}
Expand Down Expand Up @@ -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}}
Expand Down
16 changes: 8 additions & 8 deletions src/filament.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/kite_geometry.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
46 changes: 23 additions & 23 deletions src/panel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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}}

Expand Down
10 changes: 5 additions & 5 deletions src/wing_geometry.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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,
Expand Down
Loading