-
Notifications
You must be signed in to change notification settings - Fork 11
/
tail_aero.py
53 lines (43 loc) · 1.36 KB
/
tail_aero.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
" tail aerodynamics "
import os
import pandas as pd
from gpkit import Model, parse_variables
from gpfit.fit_constraintset import XfoilFit
#pylint: disable=exec-used, attribute-defined-outside-init, undefined-variable
#pylint: disable=no-member
class TailAero(Model):
"""Tail Aero Model
Variables
---------
Re [-] Reynolds number
Cd [-] drag coefficient
Upper Unbounded
---------------
Cd, Re, S, V, b, rho
Lower Unbounded
---------------
S, tau, V, b, rho
LaTex Strings
-------------
Cd C_d
"""
def setup(self, static, state):
self.state = state
exec parse_variables(TailAero.__doc__)
cmac = self.cmac = static.planform.cmac
b = self.b = static.planform.b
S = self.S = static.planform.S
tau = self.tau = static.planform.tau
rho = self.rho = state.rho
V = self.V = state.V
mu = self.mu = state.mu
path = os.path.dirname(__file__)
fd = pd.read_csv(path + os.sep + "tail_dragfit.csv").to_dict(
orient="records")[0]
constraints = [
Re == V*rho*S/b/mu,
# XfoilFit(fd, Cd, [Re, static["\\tau"]],
# err_margin="RMS", airfoil="naca 0008")
XfoilFit(fd, Cd, [Re, tau], err_margin="RMS")
]
return constraints