Skip to content

Commit

Permalink
weight analyses cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
planes committed Apr 13, 2020
1 parent ef356f1 commit f600931
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 398 deletions.
43 changes: 28 additions & 15 deletions trunk/SUAVE/Analyses/Weights/Weights.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
## @ingroup Analyses-Weights
# Weights.py
#
# Created: Apr 2017, Matthew Clarke
# Created: Apr 2017, Matthew Clarke
# Modified: Apr 2020, E. Botero

# ----------------------------------------------------------------------
# Imports
# ----------------------------------------------------------------------

import SUAVE
from SUAVE.Core import Data
from SUAVE.Analyses import Analysis



# ----------------------------------------------------------------------
# Analysis
# ----------------------------------------------------------------------
Expand Down Expand Up @@ -59,9 +57,11 @@ def __defaults__(self):

self.vehicle = Data()
self.settings = Data()

self.settings.empty = None


def evaluate(self):
def evaluate(self,conditions=None):
"""Evaluate the weight analysis.
Assumptions:
Expand All @@ -74,33 +74,46 @@ def evaluate(self):
None
Outputs:
None
results
Properties Used:
N/A
"""
# unpack
vehicle = self.vehicle
settings = self.settings
empty = self.settings.empty

# evaluate
results = empty(vehicle,settings)

return
# storing weigth breakdown into vehicle
vehicle.weight_breakdown = results

# updating empty weight
vehicle.mass_properties.operating_empty = results.empty

return results


def finalize(self):
"""Finalize the weight analysis.
Assumptions:
None
Source:
N/A
Inputs:
None
Outputs:
None
Properties Used:
N/A
"""
"""
self.mass_properties = self.vehicle.mass_properties

return


return
65 changes: 3 additions & 62 deletions trunk/SUAVE/Analyses/Weights/Weights_BWB.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
## @ingroup Analyses-Weights
# Weights_BWB.py
#
# Created: Apr 2017, Matthew Clarke
# Created: Apr 2017, Matthew Clarke
# Modified: Apr 2020, E. Botero

# ----------------------------------------------------------------------
# Imports
# ----------------------------------------------------------------------

import SUAVE
from SUAVE.Core import Data
from .Weights import Weights


# ----------------------------------------------------------------------
# Analysis
# ----------------------------------------------------------------------
Expand Down Expand Up @@ -58,62 +57,4 @@ def __defaults__(self):
self.vehicle = Data()
self.settings = Data()


def evaluate(self,conditions=None):
"""Evaluate the weight analysis.
Assumptions:
None
Source:
N/A
Inputs:
None
Outputs:
results
Properties Used:
N/A
"""
# unpack
vehicle = self.vehicle
empty = SUAVE.Methods.Weights.Correlations.BWB.empty


# evaluate
results = empty(vehicle)

# storing weigth breakdown into vehicle
vehicle.weight_breakdown = results

# updating empty weight
vehicle.mass_properties.operating_empty = results.empty

# done!
return results


def finalize(self):
"""Finalize the weight analysis.
Assumptions:
None
Source:
N/A
Inputs:
None
Outputs:
None
Properties Used:
N/A
"""
self.mass_properties = self.vehicle.mass_properties

return

self.settings.empty = SUAVE.Methods.Weights.Correlations.BWB.empty
71 changes: 5 additions & 66 deletions trunk/SUAVE/Analyses/Weights/Weights_Electric_Lift_Cruise.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

# Weights_Electric_Lift_Cruise.py
#
# Created: Aug, 2017, J. Smart
# Modified: Apr, 2018, J. Smart
# Created: Aug 2017, J. Smart
# Modified: Apr 2018, J. Smart
# Apr 2020, E. Botero

# ----------------------------------------------------------------------
# Imports
Expand All @@ -13,7 +14,6 @@
from SUAVE.Core import Data
from .Weights import Weights


# ----------------------------------------------------------------------
# Analysis
# ----------------------------------------------------------------------
Expand All @@ -40,6 +40,7 @@ class Weights_Electric_Lift_Cruise(Weights):

def __defaults__(self):
"""Sets the default parameters for the weight analysis
Weight method to be used is default Electric Stopped Rotor method.
Assumptions:
None
Expand All @@ -62,66 +63,4 @@ def __defaults__(self):
self.vehicle = Data()
self.settings = Data()


