Skip to content

Commit

Permalink
changes to enable tutorials to work
Browse files Browse the repository at this point in the history
  • Loading branch information
planes committed Jan 9, 2017
1 parent 3d1c426 commit bdcac1e
Show file tree
Hide file tree
Showing 12 changed files with 552 additions and 1,171 deletions.
911 changes: 458 additions & 453 deletions LICENSE

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions README.md
Expand Up @@ -10,7 +10,7 @@ for future aircraft incorporating advanced technologies.
[![Build Status](https://travis-ci.org/suavecode/SUAVE.svg?branch=master)](https://travis-ci.org/suavecode/SUAVE)
[![DOI](https://zenodo.org/badge/doi/10.5281/zenodo.50810.svg)](http://dx.doi.org/10.5281/zenodo.50810)

License: CC BY-NC-SA 4.0
License: LGPL-2.1

Guides and Forum available at [suave.stanford.edu](http://suave.stanford.edu).

Expand All @@ -22,8 +22,8 @@ Contributing Developers
* Carlos Ilario
* Emilio Botero
* Francisco Capristan
* Jia Xu
* Juan Alonso
* Luke Kulik
* Michael Colonno
* Michael Kruger
* Michael Vegh
Expand All @@ -39,7 +39,6 @@ Contributing Institutions
* Embraer ([www.embraer.com](http://www.embraer.com))
* Intelligent Automation Inc. ([www.i-a-i.com](http://www.i-a-i.com))
* NASA ([www.nasa.gov](http://www.nasa.gov))
* Rand Corporation ([www.rand.org](http://www.rand.org))

Simple Setup
------------
Expand All @@ -56,7 +55,7 @@ More information available at [download](http://suave.stanford.edu/download/).
Requirements
------------

numpy, scipy, matplotlib, pip
numpy, scipy, matplotlib, pip, scikit-learn


Developer Install
Expand Down
13 changes: 0 additions & 13 deletions regression/scripts/SU2_surrogate/base_data.txt

This file was deleted.

48 changes: 31 additions & 17 deletions trunk/SUAVE/Components/Energy/Networks/Solar.py
Expand Up @@ -76,18 +76,7 @@ def evaluate_thrust(self,state):
propeller.inputs.omega = motor.outputs.omega
# step 6
F, Q, P, Cplast = propeller.spin(conditions)

# iterate the Cp here
diff = abs(Cplast-motor.propeller_Cp)
tol = 1e-6
while (np.any(diff>tol)):
motor.propeller_Cp = Cplast # Change the Cp
motor.omega(conditions) # Rerun the motor
propeller.inputs.omega = motor.outputs.omega # Relink the motor
F, Q, P, Cplast = propeller.spin(conditions) # Run the motor again
diff = abs(Cplast-motor.propeller_Cp) # Check to see if it converged



# Check to see if magic thrust is needed, the ESC caps throttle at 1.1 already
eta = conditions.propulsion.throttle[:,0,None]
P[eta>1.0] = P[eta>1.0]*eta[eta>1.0]
Expand Down Expand Up @@ -125,11 +114,13 @@ def evaluate_thrust(self,state):
battery_draw = battery.inputs.power_in
battery_energy = battery.current_energy

conditions.propulsion.solar_flux = solar_flux.outputs.flux
conditions.propulsion.rpm = rpm
conditions.propulsion.current = current
conditions.propulsion.battery_draw = battery_draw
conditions.propulsion.battery_energy = battery_energy
conditions.propulsion.solar_flux = solar_flux.outputs.flux
conditions.propulsion.rpm = rpm
conditions.propulsion.current = current
conditions.propulsion.battery_draw = battery_draw
conditions.propulsion.battery_energy = battery_energy
conditions.propulsion.motor_torque = motor.outputs.torque
conditions.propulsion.propeller_torque = Q

#Create the outputs
F = self.number_of_engines * F * [1,0,0]
Expand All @@ -140,5 +131,28 @@ def evaluate_thrust(self,state):
results.vehicle_mass_rate = mdot

return results


def unpack_unknowns(self,segment,state):
""""""

# Here we are going to unpack the unknowns (Cp) provided for this network
state.conditions.propulsion.propeller_power_coefficient = state.unknowns.propeller_power_coefficient

return

def residuals(self,segment,state):
""""""

# Here we are going to pack the residuals from the network

# Unpack
q_motor = state.conditions.propulsion.motor_torque
q_prop = state.conditions.propulsion.propeller_torque

# Return the residuals
state.residuals.network[:,0] = q_motor[:,0] - q_prop[:,0]

return

__call__ = evaluate_thrust
51 changes: 0 additions & 51 deletions trunk/SUAVE/Components/Landing_Gear/Landing_Gear.py

This file was deleted.

41 changes: 0 additions & 41 deletions trunk/SUAVE/Components/Landing_Gear/Main_Landing_Gear.py

This file was deleted.

40 changes: 0 additions & 40 deletions trunk/SUAVE/Components/Landing_Gear/Nose_Landing_Gear.py

This file was deleted.

6 changes: 0 additions & 6 deletions trunk/SUAVE/Input_Output/OpenVSP/write_vsp_mesh.py
Expand Up @@ -67,8 +67,6 @@ def write_vsp_mesh(geometry,tag,half_mesh_flag,growth_ratio,growth_limiting_flag
min_len = MAC/50.
vsp.SetCFDMeshVal(vsp.CFD_MAX_EDGE_LEN,min_len)



# vsp.AddDefaultSources()
SetSources(geometry)

Expand Down Expand Up @@ -229,7 +227,6 @@ def SetSources(geometry):
#pass


pass

def AddSegmentSources(comp,cr,ct,ii,u_start,num_secs,custom_flag,wingtip_flag,seg):
if custom_flag == True:
Expand Down Expand Up @@ -269,8 +266,5 @@ def AddSegmentSources(comp,cr,ct,ii,u_start,num_secs,custom_flag,wingtip_flag,se
rad1 = 0.2 * ct
vsp.AddCFDSource(vsp.LINE_SOURCE,comp,0,len1,rad1,uloc1,wloc1,len2,rad2,uloc2,wloc2)


if __name__ == '__main__':

tag = '/home/tim/Documents/SUAVE/scripts/experimental/SU2_link/cruise'
write_vsp_mesh(tag,True)
2 changes: 0 additions & 2 deletions trunk/SUAVE/Input_Output/VSP/__init__.py

This file was deleted.

0 comments on commit bdcac1e

Please sign in to comment.