Skip to content

Commit

Permalink
[SimPleAC] Moving SigEnabled to Fuel section.
Browse files Browse the repository at this point in the history
  • Loading branch information
1ozturkbe committed Sep 27, 2017
1 parent 92d302b commit 0f19a9a
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions gpkitmodels/SP/SimPleAC/SimPleAC.py
Expand Up @@ -20,7 +20,7 @@ def SimPleAC():
"wing weight coefficent 1", pr= 30.) #orig 12e-5
W_W_coeff2 = Variable("W_{W_{coeff2}}", 60., "Pa",
"wing weight coefficent 2", pr=10.)
p_labor = Variable('p_{labor}',1.,'1/min','cost of labor', pr = 20.)
p_labor = Variable('p_{labor}',1.,'1/min','cost of labor', pr = 20.)

# Dimensional constants
CDA0 = Variable("(CDA0)", "m^2", "fuselage drag area") #0.035 originally
Expand Down Expand Up @@ -57,34 +57,34 @@ def SimPleAC():
# Drag model
C_D_fuse = CDA0 / S
C_D_wpar = k * C_f * S_wetratio
C_D_ind = C_L ** 2 / (np.pi * A * e)
C_D_ind = C_L ** 2 / (np.pi * A * e)
constraints += [C_D >= C_D_fuse * toz + C_D_wpar / toz + C_D_ind * toz]

# Wing weight model
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]

# 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]

# Fuel volume model
with SignomialsEnabled():
# Wing weight model
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]

# 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]
# 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_fuse <= 10*units('m')*CDA0,
#TODO: Reduce volume available by the structure!
V_f_avail >= V_f,
W_f >= TSFC * T_flight * D]
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_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)
Expand Down

0 comments on commit 0f19a9a

Please sign in to comment.