Skip to content

Feature general aviation weights#224

Merged
planes merged 23 commits intodevelopfrom
feature-general_aviation_weights
Feb 16, 2018
Merged

Feature general aviation weights#224
planes merged 23 commits intodevelopfrom
feature-general_aviation_weights

Conversation

@jmvegh
Copy link
Contributor

@jmvegh jmvegh commented Jan 5, 2018

added weights correlations for general aviation-type aircraft

jmvegh added 5 commits January 5, 2018 12:40
…ture-general_aviation_weights

Conflicts:
	trunk/SUAVE/Methods/Weights/Correlations/General_Aviation/__init__.py
	trunk/SUAVE/Methods/Weights/Correlations/General_Aviation/empty.py
	trunk/SUAVE/Methods/Weights/Correlations/General_Aviation/fuselage.py
	trunk/SUAVE/Methods/Weights/Correlations/General_Aviation/landing_gear.py
	trunk/SUAVE/Methods/Weights/Correlations/General_Aviation/payload.py
	trunk/SUAVE/Methods/Weights/Correlations/General_Aviation/systems.py
	trunk/SUAVE/Methods/Weights/Correlations/General_Aviation/tail_horizontal.py
	trunk/SUAVE/Methods/Weights/Correlations/General_Aviation/tail_vertical.py
	trunk/SUAVE/Methods/Weights/Correlations/General_Aviation/wing_main.py
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.8%) to 55.456% when pulling e4e71dc on feature-general_aviation_weights into e3cb920 on develop.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.6%) to 56.882% when pulling 6577170 on feature-general_aviation_weights into e3cb920 on develop.

Copy link
Member

@planes planes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good. See the comments I have. Should be quick fixes. Fix those and Tim will take a look as well.

num_pax = vehicle.passengers
wt_cargo = vehicle.mass_properties.cargo
num_seats = vehicle.fuselages['fuselage'].number_coach_seats
#ctrl_type = vehicle.systems.control
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either delete this or uncomment out.

V_fuel = m_fuel/fuel.density #total fuel
fuel.mass_properties.volume = V_fuel
S_gross_w = vehicle.reference_area
#S_gross_w = vehicle.wings['main_wing'].Areas.reference
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete this

avionics = vehicle.avionics
W_uav = avionics.mass_properties.uninstalled

has_air_conditioner = vehicle.has_air_conditioner
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is weird to have a key in the vehicle of has_air_conditioner

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

output.systems = output_2.wt_systems
output.systems_breakdown = Data()
output.systems_breakdown.control_systems = output_2.wt_flt_ctrl
#output.systems_breakdown.apu = output_2.wt_apu
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented out things.

vehicle.hydraulics = hydraulics
vehicle.landing_gear = landing_gear_component

#note; air conditioner optional, and weight is added to the air_conditioner object directly
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's okay to make it optional, just change the key dependence.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

## @ingroup Methods-Weights-Correlations-General_Aviation
def fuselage(S_fus, Nult, TOW, w_fus, h_fus, l_fus, l_ht, q_c, V_fuse, diff_p_fus):
"""
Calculate the weight of a fuselage for a GA aircraft
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a source, see above comment for ordering of comments.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think when possible we should start adding sources by page etc. These weight correlations are on page 590 in the fifth edition.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. I used the 4th edition though

from SUAVE.Core import Data,Units
import numpy as np


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this extra space

# Landing Gear
# ----------------------------------------------------------------------
## @ingroup Methods-Weights-Correlations-General_Aviation
def landing_gear(landing_weight, Nult, strut_length_main, strut_length_nose):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See earlier comment on ordering

wt_pax = wt_passenger * num_pax
wt_bag = wt_baggage * num_pax
wt_payload = wt_pax + wt_bag + wt_cargo
#wt_fuel = TOW - wt_payload - empty
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented out thing.

output.payload = wt_payload
output.pax = wt_pax
output.bag = wt_bag
#output.fuel = wt_fuel
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented out?

Copy link
Contributor

@timdmacdo timdmacdo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some more simple comments here

print 'Relative Errors'
print error

for k,v in error.items():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use 1e-6 unless there's a reason not to.

@@ -0,0 +1,20 @@
## @defgroup Methods-Weights-Correlations-General_Aviation Generational
# Provides structural and component weight correlations for general aviation aircraft
""" SUAVE.Methods.Weights.Correlations.General_Aviation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove these extra comments and add in @InGroup tag


# thrust_sls should be sea level static thrust. Using design thrust results in wrong propulsor
# weight estimation. Engine sizing should return this value.
# for now, using thrust_sls = design_thrust / 0.20, just for optimization evaluations
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment doesn't seem accurate?

avionics = vehicle.avionics
W_uav = avionics.mass_properties.uninstalled

