Skip to content

Commit 786b2dc

Browse files
committed
make tests pass again
1 parent 7a0a093 commit 786b2dc

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

src/filament.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function velocity_3D_bound_vortex!(
5555
vel .= (gamma / (4π)) .* r1Xr2 ./ (norm(r1Xr2)^2) .*
5656
dot(r0, r1r2norm)
5757
elseif norm(r1Xr0) / norm(r0) == 0
58-
vel .= zeros(3)
58+
vel .= 0.0
5959
else
6060
@debug "inside core radius"
6161
@debug "distance from control point to filament: $(norm(r1Xr0) / norm(r0))"
@@ -122,7 +122,7 @@ as implemented in KiteAeroDyn".
122122
vel .= (gamma / (4π)) .* r1Xr2 ./ (norm(r1Xr2)^2) .*
123123
dot(r0, normr1r2)
124124
elseif norm(r1Xr0) / norm(r0) == 0
125-
vel .= zeros(3)
125+
vel .= 0.0
126126
else
127127
# Project onto core radius
128128
r1_proj = dot(r1, r0) * r0 / (norm(r0)^2) +
@@ -182,7 +182,7 @@ function velocity_3D_trailing_vortex_semiinfinite!(
182182
K = GAMMA / (4π) / norm(r1XVf)^2 * (1 + dot(r1, Vf) / norm(r1))
183183
vel .= K .* r1XVf
184184
elseif norm(r1XVf) / norm(Vf) == 0
185-
vel .= zeros(3)
185+
vel .= 0.0
186186
else
187187
r1_proj = dot(r1, Vf) * Vf +
188188
epsilon * (r1/norm(r1) - Vf) / norm(r1/norm(r1) - Vf)

src/panel.jl

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -364,16 +364,16 @@ Calculate the velocity induced by a vortex ring at a control point.
364364
- nothing
365365
"""
366366
@inline function calculate_velocity_induced_single_ring_semiinfinite!(
367-
velind::MVector{3, Float64},
368-
tempvel::MVector{3, Float64},
367+
velind::MVec3,
368+
tempvel::MVec3,
369369
filaments::Vector{Union{VortexStepMethod.BoundFilament, VortexStepMethod.SemiInfiniteFilament}},
370-
evaluation_point::MVector{3, Float64},
370+
evaluation_point::MVec3,
371371
evaluation_point_on_bound::Bool,
372372
va_norm::Float64,
373-
va_unit::MVector{3, Float64},
373+
va_unit::MVec3,
374374
gamma::Float64,
375375
core_radius_fraction::Float64,
376-
work_vectors::NTuple{10, MVector{3, Float64}}
376+
work_vectors::NTuple{10, MVec3}
377377
)
378378
velind .= 0.0
379379
tempvel .= 0.0
@@ -449,6 +449,7 @@ function calculate_velocity_induced_bound_2D!(
449449
cross3!(cross_, r0, r3)
450450

451451
# Calculate induced velocity
452-
U_2D .= -(cross_ ./ sum(cross_square) ./ 2π) .* norm(r0)
452+
cross_square .= cross_.^2
453+
U_2D .= (cross_ ./ sum(cross_square) ./ 2π) .* norm(r0)
453454
return nothing
454455
end

test/test_wing_aerodynamics.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,13 +194,14 @@ end
194194
# Calculate new matrices
195195
va_norm_array = fill(norm(Uinf), length(coord))
196196
va_unit_array = repeat(reshape(Uinf ./ norm(Uinf), 1, 3), length(coord))
197-
AIC_x, AIC_y, AIC_z = calculate_AIC_matrices(
197+
calculate_AIC_matrices!(
198198
wing_aero,
199199
"VSM",
200200
core_radius_fraction,
201201
va_norm_array,
202202
va_unit_array
203203
)
204+
AIC_x, AIC_y, AIC_z = wing_aero.AIC[1, :, :], wing_aero.AIC[2, :, :], wing_aero.AIC[3, :, :]
204205

205206
# Compare matrices with higher precision for VSM
206207
@test isapprox(MatrixU, AIC_x, atol=1e-8)

0 commit comments

Comments
 (0)