Skip to content

Commit

Permalink
Merge branch 'fix-vtk_updates' of https://github.com/suavecode/SUAVE
Browse files Browse the repository at this point in the history
…into fix-vtk_updates
  • Loading branch information
rachealerhard committed Mar 7, 2022
2 parents 2fb0c3a + cc03e7b commit 4e96d51
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 182 deletions.
2 changes: 1 addition & 1 deletion regression/scripts/VTOL/test_Stopped_Rotor.py
Expand Up @@ -83,7 +83,7 @@ def main():

# Battery Energy Check During Transition
battery_energy_hover_to_transition = results.segments.transition_1.conditions.propulsion.battery_energy[:,0]
battery_energy_hover_to_transition_true = np.array([3.37413e+08, 3.36788424e+08, 3.35717487e+08])
battery_energy_hover_to_transition_true = np.array([3.36408606e+08, 3.34311680e+08, 3.32285962e+08])

print(battery_energy_hover_to_transition)
diff_battery_energy_hover_to_transition = np.abs(battery_energy_hover_to_transition - battery_energy_hover_to_transition_true)
Expand Down
Expand Up @@ -64,7 +64,7 @@ def main():
results_SR = mission_SR.evaluate()
results_SR = results_SR.merged()

distance_regression_SR = 102672.78664186322
distance_regression_SR = 102049.04865285615

distance_calc_SR = results_SR.conditions.frames.inertial.position_vector[-1,0]
print('distance_calc_SR = ', distance_calc_SR)
Expand Down Expand Up @@ -335,7 +335,7 @@ def mission_setup_SR(vehicle,analyses):

segment.altitude = 1000.0 * Units.ft
segment.air_speed = 110. * Units['mph']
segment.distance = 60. * Units.miles
segment.distance = 40. * Units.miles
segment.state.unknowns.throttle = 0.80 * ones_row(1)

segment = vehicle.networks.lift_cruise.add_cruise_unknowns_and_residuals_to_segment(segment,initial_prop_power_coefficient=0.16)
Expand Down

This file was deleted.

Expand Up @@ -4,4 +4,3 @@

from .Constant_Acceleration_Constant_Pitchrate_Constant_Altitude import Constant_Acceleration_Constant_Pitchrate_Constant_Altitude
from .Constant_Acceleration_Constant_Angle_Linear_Climb import Constant_Acceleration_Constant_Angle_Linear_Climb
from .Lift_Cruise_Optimized import Lift_Cruise_Optimized
2 changes: 1 addition & 1 deletion trunk/SUAVE/Components/Energy/Networks/Lift_Cruise.py
Expand Up @@ -383,7 +383,7 @@ def evaluate_thrust(self,state):


# link
lift_rotor_esc.inputs.currentout = lift_rotor_motor.outputs.current
lift_rotor_esc.inputs.currentout = total_lift_rotor_motor_current

# Run the lift_rotor esc
lift_rotor_esc.currentin(konditions)
Expand Down
Expand Up @@ -136,7 +136,9 @@ def evaluate_thrust(self,state):
avionics_payload_current = avionics_payload_power/self.voltage

# link to the battery
battery.inputs.current = esc.outputs.currentin + avionics_payload_current
battery.inputs.current = esc.outputs.currentin + avionics_payload_current - \
generator.outputs.power_generated/self.voltage

battery.inputs.power_in = -((esc.inputs.voltagein)*esc.outputs.currentin + avionics_payload_power) + (
generator.outputs.power_generated)

Expand Down
9 changes: 6 additions & 3 deletions trunk/SUAVE/Input_Output/OpenVSP/vsp_wing.py
Expand Up @@ -559,10 +559,8 @@ def write_vsp_wing(vehicle,wing, area_tags, fuel_tank_set_ind, OML_set_ind):
if n_segments>0:
if wing.Segments[0].percent_span_location==0.:
x_secs[-1] = [] # remove extra section tag (for clarity)
segment_0_is_root_flag = True
adjust = 0 # used for indexing
else:
segment_0_is_root_flag = False
adjust = 1
else:
adjust = 1
Expand Down Expand Up @@ -617,11 +615,16 @@ def write_vsp_wing(vehicle,wing, area_tags, fuel_tank_set_ind, OML_set_ind):

# Set the parm values
vsp.SetParmVal(span_parm, span_i)
vsp.SetParmVal(dih_parm, dihedral_i)
vsp.SetParmVal(sweep_parm, sweep_i)
vsp.SetParmVal(swp_loc_parm, sweep_loc)
vsp.SetParmVal(rt_ch_parm, chord_i)
vsp.SetParmVal(tc_parm, tc_i)

# OpenVSP's rotation on vertical segmented wings is opposite of SUAVE's
if not wing.vertical:
vsp.SetParmVal(dih_parm, dihedral_i)
else:
vsp.SetParmVal(dih_parm, -dihedral_i)

if not no_twist_flag:
twist_parm = vsp.GetXSecParm(x_sec_id, 'Twist')
Expand Down
Expand Up @@ -90,7 +90,7 @@ def compressibility_drag_total(state,settings,geometry):

# Calculate compressibility drag at Mach 0.99 and 1.05 for interpolation between
# dummy variables are unused function outputs
(drag99,dummy1,dummy2) = drag_div(np.array([[0.99]] * len(Mc)),wing,k,cl,Sref_main)
(drag99,dummy1,dummy2) = drag_div(np.array([[0.99]] * len(Mc)),wing,cl,Sref_main)
cdc_l = lift_wave_drag(conditions,
configuration,
wing,
Expand Down

0 comments on commit 4e96d51

Please sign in to comment.