def evaluate(self,conditions=None):
"""Uses the weight buildup method to estimate vehicle weight
Assumptions:
Analysis has been assigned a vehicle.
Weight method to be used is default Electric Stopped Rotor method.
Source:
N/A
Inputs:
Flight conditions, optionally
Outputs:
Weight breakdown of vehicle
Vehicle object modified so as to include weight breakdown and empty operating weight
Properties Used:
Analysis-assigned vehicle
"""

# unpack
vehicle = self.vehicle
empty = SUAVE.Methods.Weights.Buildups.Electric_Lift_Cruise.empty


# evaluate
results = empty(vehicle)

# storing weigth breakdown into vehicle
vehicle.weight_breakdown = results

# updating empty weight
vehicle.mass_properties.operating_empty = results.empty

# done!
return results


def finalize(self):
"""Finalizes the results of the analysis
Assumptions:
Vehicle has been assigned mass properties
Source:
N/A
Inputs:
Analysis-assigned vehicle
Outputs:
Analysis object assigned vehicle mass properties
Properties Used:
Analysis-assigned vehicle mass properties
"""

self.mass_properties = self.vehicle.mass_properties

return

self.settings.empty = SUAVE.Methods.Weights.Buildups.Electric_Lift_Cruise.empty
72 changes: 6 additions & 66 deletions trunk/SUAVE/Analyses/Weights/Weights_Electric_Multicopter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

# Weights_Electric_Multicopter.py
#
# Created: Mar 2017, J. Smart
# Modified Apr 2018, J. Smart
# Created: Mar 2017, J. Smart
# Modified: Apr 2018, J. Smart
# Apr 2020, E. Botero


# ----------------------------------------------------------------------
# Imports
Expand All @@ -13,7 +15,6 @@
from SUAVE.Core import Data
from .Weights import Weights


# ----------------------------------------------------------------------
# Analysis
# ----------------------------------------------------------------------
Expand All @@ -40,6 +41,7 @@ class Weights_Electric_Multicopter(Weights):

def __defaults__(self):
"""Sets the default parameters for the weight analysis
Weight method to be used is default Electric Multicopter method.
Assumptions:
None
Expand All @@ -62,66 +64,4 @@ def __defaults__(self):
self.vehicle = Data()
self.settings = Data()


def evaluate(self,conditions=None):
"""Uses the weight buildup method to estimate vehicle weight
Assumptions:
Analysis has been assigned a vehicle.
Weight method to be used is default Electric Multicopter method.
Source:
N/A
Inputs:
Flight conditions, optionally
Outputs:
Weight breakdown of vehicle
Vehicle object modified so as to include weight breakdown and empty operating weight
Properties Used:
Analysis-assigned vehicle
"""

# unpack
vehicle = self.vehicle
empty = SUAVE.Methods.Weights.Buildups.Electric_Multicopter.empty


# evaluate
results = empty(vehicle)

# storing weigth breakdown into vehicle
vehicle.weight_breakdown = results

# updating empty weight
vehicle.mass_properties.operating_empty = results.empty

# done!
return results


def finalize(self):
"""Finalizes the results of the analysis
Assumptions:
Vehicle has been assigned mass properties
Source:
N/A
Inputs:
Analysis-assigned vehicle
Outputs:
Analysis object assigned vehicle mass properties
Properties Used:
Analysis-assigned vehicle mass properties
"""

self.mass_properties = self.vehicle.mass_properties

return

self.settings.empty = SUAVE.Methods.Weights.Buildups.Electric_Multicopter.empty

0 comments on commit f600931

Please sign in to comment.