Skip to content
Merged
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
1 change: 1 addition & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ makedocs(;
pages=[
"Home" => "index.md",
"Exported Functions" => "functions.md",
"Exported Types" => "types.md",
],
)

Expand Down
19 changes: 19 additions & 0 deletions docs/src/types.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
```@meta
CurrentModule = VortexStepMethod
```
## Basic Vectors
```@docs
MVec3
PosVector
VelVector
```

## Wing Geometry, Panel and Aerodynamics
```@docs
Section
Wing
BoundFilament
Panel
PanelProperties
WingAerodynamics
```
6 changes: 6 additions & 0 deletions src/VortexStepMethod.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ const MVec3 = MVector{3, Float64}
Position vector, either a `MVec3` or a `Vector` for use in function signatures.
"""
const PosVector=Union{MVec3, Vector, SizedVector{3, Float64, Vector{Float64}}}

"""
const VelVector=Union{MVec3, Vector}

Velocity vector, either a `MVec3` or a `Vector` for use in function signatures.
"""
const VelVector=Union{MVec3, Vector, SizedVector{3, Float64, Vector{Float64}}}

abstract type AbstractWing end
Expand Down
14 changes: 10 additions & 4 deletions src/filament.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@ const NU = 1.48e-5 # Kinematic viscosity of air
BoundFilament

Represents a bound vortex filament defined by two points.

# Fields
- x1::MVec3: First point
- x2::MVec3: Second point
- length: Filament length
- r0::MVec3: Vector from x1 to x2
"""
struct BoundFilament <: Filament
x1::Vector{Float64} # First point
x2::Vector{Float64} # Second point
length::Float64 # Filament length
r0::Vector{Float64} # Vector from x1 to x2
x1::MVec3 # First point
x2::MVec3 # Second point
length::Float64 # Filament length
r0::MVec3 # Vector from x1 to x2

function BoundFilament(x1::PosVector, x2::PosVector)
new(x1, x2, norm(x2 - x1), x2 - x1)
Expand Down
20 changes: 10 additions & 10 deletions src/panel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ using LinearAlgebra
Represents a panel in a vortex step method simulation.

# Fields
- `TE_point_1::Vector{Float64}`: First trailing edge point
- `LE_point_1::Vector{Float64}`: First leading edge point
- `TE_point_2::Vector{Float64}`: Second trailing edge point
- `LE_point_2::Vector{Float64}`: Second leading edge point
- `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
- `chord::Float64`: Panel chord length
- `va::Union{Nothing,Vector{Float64}}`: Panel velocity
- `corner_points::Matrix{Float64}`: Panel corner points
- `panel_aero_model::String`: Aerodynamic model type
- `aerodynamic_center::Vector{Float64}`: Panel aerodynamic center
- `control_point::Vector{Float64}`: Panel control point
- `bound_point_1::Vector{Float64}`: First bound point
- `bound_point_2::Vector{Float64}`: Second bound point
- `x_airf::Vector{Float64}`: Unit vector perpendicular to chord line
- `y_airf::Vector{Float64}`: Unit vector parallel to chord line
- `z_airf::Vector{Float64}`: Unit vector in spanwise direction
- `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
- `width::Float64`: Panel width
- `filaments::Vector{BoundFilament}`: Panel filaments
"""
Expand Down
25 changes: 23 additions & 2 deletions src/wing_aerodynamics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,22 @@
WingAerodynamics
Main structure for calculating aerodynamic properties of wings.
# Fields
- panels::Vector{Panel}: Vector of Panel structs
- n_panels::Int64: number of panels
- wings::Vector{AbstractWing}: a vector of wings; but why more than one?
- `_va`::Union{Nothing, Vector{Float64}, Tuple{Vector{Float64}, 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
- `alpha_corrected`::Union{Nothing, Vector{Float64}}: unclear, please define
- `stall_angle_list`::Vector{Float64}: unclear, please define
"""
mutable struct WingAerodynamics
panels::Vector{Panel}
n_panels::Int
wings::Vector{AbstractWing}
n_panels::Int64 # TODO: Why is this needed? Just use length(panels)
wings::Vector{AbstractWing} # TODO: Why not a concrete type? And why a vector?
_va::Union{Nothing, Vector{Float64}, Tuple{Vector{Float64}, Float64}}
gamma_distribution::Union{Nothing, Vector{Float64}}
alpha_uncorrected::Union{Nothing, Vector{Float64}}
Expand Down Expand Up @@ -96,6 +107,16 @@ end
PanelProperties
Structure to hold calculated panel properties.
# Fields
- `aero_centers`::Vector{PosVector}
- `control_points`::Vector{PosVector}
- `bound_points_1`::Vector{PosVector}
- `bound_points_2`::Vector{PosVector}
- `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{PosVector}
Expand Down
2 changes: 1 addition & 1 deletion src/wing_geometry.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Represents a wing composed of multiple sections with aerodynamic properties.
# Distribution types
- "linear": Linear distribution
- "cosine": Cosine distribution
- "cosine_van_Garrel": van Garrel cosine distribution
- "`cosine_van_Garrel`": van Garrel cosine distribution
- "split_provided": Split provided sections
- "unchanged": Keep original sections
"""
Expand Down
Loading