has_air_conditioner = vehicle.has_air_conditioner
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

furnishings.mass_properties.mass = output.systems_breakdown.furnish
avionics.mass_properties.mass = output.systems_breakdown.avionics

#fuel.mass_properties.mass = output.fuel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra item

# packup outputs
output = Data()
output.wt_flt_ctrl = flt_ctrl_wt
#output.wt_apu = apu_wt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra item

Aircraft Design: A Conceptual Approach by Raymer
"""
# unpack inputs
W_0 = TOW / Units.lb # Convert kg to lbs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

table format

# unpack inputs
W_0 = TOW / Units.lb # Convert kg to lbs
S_vt = S_v/ Units.ft**2 # Convert from meters squared to ft squared
q = q_c /(Units.force_pound / Units.ft**2.)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

table format

W_0 = TOW / Units.lb # Convert kg to lbs
S_w = S_wing/ (Units.ft**2) # Convert from meters squared to ft squared
W_fw = m_fuel/Units.lbs #convert from kg to lbs
q = q_c /(Units.lbs/(Units.ft**2.))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

table format

@@ -0,0 +1,36 @@
# integrated_propulsion_general_aviation.py
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doxygen tags are missing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@coveralls
Copy link

Coverage Status

Coverage increased (+0.6%) to 56.875% when pulling 6478385 on feature-general_aviation_weights into e3cb920 on develop.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.6%) to 56.875% when pulling fed6b3e on feature-general_aviation_weights into d3473f7 on develop.

vehicle.has_air_conditioner = 0
vehicle.reference_area = 16.2 * Units.meter**2 # Wing gross area in square meters
vehicle.design_dynamics_pressure =( .5 *freestream0.density*(cruise_speed**2))[0][0]
vehicle.design_dynamic_pressure =( .5 *freestream0.density*(cruise_speed**2))[0][0]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be cruise_speed*cruise_speed?

@coveralls
Copy link

coveralls commented Jan 19, 2018

Coverage Status

Coverage increased (+0.6%) to 57.52% when pulling 26a8e0c on feature-general_aviation_weights into 6955476 on develop.

fuselage.mass_properties.volume = .4*fuselage.lengths.total*(np.pi/4.)*(fuselage.heights.maximum**2.) #try this as approximation
fuselage.internal_volume = .3*fuselage.lengths.total*(np.pi/4.)*(fuselage.heights.maximum**2.)
fuselage.areas.wetted = fuselage.lengths.total*(np.pi/4.)*(fuselage.heights.maximum **2)
fuselage.differential_pressure = 8*Units.psi # Maximum differential pressure
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make a float.

fuselage.differential_pressure = 8*Units.psi # Maximum differential pressure
fuselage.width = 40. * Units.inches # Width of the fuselage
fuselage.heights.maximum = 75. * Units.inches # Height of the fuselage
fuselage.lengths.total = (27+2./12.) * Units.feet # Length of the fuselage
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make a float

fuselage.width = 40. * Units.inches # Width of the fuselage
fuselage.heights.maximum = 75. * Units.inches # Height of the fuselage
fuselage.lengths.total = (27+2./12.) * Units.feet # Length of the fuselage
fuselage.lengths.empennage = 9 * Units.feet
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

float?

fuselage.lengths.total = (27+2./12.) * Units.feet # Length of the fuselage
fuselage.lengths.empennage = 9 * Units.feet
fuselage.lengths.structure = fuselage.lengths.total-fuselage.lengths.empennage
fuselage.lengths.cabin = 140 *Units.inches
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

float?

fuselage.lengths.structure = fuselage.lengths.total-fuselage.lengths.empennage
fuselage.lengths.cabin = 140 *Units.inches
fuselage.mass_properties.volume = .4*fuselage.lengths.total*(np.pi/4.)*(fuselage.heights.maximum**2.) #try this as approximation
fuselage.mass_properties.internal_volume = .3*fuselage.lengths.total*(np.pi/4.)*(fuselage.heights.maximum**2.)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

**2 or ()*()

Copy link
Contributor

@timdmacdo timdmacdo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple remaining small items

propulsors = SUAVE.Components.Propulsors.Propulsor() #use weights for the IC engine
propulsors.tag = 'internal_combustion'
propulsors.rated_power = 110 *Units.kW # engine correlation is really off
#propulsors.rated_power = 100 *Units.kW
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete this line. Also what's the issue with the engine correlation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't really match the weight breakdown from Roskam, which is where I got some detailed weight statements. There are a number of possible reasons why, one of which might be different ways of bookkeeping things

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay that's fine. If you could just write something like that in the comment I think it would be great.

## @ingroup Methods-Weights-Correlations-General_Aviation
def empty(vehicle):
""" output = SUAVE.Methods.Weights.Correlations.Tube_Wing.empty(engine,wing,aircraft,fuselage,horizontal,vertical)
This is for a standard Tube and Wing aircraft configuration.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This docstring needs to be updated.

