Skip to content

Commit

Permalink
[SimPleAC] adding structure, comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
1ozturkbe committed Sep 27, 2017
1 parent ad1b14c commit 92d302b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions gpkitmodels/SP/SimPleAC/SimPleAC.py
Expand Up @@ -17,9 +17,9 @@ def SimPleAC():
S_wetratio = Variable("(\\frac{S}{S_{wet}})", 2.075, "-", "wetted area ratio", pr=3.)
tau = Variable("\\tau", 0.12, "-", "airfoil thickness to chord ratio", pr=10.)
W_W_coeff1 = Variable("W_{W_{coeff1}}", 2e-5, "1/m",
"Wing Weight Coefficent 1", pr= 30.) #orig 12e-5
"wing weight coefficent 1", pr= 30.) #orig 12e-5
W_W_coeff2 = Variable("W_{W_{coeff2}}", 60., "Pa",
"Wing Weight Coefficent 2", pr=10.)
"wing weight coefficent 2", pr=10.)
p_labor = Variable('p_{labor}',1.,'1/min','cost of labor', pr = 20.)

# Dimensional constants
Expand Down Expand Up @@ -63,31 +63,31 @@ def SimPleAC():

with SignomialsEnabled():
# Wing weight model
#NOTE: This is a signomial constraint that has been GPified. Could revert back to signomial?
constraints += [W_w >= W_w_surf + W_w_strc,
# W_w_strc >= W_W_coeff1 * (N_ult * A ** 1.5 * ((W_0+V_f_fuse*g*rho_f) * W * S) ** 0.5) / tau, #[GP]
W_w_strc**2. >= W_W_coeff1**2. * (N_ult**2. * A ** 3. * ((W_0+V_f_fuse*g*rho_f) * W * S)) / tau**2.,
W_w_surf >= W_W_coeff2 * S]

# and the rest of the models
# Weight and aerodynamics model
constraints += [LoD == C_L/C_D,
D >= 0.5 * rho * S * C_D * V ** 2,
Re <= (rho / mu) * V * (S / A) ** 0.5,
C_f >= 0.074 / Re ** 0.2,
T_flight >= Range / V,
W_0 + W_w + 0.5 * W_f <= 0.5 * rho * S * C_L * V ** 2,
W <= 0.5 * rho * S * C_Lmax * V_min ** 2,
W >= W_0 + W_w + W_f,
V_f == W_f / g / rho_f,
W >= W_0 + W_w + W_f]
# Fuel volume model
constraints +=[V_f == W_f / g / rho_f,
V_f_avail <= V_f_wing + V_f_fuse, #[SP]
V_f_wing**2 <= 0.0009*S**3/A*tau**2, #linear with b and tau, quadratic with chord!
V_f_wing**2 <= 0.0009*S**3/A*tau**2, # linear with b and tau, quadratic with chord
V_f_fuse <= 10*units('m')*CDA0,
#TODO: Reduce volume available by the structure!
V_f_avail >= V_f,
W_f >= TSFC * T_flight * D]

# return Model(W_f/LoD, constraints)
#return Model(D, constraints)
# return Model(D, constraints)
return Model(W_f, constraints)
# return Model(W,constraints)
# return Model(W_f*T_flight,constraints)
Expand Down

0 comments on commit 92d302b

Please sign in to comment.