Skip to content

Commit

Permalink
Merge 9b73381 into e813aad
Browse files Browse the repository at this point in the history
  • Loading branch information
helo9 committed Mar 23, 2019
2 parents e813aad + 9b73381 commit 72ce4cb
Show file tree
Hide file tree
Showing 12 changed files with 775 additions and 254 deletions.
194 changes: 194 additions & 0 deletions examples/02_Analysis_Example.ipynb

Large diffs are not rendered by default.

86 changes: 74 additions & 12 deletions examples/Analysis_Example.ipynb

Large diffs are not rendered by default.

Binary file modified examples/Liftdistribution.pdf
Binary file not shown.
Binary file modified examples/Liftdistribution.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
86 changes: 0 additions & 86 deletions tests/test_liftingline.py

This file was deleted.

38 changes: 38 additions & 0 deletions tests/test_multhop.py
@@ -0,0 +1,38 @@
import numpy as np

from wingstructure.aero import multhop


# test low level functions

def test_multhop_solve():
"""test multhop_solve with numeric data from schlichting book
"""


Λ = 6 # aspect ratio of wing

b = 15 # m span width
S = b**2/Λ

cs = np.array([b/Λ]*2) # depth of wing
ys = np.array([0,b/2]) # section positions

αs = np.array([1]*2) # angle of attack
dcls = np.array([2*np.pi]*2)

# reference result from Schlichting
ηs_ref = np.array([0,0.3827,0.7071,0.9239,1])
γs_ref = np.array([0.4320,0.4192,0.3710,0.2485,0])

# coarse calculation
M = 7

solverinput = multhop._prepare_multhop(ys, αs, cs, dcls, S, b, M)

calc_ys = solverinput[0]

γs = multhop._multhop_solve(*solverinput[1:], b)

assert np.isclose(calc_ys[M//2:]/b*2, ηs_ref[:-1], atol=1e-4).all()
assert np.isclose(γs[M//2:], γs_ref[:-1], atol=1e-4).all()
2 changes: 1 addition & 1 deletion wingstructure/aero/__init__.py
@@ -1,3 +1,3 @@
from . import analysis, liftingline, nnliftingline, polarinterp

from .analysis import AirfoilData, LiftAnalysis, LiftAndMomentAnalysis
from .liftingline import AirfoilData, LiftAnalysis, calculate
3 changes: 2 additions & 1 deletion wingstructure/aero/analysis.py
Expand Up @@ -79,6 +79,7 @@ def get_α0(airfoil, airfoil_db):
self.airbrake_distribution, self.airbrake_lift, self.airbrake_drag = multhopp_(α_ab)

## lift due to angle of attack
#print('\n\naoa')
α_aoa = np.ones(M)
self.aoa_c_ls, aoa_C_L, self.aoa_C_Di = multhopp_(α_aoa)
self.aoa_c_ls /= aoa_C_L
Expand All @@ -90,7 +91,7 @@ def _calculate_flap_α(self, flap, angle=np.radians(1)):

for ii, span_pos in enumerate(self.calc_ys):

if flap.chordpos_at(span_pos) >= 0.0 and span_pos > 0:
if flap.length(span_pos) > 0.0 and span_pos > 0:

lambda_k = 1-flap.chordpos_at(span_pos)

Expand Down

0 comments on commit 72ce4cb

Please sign in to comment.