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
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{Vector{Float64}, Float64}}: A vector of the apparent wind speed,
- `_va`::Union{Nothing, Vector{Float64}, Tuple{MVec3, 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{Vector{Float64}, Float64}}
_va::Union{Nothing, Vector{Float64}, Tuple{MVec3, 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{PosVector}
- `control_points`::Vector{PosVector}
- `bound_points_1`::Vector{PosVector}
- `bound_points_2`::Vector{PosVector}
- `aero_centers`::Vector{MVec3}
- `control_points`::Vector{MVec3}
- `bound_points_1`::Vector{MVec3}
- `bound_points_2`::Vector{MVec3}
- `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}
control_points::Vector{PosVector}
bound_points_1::Vector{PosVector}
bound_points_2::Vector{PosVector}
aero_centers::Vector{MVec3}
control_points::Vector{MVec3}
bound_points_1::Vector{MVec3}
bound_points_2::Vector{MVec3}
x_airf::Vector{Vector{Float64}}
y_airf::Vector{Vector{Float64}}
z_airf::Vector{Vector{Float64}}
Expand Down
6 changes: 3 additions & 3 deletions src/filament.jl
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ end
Represents a semi-infinite vortex filament.
"""
struct SemiInfiniteFilament <: Filament
x1::Vector{Float64} # Starting point
direction::Vector{Float64} # Direction vector
vel_mag::Float64 # Velocity magnitude
x1::MVec3 # Starting point
direction::MVec3 # 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::Vector{Float64}`: Wing span direction vector
- `spanwise_direction::MVec3`: 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::Vector{Float64}
spanwise_direction::MVec3
sections::Vector{Section}

# Additional fields for KiteWing
Expand Down
4 changes: 2 additions & 2 deletions src/panel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Represents a panel in a vortex step method simulation.
- `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
- `va::Union{Nothing, MVec3}`: Panel velocity
- `corner_points::Matrix{Float64}`: Panel corner points
- `aero_model::String`: Aerodynamic model type
- `aerodynamic_center::Vector{Float64}`: Panel aerodynamic center
Expand All @@ -30,7 +30,7 @@ mutable struct Panel{P}
TE_point_2::MVec3
LE_point_2::MVec3
chord::Float64
va::Union{Nothing,Vector{Float64}}
va::Union{Nothing, MVec3}
corner_points::Matrix{Float64}
aero_model::String
cl_coefficients::Union{Nothing,Vector{Float64}}
Expand Down
20 changes: 10 additions & 10 deletions src/solver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ struct Solver
is_only_f_and_gamma_output::Bool

function Solver(;
aerodynamic_model_type::String="VSM",
density::Float64=1.225,
max_iterations::Int64=1500,
allowed_error::Float64=1e-5,
tol_reference_error::Float64=0.001,
relaxation_factor::Float64=0.03,
is_with_artificial_damping::Bool=false,
aerodynamic_model_type::String = "VSM",
density::Float64 = 1.225,
max_iterations::Int64 = 1500,
allowed_error::Float64 = 1e-5,
tol_reference_error::Float64 = 0.001,
relaxation_factor::Float64 = 0.03,
is_with_artificial_damping::Bool = false,
artificial_damping::NamedTuple{(:k2, :k4), Tuple{Float64, Float64}}=(k2=0.1, k4=0.0),
type_initial_gamma_distribution::String="elliptic",
core_radius_fraction::Float64=1e-20,
mu::Float64=1.81e-5,
is_only_f_and_gamma_output::Bool=false
core_radius_fraction::Float64 = 1e-20,
mu::Float64 = 1.81e-5, # TODO do not use magic constants
is_only_f_and_gamma_output::Bool = false
)
new(
aerodynamic_model_type,
Expand Down
12 changes: 6 additions & 6 deletions src/wing_geometry.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@
Represents a wing section with leading edge, trailing edge, and aerodynamic properties.

# Fields
- `LE_point::Vector{Float64}`: Leading edge point coordinates
- `TE_point::Vector{Float64}`: Trailing edge point coordinates
- `LE_point::MVec3`: Leading edge point coordinates
- `TE_point::MVec3`: 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::Vector{Float64}
TE_point::Vector{Float64}
LE_point::MVec3
TE_point::MVec3
aero_input::T

function Section(
LE_point::Vector{Float64},
TE_point::Vector{Float64},
LE_point::PosVector,
TE_point::PosVector,
aero_input::T
) where T
new{T}(LE_point, TE_point, aero_input)
Expand Down
Loading