@@ -672,14 +672,39 @@ function calc_residuals(residuals::AbstractVector,
672672
673673 # --------- Step 2: convert cl to Gamma --------------------------------
674674 magU = sqrt (Us[1 , ei]^ 2 + Us[2 , ei]^ 2 + Us[3 , ei]^ 2 )
675+ # magU = sqrt(Uinfs[1, ei]^2 + Uinfs[2, ei]^2 + Uinfs[3, ei]^2)
675676 Gammas[ei] = cl * 0.5 * magU* ll. chords[ei]
676677
677678 end
678679
679680 # --------- Step 3: compute inflow velocity U at lifting line --------------
680- Us .= Uinfs
681+
682+ # Dragging line component
683+ for ei in 1 : ll. nelements
684+
685+ magU = sqrt (Us[1 , ei]^ 2 + Us[2 , ei]^ 2 + Us[3 , ei]^ 2 )
686+ # magU = sqrt(Uinfs[1, ei]^2 + Uinfs[2, ei]^2 + Uinfs[3, ei]^2)
687+
688+ cd = calc_cd (ll. elements[ei], aoas[ei])
689+ Lambda = cd * 0.5 * magU* ll. chords[ei] # Source filament strength
690+ sigma = Lambda/ ll. chords[ei] # Equivalent constant source panel strength
691+
692+ for i in 1 : 3
693+ # Here we approximate the velocity induced by the dragging line
694+ # by using an approximation of only the self-induced velocity
695+ Us[i, ei] = - 0.5 * sigma/ 2 * ll. tangents[i, ei]
696+ end
697+
698+ end
699+
700+ # Freestream component
701+ Us .+ = Uinfs
702+ # Us .= Uinfs
703+
704+ # Lifting line component
681705 Uind! (ll, Gammas, ll. midpoints, Us)
682706
707+
683708 for ei in 1 : ll. nelements
684709
685710 # --------- Step 4: compute effective aoa from inflow velocity ---------
0 commit comments