## @ingroup Methods-Weights-Correlations-General_Aviation
def fuselage(S_fus, Nult, TOW, w_fus, h_fus, l_fus, l_ht, q_c, V_fuse, diff_p_fus):
"""
Calculate the weight of a fuselage for a GA aircraft
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think when possible we should start adding sources by page etc. These weight correlations are on page 590 in the fifth edition.

# ----------------------------------------------------------------------
## @ingroup Methods-Weights-Correlations-General_Aviation
def tail_horizontal(S_h, AR_h, sweep_h, q_c, taper_h, t_c_h,Nult,TOW):
""" weight = SUAVE.Methods.Weights.Correlations.Tube_Wing.tail_horizontal(b_h,sweep_h,Nult,S_h,TOW,mac_w,mac_h,l_w2h,t_c_h)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update this docstring

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still lists Tube_Wing. I don't think this is accurate?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird. It looks like git might be having some issues but I repushed it

# payload.py
#
# Created: Jan 2014, A. Wendorff
# Modified: Feb 2014, A. Wendorff
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this up to date?

l_fus = l_fuselage / Units.ft # Convert meters to ft
b_wing = span/Units.ft


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of white space that can be cleaned up here

"""
# unpack inputs


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

white space here

propulsors.number_of_engines = 1.
vehicle.append_component(propulsors)

#Build an dsize the turbofan to get sls sthrust
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What turbofan?

# Created: Feb 2017, M. Vegh (modified from data originally in cmalpha/cmalpha.py)
# Modified:

""" setup file for the Beech 99 aircraft, current values only used to test stability cmalpha
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beech 99 or C-172?

config.tag = 'landing'

config.wings['main_wing'].flaps_angle = 30. * Units.deg
config.wings['main_wing'].slats_angle = 25. * Units.deg
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cessnas don't have slats



# done!
return configs No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ask me about the C-172 Carlos and I made.

actual.systems = 101.412216023


#empty weight =1354 * Units.lbs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented out code

## @ingroup Methods-Weights-Correlations-General_Aviation
# empty.py
#
# Created: Jan 2014, A. Wendorff
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did andrew write this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. Just missed the author strings. Updated now

Inputs:
engine - a data dictionary with the fields:
thrust_sls - sea level static thrust of a single engine [Newtons]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove excess whitespace.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

t_c_h = vehicle.wings['horizontal_stabilizer'].thickness_to_chord
h_tail_exposed = vehicle.wings['horizontal_stabilizer'].areas.exposed / vehicle.wings['horizontal_stabilizer'].areas.wetted
l_w2h = vehicle.wings['horizontal_stabilizer'].origin[0] + vehicle.wings['horizontal_stabilizer'].aerodynamic_center[0] - vehicle.wings['main_wing'].origin[0] - vehicle.wings['main_wing'].aerodynamic_center[0] #Need to check this is the length of the horizontal tail moment arm
wt_tail_horizontal = tail_horizontal(S_h, AR_h, sweep_h, q_c, taper_h, t_c_h,Nult,TOW)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tabulation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

mac_h = vehicle.wings['horizontal_stabilizer'].chords.mean_aerodynamic
t_c_h = vehicle.wings['horizontal_stabilizer'].thickness_to_chord
h_tail_exposed = vehicle.wings['horizontal_stabilizer'].areas.exposed / vehicle.wings['horizontal_stabilizer'].areas.wetted
l_w2h = vehicle.wings['horizontal_stabilizer'].origin[0] + vehicle.wings['horizontal_stabilizer'].aerodynamic_center[0] - vehicle.wings['main_wing'].origin[0] - vehicle.wings['main_wing'].aerodynamic_center[0] #Need to check this is the length of the horizontal tail moment arm
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you still need to check this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope

t_tail = vehicle.wings['vertical_stabilizer'].t_tail
output_3 = tail_vertical(S_v, AR_v, sweep_v, q_c, taper_v, t_c_v, Nult,TOW,t_tail)
vehicle.wings['vertical_stabilizer'].mass_properties.mass = output_3.wt_tail_vertical

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

White space

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. I think

vehicle = SUAVE.Vehicle()
vehicle.tag = 'Cessna_172_SP'
GTOW = 2550. * Units.pounds
vehicle.mass_properties.max_takeoff = GTOW #from Wikipedia
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Take this comment from wikipedia out.

actual.fuel_systems = 15.6859717453
actual.systems = 108.096549345

error = Data()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Table format

Copy link
Member

@planes planes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@planes planes merged commit 24e5439 into develop Feb 16, 2018
@planes planes deleted the feature-general_aviation_weights branch February 17, 2018 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants