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
11 changes: 11 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## VortexStepMethod v3.3.0 2026-05-05

### Added
- `ForwardDiff` compatibility, used by default in `linearize` (#232)
- `backend` keyword argument for `linearize`
- example `linearize_check.jl` comparing FiniteDiff and ForwardDiff tangents

### Changed
- core structs are parameterized on the scalar type `T` so dual numbers can
propagate through them; public constructors are unchanged

## VortexStepMethod v3.2.0 2026-05-02

### Added
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "VortexStepMethod"
uuid = "ed3cd733-9f0f-46a9-93e0-89b8d4998dd9"
authors = ["1-Bart-1 <bart@vandelint.net>", "Oriol Cayon and contributors"]
version = "3.2.0"
version = "3.3.0"

[workspace]
projects = ["examples", "examples_cp", "docs", "test"]
Expand Down
2 changes: 1 addition & 1 deletion docs/src/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ A body is constructed of one or more abstract wings. All wings are of type Wing.
A Wing has one or more sections and can be created from YAML files or OBJ geometry.
```@docs
Section
Section(LE_point::PosVector, TE_point::PosVector, aero_model)
Section(LE_point, TE_point, aero_model)
Wing
Wing(n_panels::Int; spanwise_distribution::PanelDistribution=LINEAR,
spanwise_direction::PosVector=MVec3([0.0, 1.0, 0.0]))
Expand Down
28 changes: 17 additions & 11 deletions src/wing_geometry.jl
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
"""
@with_kw mutable struct Section
mutable struct Section{T}

Represents a wing section with leading edge, trailing edge, and aerodynamic properties.

# Fields
- `LE_point::MVec3` = zeros(MVec3): Leading edge point coordinates
- `TE_point::MVec3` = zeros(MVec3): Trailing edge point coordinates
- `aero_model`::AeroModel = INVISCID: [AeroModel](@ref)
- `aero_data`::AeroData = nothing: See: [AeroData](@ref)
- `LE_point::MVector{3, T}`: Leading edge point coordinates
- `TE_point::MVector{3, T}`: Trailing edge point coordinates
- `aero_model::AeroModel`: [AeroModel](@ref)
- `aero_data::AeroData`: See: [AeroData](@ref)
"""
@with_kw mutable struct Section{T}
LE_point::MVector{3, T} = zeros(MVector{3, T})
TE_point::MVector{3, T} = zeros(MVector{3, T})
aero_model::AeroModel = INVISCID
aero_data::AeroData = nothing
mutable struct Section{T}
LE_point::MVector{3, T}
TE_point::MVector{3, T}
aero_model::AeroModel
aero_data::AeroData
end

Section{T}(; LE_point=zeros(MVector{3, T}), TE_point=zeros(MVector{3, T}),
aero_model=INVISCID, aero_data=nothing) where {T} =
Section{T}(LE_point, TE_point, aero_model, aero_data)

Section() = Section{Float64}()

"""
Section(LE_point::PosVector, TE_point::PosVector, aero_model)
Section(LE_point, TE_point, aero_model)

Create a new wing section with the specified leading edge point, trailing edge point,
and aerodynamic model.
Expand Down
9 changes: 9 additions & 0 deletions test/wing_geometry/test_wing_geometry.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ function ==(a::Section, b::Section)
end

@testset "Wing Geometry Tests" begin
@testset "Section default constructor" begin
s = Section()
@test s isa Section{Float64}
@test s.LE_point == zeros(3)
@test s.TE_point == zeros(3)
@test s.aero_model === INVISCID
@test isnothing(s.aero_data)
end

@testset "Wing initialization" begin
example_wing = Wing(10; spanwise_distribution=LINEAR)
@test example_wing.n_panels == 10
Expand Down
Loading