Skip to content

Commit

Permalink
reinitialize if unconverged
Browse files Browse the repository at this point in the history
  • Loading branch information
taylormcd committed Sep 15, 2022
1 parent 1fd870f commit 604c90a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/higherlevel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,11 @@ for (T, name, set_coordinates, pane, solve_alpha, do_percussive_maintenance) in
$(pane)(npan = npan)
end

# reinitialize if previous solution didn't converge
_reinit = reinit || (i !=1 && !converged[i-1])

# run XFOIL
cl[i], cd[i], cdp[i], cm[i], converged[i] = $(solve_alpha)(alpha[i], re, mach=mach, iter=iter, ncrit=ncrit, reinit=reinit, xtrip=xtrip)
cl[i], cd[i], cdp[i], cm[i], converged[i] = $(solve_alpha)(alpha[i], re, mach=mach, iter=iter, ncrit=ncrit, reinit=_reinit, xtrip=xtrip)

# try percussive maintenance
if !converged[i] && percussive_maintenance
Expand Down

0 comments on commit 604c90a

Please sign in to comment.