Skip to content

Commit 8034b0c

Browse files
committed
Fix nan error
1 parent 0e72bdd commit 8034b0c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/panel.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@ Calculate lift coefficient for given angle of attack.
326326
- `Float64`: Lift coefficient (Cl)
327327
"""
328328
function calculate_cl(panel::Panel, alpha::Float64)::Float64
329+
isnan(alpha) && return NaN
329330
cl = 0.0
330331
if panel.aero_model == LEI_AIRFOIL_BREUKELS
331332
cl = evalpoly(rad2deg(alpha), reverse(panel.cl_coeffs))
@@ -351,6 +352,7 @@ end
351352
Calculate drag and moment coefficients for given angle of attack.
352353
"""
353354
function calculate_cd_cm(panel::Panel, alpha::Float64)
355+
isnan(alpha) && return NaN, NaN
354356
cd, cm = 0.0, 0.0
355357
if panel.aero_model == LEI_AIRFOIL_BREUKELS
356358
cd = evalpoly(rad2deg(alpha), reverse(panel.cd_coeffs))

0 commit comments

Comments
 (0)