Skip to content

Commit 1265eab

Browse files
committed
Add param plt to RamAirWing
1 parent 45e716b commit 1265eab

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## Unreleased
2+
### Added
3+
- the parameter `plt`to the constructor `RamAirWing` which allows it suppress info messages
4+
15
## VortexStepMethod v1.2.1 2025-04-08
26
### Added
37
- Add back `bench2.jl` and rename it to `bench_solve.jl` #150

src/ram_geometry.jl

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ Uses an expanding search radius until valid neighbors are found.
319319
# Arguments
320320
- `matrix`: Matrix containing NaN values to be interpolated
321321
"""
322-
function interpolate_matrix_nans!(matrix::Matrix{Float64})
322+
function interpolate_matrix_nans!(matrix::Matrix{Float64}; plt=true)
323323
rows, cols = size(matrix)
324324
nans_found = 0
325325
while any(isnan, matrix)
@@ -356,7 +356,7 @@ function interpolate_matrix_nans!(matrix::Matrix{Float64})
356356
end
357357
end
358358
end
359-
if nans_found > 0
359+
if nans_found > 0 && plt
360360
@info "Removed $nans_found NaNs from the matrix."
361361
end
362362
return matrix
@@ -462,7 +462,8 @@ function RamAirWing(
462462
crease_frac=0.9, wind_vel=10., mass=1.0,
463463
n_panels=56, n_sections=n_panels+1, n_groups=4, spanwise_distribution=UNCHANGED,
464464
spanwise_direction=[0.0, 1.0, 0.0], remove_nan=true, align_to_principal=false,
465-
alpha_range=deg2rad.(-5:1:20), delta_range=deg2rad.(-5:1:20), interp_steps=n_sections # TODO: check if interpolations are still needed
465+
alpha_range=deg2rad.(-5:1:20), delta_range=deg2rad.(-5:1:20), plt=true,
466+
interp_steps=n_sections # TODO: check if interpolations are still needed
466467
)
467468

468469
!(n_panels % n_groups == 0) && throw(ArgumentError("Number of panels should be divisible by number of groups"))
@@ -511,9 +512,9 @@ function RamAirWing(
511512

512513
(alpha_range, delta_range, cl_matrix::Matrix, cd_matrix::Matrix, cm_matrix::Matrix) = deserialize(polar_path)
513514
if remove_nan
514-
interpolate_matrix_nans!(cl_matrix)
515-
interpolate_matrix_nans!(cd_matrix)
516-
interpolate_matrix_nans!(cm_matrix)
515+
interpolate_matrix_nans!(cl_matrix; plt)
516+
interpolate_matrix_nans!(cd_matrix; plt)
517+
interpolate_matrix_nans!(cm_matrix; plt)
517518
end
518519

519520
# Create sections

0 commit comments

Comments
 (0)