def __defaults__(self): """This sets the default values and methods for the analysis. Assumptions: None Source: N/A Inputs: None Outputs: None Properties Used: N/A """ self.tag = 'aerodynamics_markup' self.geometry = Data() self.settings = Data() self.process = Process() self.process.initialize = Process() self.process.compute = Process()
def __defaults__(self): """This sets the default values and methods for the analysis. Assumptions: None Source: N/A Inputs: None Outputs: None Properties Used: N/A """ self.tag = 'AVL_markup' # Correction factors settings = self.settings settings.trim_drag_correction_factor = 1.02 settings.wing_parasite_drag_form_factor = 1.1 settings.fuselage_parasite_drag_form_factor = 2.3 settings.oswald_efficiency_factor = None settings.viscous_lift_dependent_drag_factor = 0.38 settings.drag_coefficient_increment = 0.0000 settings.spoiler_drag_increment = 0.00 settings.maximum_lift_coefficient = np.inf # Build the evaluation process compute = self.process.compute compute.lift = Process() # Run AVL to determine lift compute.lift.inviscid = AVL_Inviscid() compute.lift.total = Common.Lift.aircraft_total # Do a traditional drag buildup compute.drag = Process() compute.drag.parasite = Process() compute.drag.parasite.wings = Process_Geometry('wings') compute.drag.parasite.wings.wing = Common.Drag.parasite_drag_wing compute.drag.parasite.fuselages = Process_Geometry('fuselages') compute.drag.parasite.fuselages.fuselage = Common.Drag.parasite_drag_fuselage compute.drag.parasite.propulsors = Process_Geometry('propulsors') compute.drag.parasite.propulsors.propulsor = Common.Drag.parasite_drag_propulsor compute.drag.parasite.pylons = Common.Drag.parasite_drag_pylon compute.drag.parasite.total = Common.Drag.parasite_total compute.drag.induced = Common.Drag.induced_drag_aircraft compute.drag.compressibility = Process() compute.drag.compressibility.wings = Process_Geometry('wings') compute.drag.compressibility.wings.wing = Common.Drag.compressibility_drag_wing compute.drag.compressibility.total = Common.Drag.compressibility_drag_wing_total compute.drag.miscellaneous = Common.Drag.miscellaneous_drag_aircraft_ESDU compute.drag.untrimmed = Common.Drag.untrimmed compute.drag.trim = Common.Drag.trim compute.drag.spoiler = Common.Drag.spoiler_drag compute.drag.total = Common.Drag.total_aircraft
class Markup(Aerodynamics): """ SUAVE.Analyses.Aerodynamics.Markup() """ def __defaults__(self): self.tag = 'aerodynamics_markup' self.geometry = Data() self.settings = Data() self.process = Process() self.process.initialize = Process() self.process.compute = Process() def evaluate(self, state): settings = self.settings geometry = self.geometry results = self.process.compute(state, settings, geometry) return results def initialize(self): self.process.initialize(self)
def __defaults__(self): """This sets the default values and methods for the analysis. Assumptions: None Source: N/A Inputs: None Outputs: None Properties Used: N/A """ self.tag = 'aerodynamics_markup' self.geometry = Data() self.settings.maximum_lift_coefficient_factor = 1.0 self.settings.lift_to_drag_adjustment = 0. # (.1 is a 10% increase in L/D over base analysis) # this is applied directly to the final drag value self.process = Process() self.process.initialize = Process() self.process.compute = Process()
class Markup(Aerodynamics): """ SUAVE.Analyses.Aerodynamics.Markup() """ def __defaults__(self): self.tag = 'aerodynamics_markup' self.geometry = Data() self.settings = Data() self.process = Process() self.process.initialize = Process() self.process.compute = Process() def evaluate(self,state): settings = self.settings geometry = self.geometry results = self.process.compute(state,settings,geometry) return results def initialize(self): self.process.initialize(self)
def __defaults__(self): # -------------------------------------------------------------- # State # -------------------------------------------------------------- # conditions self.state.conditions.update(Conditions.Basic()) # -------------------------------------------------------------- # The Solving Process # -------------------------------------------------------------- # -------------------------------------------------------------- # Initialize - before iteration # -------------------------------------------------------------- initialize = self.process.initialize initialize.clear() initialize.expand_state = Methods.expand_state initialize.differentials = Methods.Common.Numerics.initialize_differentials_dimensionless initialize.conditions = None # -------------------------------------------------------------- # Converge - starts iteration # -------------------------------------------------------------- converge = self.process.converge converge.clear() converge.converge_root = Methods.converge_root # -------------------------------------------------------------- # Iterate - this is iterated # -------------------------------------------------------------- iterate = self.process.iterate iterate.clear() # Update Initials iterate.initials = Process() iterate.initials.time = Methods.Common.Frames.initialize_time # Unpack Unknowns iterate.unpack_unknowns = None # Update Conditions iterate.conditions = Process() iterate.conditions.differentials = Methods.Common.Numerics.update_differentials_time # Solve Residuals iterate.residuals = Process() # -------------------------------------------------------------- # Finalize - after iteration # -------------------------------------------------------------- finalize = self.process.finalize finalize.clear() finalize.post_process = Process() return
def __defaults__(self): """This sets the default values and methods for the analysis. Assumptions: None Source: N/A Inputs: None Outputs: None Properties Used: N/A """ self.tag = 'AERODAS Model' settings = self.settings settings.section_zero_lift_angle_of_attack = 0.0 * Units.deg settings.section_minimum_drag_coefficient_angle_of_attack = 0.0 * Units.deg settings.section_lift_curve_slope = 2.0 * np.pi # build the evaluation process compute = self.process.compute compute.setup_data = Methods.AERODAS_setup.setup_data # Get all of the coefficients for AERODAS wings compute.wings_coefficients = Process() compute.wings_coefficients = Process_Geometry('wings') compute.wings_coefficients.section_properties = Methods.section_properties.section_properties compute.wings_coefficients.finite_aspect_ratio = Methods.finite_aspect_ratio.finite_aspect_ratio compute.wings_coefficients.pre_stall = Methods.pre_stall_coefficients.pre_stall_coefficients compute.wings_coefficients.post_stall = Methods.post_stall_coefficients.post_stall_coefficients # Fuselage drag? # do a plate build up with angles # Miscellaneous drag? # Compressibility corrections? compute.lift_drag_total = Methods.AERODAS_setup.lift_drag_total compute.lift = Process() compute.lift.total = Common.Lift.aircraft_total compute.drag = Process() compute.drag.total = Methods.AERODAS_setup.drag_total def initialize(self): super(AERODAS, self).initialize() self.process.compute.lift.inviscid_wings.geometry = self.geometry self.process.compute.lift.inviscid_wings.initialize() finalize = initialize
def __defaults__(self): self.tag = 'aerodynamics_markup' self.geometry = Data() self.settings = Data() self.process = Process() self.process.initialize = Process() self.process.compute = Process()
class Container(Segment): def __defaults__(self): self.segments = Process() self.state = State.Container() def append_segment(self, segment): """ Add a SubSegment """ self.segments.append(segment) return
class Container(Segment): """ A container for the segment Assumptions: None Source: None """ def __defaults__(self): """This sets the default values. Assumptions: None Source: N/A Inputs: None Outputs: None Properties Used: None """ self.segments = Process() self.state = State.Container() def append_segment(self,segment): """ Add a SubSegment Assumptions: None Source: N/A Inputs: segment [Segment()] Outputs: None Properties Used: None """ self.segments.append(segment) return
class Container(Segment): def __defaults__(self): self.segments = Process() self.state = State.Container() def append_segment(self,segment): """ Add a SubSegment """ self.segments.append(segment) return
def __defaults__(self): self.tag = 'SU2_Euler_markup' # Correction factors settings = self.settings settings.trim_drag_correction_factor = 1.02 settings.wing_parasite_drag_form_factor = 1.1 settings.fuselage_parasite_drag_form_factor = 2.3 settings.oswald_efficiency_factor = None settings.viscous_lift_dependent_drag_factor = 0.38 settings.drag_coefficient_increment = 0.0000 settings.spoiler_drag_increment = 0.00 settings.maximum_lift_coefficient = np.inf settings.half_mesh_flag = True settings.parallel = False settings.processors = 1 settings.vsp_mesh_growth_ratio = 1.3 settings.vsp_mesh_growth_limiting_flag = False # Build the evaluation process compute = self.process.compute compute.lift = Process() # Run SU2 to determine lift compute.lift.inviscid = SU2_inviscid() compute.lift.total = SUAVE.Methods.Aerodynamics.AERODAS.AERODAS_setup.lift_total # Do a traditional drag buildup compute.drag = Process() compute.drag.parasite = Process() compute.drag.parasite.wings = Process_Geometry('wings') compute.drag.parasite.wings.wing = Methods.Drag.parasite_drag_wing compute.drag.parasite.fuselages = Process_Geometry('fuselages') compute.drag.parasite.fuselages.fuselage = Methods.Drag.parasite_drag_fuselage compute.drag.parasite.propulsors = Process_Geometry('propulsors') compute.drag.parasite.propulsors.propulsor = Methods.Drag.parasite_drag_propulsor compute.drag.parasite.pylons = Methods.Drag.parasite_drag_pylon compute.drag.parasite.total = Methods.Drag.parasite_total compute.drag.induced = Methods.Drag.induced_drag_aircraft compute.drag.compressibility = Process() compute.drag.compressibility.wings = Process_Geometry('wings') compute.drag.compressibility.wings.wing = Methods.Drag.compressibility_drag_wing compute.drag.compressibility.total = Methods.Drag.compressibility_drag_wing_total compute.drag.miscellaneous = Methods.Drag.miscellaneous_drag_aircraft_ESDU compute.drag.untrimmed = SUAVE.Methods.Aerodynamics.SU2_Euler.untrimmed compute.drag.trim = Methods.Drag.trim compute.drag.spoiler = Methods.Drag.spoiler_drag compute.drag.total = SUAVE.Methods.Aerodynamics.SU2_Euler.total_aircraft_drag
def evaluate(self,state,settings,geometry): """Evaluates preset processes for each component. Assumptions: None Source: N/A Inputs: state (passed to an evaluation function) setting (passed to an evaluation function) geometry (used to get keys and passed to an evaluation function) Outputs: None Properties Used: self.geometry_key <string> """ geometry_items = geometry.deep_get(self.geometry_key) results = Data() for key, this_geometry in geometry_items.items(): result = Process.evaluate(self,state,settings,this_geometry) results[key] = result return results
def __defaults__(self): """This sets the default values and methods for the analysis. Assumptions: None Source: N/A Inputs: None Outputs: None Properties Used: N/A """ self.tag = 'aerodynamics_markup' self.geometry = Data() self.settings.lift_to_drag_adjustment = 0. # (.1 is a 10% increase in L/D over base analysis) # this is applied directly to the final drag value self.process = Process() self.process.initialize = Process() self.process.compute = Process()
def evaluate(self, state, settings, geometry): """Evaluates preset processes for each component. Assumptions: None Source: N/A Inputs: state (passed to an evaluation function) setting (passed to an evaluation function) geometry (used to get keys and passed to an evaluation function) Outputs: None Properties Used: self.geometry_key <string> """ geometry_items = geometry.deep_get(self.geometry_key) results = Results() for key, this_geometry in geometry_items.items(): result = Process.evaluate(self, state, settings, this_geometry) results[key] = result return results
def __defaults__(self): """This sets the default values. Assumptions: None Source: N/A Inputs: None Outputs: None Properties Used: None """ self.vehicle_configurations = SUAVE.Components.Configs.Config.Container() self.analyses = SUAVE.Analyses.Analysis.Container() self.missions = None self.procedure = Process() self.results = Data() self.summary = Data() self.optimization_problem = None self.fidelity_level = 1 self.last_inputs = None self.last_fidelity = None self.evaluation_count = 0 self.force_evaluate = False
def __defaults__(self): self.tag = 'Fidelity_Zero_Supersonic' # correction factors settings = self.settings settings.fuselage_lift_correction = 1.14 settings.trim_drag_correction_factor = 1.02 settings.wing_parasite_drag_form_factor = 1.1 settings.fuselage_parasite_drag_form_factor = 2.3 settings.aircraft_span_efficiency_factor = 0.78 settings.viscous_lift_dependent_drag_factor = 0.38 settings.drag_coefficient_increment = 0.0000 settings.oswald_efficiency_factor = None settings.maximum_lift_coefficient = np.inf # vortex lattice configurations settings.number_panels_spanwise = 5 settings.number_panels_chordwise = 1 # build the evaluation process compute = self.process.compute compute.lift = Process() compute.lift.inviscid_wings = Vortex_Lattice() compute.lift.vortex = Methods.Lift.vortex_lift # SZ compute.lift.compressible_wings = Methods.Lift.wing_compressibility # SZ compute.lift.fuselage = Methods.Lift.fuselage_correction # difference in results storage compute.lift.total = Methods.Lift.aircraft_total # no difference compute.drag = Process() compute.drag.compressibility = Process() compute.drag.compressibility.total = Methods.Drag.compressibility_drag_total # SZ compute.drag.parasite = Process() compute.drag.parasite.wings = Process_Geometry('wings') compute.drag.parasite.wings.wing = Methods.Drag.parasite_drag_wing # SZ compute.drag.parasite.fuselages = Process_Geometry('fuselages') compute.drag.parasite.fuselages.fuselage = Methods.Drag.parasite_drag_fuselage # SZ compute.drag.parasite.propulsors = Process_Geometry('propulsors') compute.drag.parasite.propulsors.propulsor = Methods.Drag.parasite_drag_propulsor # SZ #compute.drag.parasite.pylons = Methods.Drag.parasite_drag_pylon compute.drag.parasite.total = Methods.Drag.parasite_total # SZ compute.drag.induced = Methods.Drag.induced_drag_aircraft # SZ compute.drag.miscellaneous = Methods.Drag.miscellaneous_drag_aircraft # different type used in FZ compute.drag.untrimmed = Methods.Drag.untrimmed # SZ can be changed to match compute.drag.trim = Methods.Drag.trim # SZ can be chanaged to match compute.drag.total = Methods.Drag.total_aircraft # SZ
def __defaults__(self): self.settings = Settings() self.state = State() self.analyses = Analysis.Container() self.process = Process() self.process.initialize = Process() self.process.converge = Process() self.process.iterate = Process() self.process.iterate.unknowns = Process() self.process.iterate.initials = Process() self.process.iterate.conditions = Process() self.process.iterate.residuals = Process() self.process.finalize = Process() return
def __defaults__(self): self.vehicle_configurations = SUAVE.Components.Configs.Config.Container() self.analyses = SUAVE.Analyses.Analysis.Container() self.missions = None self.procedure = Process() self.results = SUAVE.Analyses.Results() self.summary = Data() self.optimization_problem = None self.last_inputs = None self.evaluation_count = 0
def evaluate(self, state, settings, geometry): geometry_items = geometry.deep_get(self.geometry_key) results = Results() for key, this_geometry in geometry_items.items(): result = Process.evaluate(self, state, settings, this_geometry) results[key] = result return results
def __defaults__(self): self.settings = Settings() self.state = State() self.analyses = Analysis.Container() self.process = Process() self.process.initialize = Process() self.process.converge = Process() self.process.iterate = Process() self.process.finalize = Process()
def __defaults__(self): """This sets the default values. Assumptions: None Source: N/A Inputs: None Outputs: None Properties Used: None """ self.segments = Process() self.state = State.Container()
def __defaults__(self): self.tag = 'AERODAS Model' settings = self.settings settings.section_zero_lift_angle_of_attack = 0.0 * Units.deg settings.section_lift_curve_slope = 2.0 * np.pi # build the evaluation process compute = self.process.compute compute.setup_data = Methods.AERODAS_setup.setup_data # Get all of the coefficients for AERODAS wings compute.wings_coefficients = Process() compute.wings_coefficients = Process_Geometry('wings') compute.wings_coefficients.section_properties = Methods.section_properties.section_properties compute.wings_coefficients.finite_aspect_ratio = Methods.finite_aspect_ratio.finite_aspect_ratio compute.wings_coefficients.pre_stall = Methods.pre_stall_coefficients.pre_stall_coefficients compute.wings_coefficients.post_stall = Methods.post_stall_coefficients.post_stall_coefficients # Fuselage drag? # do a plate build up with angles # Miscellaneous drag? # Compressibility corrections? compute.lift_drag_total = Methods.AERODAS_setup.lift_drag_total compute.lift = Process() compute.lift.total = Methods.AERODAS_setup.lift_total compute.drag = Process() compute.drag.total = Methods.AERODAS_setup.drag_total def initialize(self): self.process.compute.lift.inviscid_wings.geometry = self.geometry self.process.compute.lift.inviscid_wings.initialize() finalize = initialize
def evaluate(self,state,settings,geometry): geometry_items = geometry.deep_get(self.geometry_key) results = Results() for key, this_geometry in geometry_items.items(): result = Process.evaluate(self,state,settings,this_geometry) results[key] = result return results
class Segment(Analysis): def __defaults__(self): self.settings = Settings() self.state = State() self.analyses = Analysis.Container() self.process = Process() self.process.initialize = Process() self.process.converge = Process() self.process.iterate = Process() self.process.iterate.unknowns = Process() self.process.iterate.initials = Process() self.process.iterate.conditions = Process() self.process.iterate.residuals = Process() self.process.finalize = Process() self.process.finalize.post_process = Process() return def initialize(self, state): self.process.initialize(self, state) return def converge(self, state): self.process.converge(self, state) def iterate(self, state): self.process.iterate(self, state) return def finalize(self, state): self.process.finalize(self, state) return def compile(self): return def evaluate(self, state=None): if state is None: state = self.state self.process(self, state) return state
class Segment(Analysis): def __defaults__(self): self.settings = Settings() self.state = State() self.analyses = Analysis.Container() self.process = Process() self.process.initialize = Process() self.process.converge = Process() self.process.iterate = Process() self.process.iterate.initials = Process() self.process.iterate.conditions = Process() self.process.finalize = Process() def initialize(self,state): self.process.initialize(self,state) return def converge(self,state): self.process.converge(self,state) def iterate(self,state): self.process.iterate(self,state) return def finalize(self,state): self.process.finalize(self,state) return def compile(self): return def evaluate(self,state=None): if state is None: state = deepcopy(self.state) self.process(self,state) return state
def __defaults__(self): """This sets the default values. Assumptions: None Source: N/A Inputs: None Outputs: None Properties Used: None """ self.settings = Settings() self.state = State() self.analyses = Analysis.Container() self.process = Process() self.process.initialize = Process() self.process.converge = Process() self.process.iterate = Process() self.process.iterate.unknowns = Process() self.process.iterate.initials = Process() self.process.iterate.conditions = Process() self.process.iterate.residuals = Process() self.process.finalize = Process() self.process.finalize.post_process = Process() self.conditions = self.state.conditions return
class Markup(Aerodynamics): """This is an intermediate class for aerodynamic analyses. Assumptions: None Source: N/A """ def __defaults__(self): """This sets the default values and methods for the analysis. Assumptions: None Source: N/A Inputs: None Outputs: None Properties Used: N/A """ self.tag = 'aerodynamics_markup' self.geometry = Data() self.settings = Data() self.process = Process() self.process.initialize = Process() self.process.compute = Process() def evaluate(self,state): """The default evaluate function. Assumptions: None Source: N/A Inputs: None Outputs: results <SUAVE data class> Properties Used: self.settings self.geometry """ settings = self.settings geometry = self.geometry results = self.process.compute(state,settings,geometry) return results def initialize(self): """The default finalize function. Calls the initialize process. Assumptions: None Source: N/A Inputs: None Outputs: None Properties Used: N/A """ self.process.initialize(self)
class Segment(Analysis): """ The first basic piece of a mission which each segment will expand upon Assumptions: There's a detailed process flow outline in defaults. A mission must be solved in that order. Source: None """ def __defaults__(self): """This sets the default values. Assumptions: None Source: N/A Inputs: None Outputs: None Properties Used: None """ self.settings = Settings() self.state = State() self.analyses = Analysis.Container() self.process = Process() self.process.initialize = Process() self.process.converge = Process() self.process.iterate = Process() self.process.iterate.unknowns = Process() self.process.iterate.initials = Process() self.process.iterate.conditions = Process() self.process.iterate.residuals = Process() self.process.finalize = Process() self.process.finalize.post_process = Process() self.conditions = self.state.conditions return def initialize(self): """ This executes the initialize process Assumptions: None Source: N/A Inputs: State [Data()] Outputs: None Properties Used: None """ state = self.state self.process.initialize(self) return def converge(self,state): """ This executes the converge process Assumptions: None Source: N/A Inputs: State [Data()] Outputs: None Properties Used: None """ self.process.converge(self,state) def iterate(self): """ This executes the iterate process Assumptions: None Source: N/A Inputs: State [Data()] Outputs: None Properties Used: None """ self.process.iterate(self) return def finalize(self): """ This executes the finalize process Assumptions: None Source: N/A Inputs: State [Data()] Outputs: None Properties Used: None """ self.process.finalize(self) return def compile(self): """ This does nothing Assumptions: None Source: N/A Inputs: State [Data()] Outputs: None Properties Used: None """ return def evaluate(self,state=None): """ This executes the entire process Assumptions: None Source: N/A Inputs: State [Data()] Outputs: State [Data()] Properties Used: None """ if state is None: state = self.state self.process(self) return self def merged(self): """ Combines the states of multiple segments Assumptions: None Source: N/A Inputs: None Outputs: state_out [State()] Properties Used: None """ state_out = State() for i,(tag,sub_seg) in enumerate(self.segments.items()): sub_state = sub_seg.state for key in ['unknowns','conditions','residuals']: if i == 0: state_out[key].update(sub_state[key]) else: state_out[key] = state_out[key].do_recursive(append_array,sub_state[key]) return state_out
class Markup(Aerodynamics): """This is an intermediate class for aerodynamic analyses. Assumptions: None Source: N/A """ def __defaults__(self): """This sets the default values and methods for the analysis. Assumptions: None Source: N/A Inputs: None Outputs: None Properties Used: N/A """ self.tag = 'aerodynamics_markup' self.geometry = Data() self.settings.lift_to_drag_adjustment = 0. # (.1 is a 10% increase in L/D over base analysis) # this is applied directly to the final drag value self.process = Process() self.process.initialize = Process() self.process.compute = Process() def evaluate(self,state): """The default evaluate function. Assumptions: None Source: N/A Inputs: None Outputs: results <SUAVE data class> Properties Used: self.settings self.geometry """ settings = self.settings geometry = self.geometry results = self.process.compute(state,settings,geometry) return results def initialize(self): """The default finalize function. Calls the initialize process. Assumptions: None Source: N/A Inputs: None Outputs: None Properties Used: N/A """ self.process.initialize(self)
def __defaults__(self): self.tag = 'fidelity_zero_markup' ## available from Markup #self.geometry = Data() #self.settings = Data() #self.process = Process() #self.process.initialize = Process() #self.process.compute = Process() # correction factors settings = self.settings settings.fuselage_lift_correction = 1.14 settings.trim_drag_correction_factor = 1.02 settings.wing_parasite_drag_form_factor = 1.1 settings.fuselage_parasite_drag_form_factor = 2.3 settings.oswald_efficiency_factor = None settings.viscous_lift_dependent_drag_factor = 0.38 settings.drag_coefficient_increment = 0.0000 settings.spoiler_drag_increment = 0.00 settings.maximum_lift_coefficient = np.inf # vortex lattice configurations settings.number_panels_spanwise = 5 settings.number_panels_chordwise = 1 # build the evaluation process compute = self.process.compute # these methods have interface as # results = function(state,settings,geometry) # results are optional # first stub out empty functions # then implement methods # then we'll figure out how to connect to a mission compute.lift = Process() compute.lift.inviscid_wings = Vortex_Lattice() compute.lift.vortex = SUAVE.Methods.skip compute.lift.compressible_wings = Methods.Lift.wing_compressibility_correction compute.lift.fuselage = Methods.Lift.fuselage_correction compute.lift.total = Methods.Lift.aircraft_total compute.drag = Process() compute.drag.parasite = Process() compute.drag.parasite.wings = Process_Geometry('wings') compute.drag.parasite.wings.wing = Methods.Drag.parasite_drag_wing compute.drag.parasite.fuselages = Process_Geometry('fuselages') compute.drag.parasite.fuselages.fuselage = Methods.Drag.parasite_drag_fuselage compute.drag.parasite.propulsors = Process_Geometry('propulsors') compute.drag.parasite.propulsors.propulsor = Methods.Drag.parasite_drag_propulsor compute.drag.parasite.pylons = Methods.Drag.parasite_drag_pylon compute.drag.parasite.total = Methods.Drag.parasite_total compute.drag.induced = Methods.Drag.induced_drag_aircraft compute.drag.compressibility = Process() compute.drag.compressibility.wings = Process_Geometry('wings') compute.drag.compressibility.wings.wing = Methods.Drag.compressibility_drag_wing compute.drag.compressibility.total = Methods.Drag.compressibility_drag_wing_total compute.drag.miscellaneous = Methods.Drag.miscellaneous_drag_aircraft_ESDU compute.drag.untrimmed = Methods.Drag.untrimmed compute.drag.trim = Methods.Drag.trim compute.drag.spoiler = Methods.Drag.spoiler_drag compute.drag.total = Methods.Drag.total_aircraft
def __defaults__(self): """ This sets the default solver flow. Anything in here can be modified after initializing a segment. Assumptions: None Source: N/A Inputs: None Outputs: None Properties Used: None """ # -------------------------------------------------------------- # User inputs # -------------------------------------------------------------- self.altitude_start = None # Optional self.altitude_end = 10. * Units.km # -------------------------------------------------------------- # State # -------------------------------------------------------------- # conditions self.state.conditions.update(Conditions.Aerodynamics()) # initials and unknowns ones_row = self.state.ones_row self.state.unknowns.throttle = ones_row(1) * 0.5 self.state.unknowns.body_angle = ones_row(1) * 0.0 self.state.residuals.forces = ones_row(2) * 0.0 # -------------------------------------------------------------- # The Solving Process # -------------------------------------------------------------- # -------------------------------------------------------------- # Initialize - before iteration # -------------------------------------------------------------- initialize = self.process.initialize initialize.expand_state = Methods.expand_state initialize.differentials = Methods.Common.Numerics.initialize_differentials_dimensionless initialize.conditions = None initialize.differentials_altitude = Methods.Climb.Common.update_differentials_altitude # -------------------------------------------------------------- # Converge - starts iteration # -------------------------------------------------------------- converge = self.process.converge converge.converge_root = Methods.converge_root # -------------------------------------------------------------- # Iterate - this is iterated # -------------------------------------------------------------- iterate = self.process.iterate # Update Initials iterate.initials = Process() iterate.initials.time = Methods.Common.Frames.initialize_time iterate.initials.weights = Methods.Common.Weights.initialize_weights iterate.initials.inertial_position = Methods.Common.Frames.initialize_inertial_position iterate.initials.planet_position = Methods.Common.Frames.initialize_planet_position # Unpack Unknowns iterate.unknowns = Process() iterate.unknowns.mission = Methods.Climb.Common.unpack_unknowns # Update Conditions iterate.conditions = Process() iterate.conditions.differentials = Methods.Common.Numerics.update_differentials_time iterate.conditions.acceleration = Methods.Common.Frames.update_acceleration iterate.conditions.altitude = Methods.Common.Aerodynamics.update_altitude iterate.conditions.atmosphere = Methods.Common.Aerodynamics.update_atmosphere iterate.conditions.gravity = Methods.Common.Weights.update_gravity iterate.conditions.freestream = Methods.Common.Aerodynamics.update_freestream iterate.conditions.orientations = Methods.Common.Frames.update_orientations iterate.conditions.aerodynamics = Methods.Common.Aerodynamics.update_aerodynamics iterate.conditions.stability = Methods.Common.Aerodynamics.update_stability iterate.conditions.propulsion = Methods.Common.Energy.update_thrust iterate.conditions.weights = Methods.Common.Weights.update_weights iterate.conditions.forces = Methods.Common.Frames.update_forces iterate.conditions.planet_position = Methods.Common.Frames.update_planet_position # Solve Residuals iterate.residuals = Process() iterate.residuals.total_forces = Methods.Climb.Common.residual_total_forces # -------------------------------------------------------------- # Finalize - after iteration # -------------------------------------------------------------- finalize = self.process.finalize # Post Processing finalize.post_process = Process() finalize.post_process.inertial_position = Methods.Common.Frames.integrate_inertial_horizontal_position finalize.post_process.stability = Methods.Common.Aerodynamics.update_stability return
def __defaults__(self): """This sets the default values and methods for the analysis. Assumptions: None Source: N/A Inputs: None Outputs: None Properties Used: N/A """ self.tag = 'Fidelity_Zero_Supersonic' # correction factors settings = self.settings settings.fuselage_lift_correction = 1.14 settings.trim_drag_correction_factor = 1.02 settings.wing_parasite_drag_form_factor = 1.1 settings.fuselage_parasite_drag_form_factor = 2.3 settings.aircraft_span_efficiency_factor = 0.78 settings.viscous_lift_dependent_drag_factor = 0.38 settings.drag_coefficient_increment = 0.0000 settings.spoiler_drag_increment = 0.00 settings.oswald_efficiency_factor = None settings.maximum_lift_coefficient = np.inf # vortex lattice configurations settings.number_panels_spanwise = 5 settings.number_panels_chordwise = 1 # build the evaluation process compute = self.process.compute compute.lift = Process() compute.lift.inviscid_wings = Vortex_Lattice() compute.lift.vortex = Methods.Lift.vortex_lift # SZ compute.lift.compressible_wings = Methods.Lift.wing_compressibility # SZ compute.lift.fuselage = Common.Lift.fuselage_correction compute.lift.total = Common.Lift.aircraft_total compute.drag = Process() compute.drag.compressibility = Process() compute.drag.compressibility.total = Methods.Drag.compressibility_drag_total # SZ compute.drag.parasite = Process() compute.drag.parasite.wings = Process_Geometry('wings') compute.drag.parasite.wings.wing = Common.Drag.parasite_drag_wing compute.drag.parasite.fuselages = Process_Geometry('fuselages') compute.drag.parasite.fuselages.fuselage = Common.Drag.parasite_drag_fuselage compute.drag.parasite.propulsors = Process_Geometry('propulsors') compute.drag.parasite.propulsors.propulsor = Methods.Drag.parasite_drag_propulsor # SZ #compute.drag.parasite.pylons = Methods.Drag.parasite_drag_pylon compute.drag.parasite.total = Common.Drag.parasite_total compute.drag.induced = Methods.Drag.induced_drag_aircraft # SZ compute.drag.miscellaneous = Methods.Drag.miscellaneous_drag_aircraft # different type used in FZ compute.drag.untrimmed = Common.Drag.untrimmed compute.drag.trim = Common.Drag.trim compute.drag.spoiler = Common.Drag.spoiler_drag compute.drag.total = Common.Drag.total_aircraft # SZ
def __defaults__(self): """ This sets the default solver flow. Anything in here can be modified after initializing a segment. Assumptions: None Source: N/A Inputs: None Outputs: None Properties Used: None """ # -------------------------------------------------------------- # User inputs # -------------------------------------------------------------- self.altitude = None self.air_speed = 10. * Units['km/hr'] self.throttle = 1. self.z_accel = 0. # note that down is positive self.state.numerics.number_control_points = 1 # -------------------------------------------------------------- # State # -------------------------------------------------------------- # conditions self.state.conditions.update( Conditions.Aerodynamics() ) # initials and unknowns self.state.unknowns.x_accel = np.array([[0.0]]) self.state.unknowns.body_angle = np.array([[0.5]]) self.state.residuals.forces = np.array([[0.0,0.0]]) # -------------------------------------------------------------- # The Solving Process # -------------------------------------------------------------- # -------------------------------------------------------------- # Initialize - before iteration # -------------------------------------------------------------- initialize = self.process.initialize initialize.expand_state = skip initialize.differentials = skip initialize.conditions = Methods.Single_Point.Set_Speed_Set_Throttle.initialize_conditions # -------------------------------------------------------------- # Converge - starts iteration # -------------------------------------------------------------- converge = self.process.converge converge.converge_root = Methods.converge_root # -------------------------------------------------------------- # Iterate - this is iterated # -------------------------------------------------------------- iterate = self.process.iterate # Update Initials iterate.initials = Process() iterate.initials.time = Methods.Common.Frames.initialize_time iterate.initials.weights = Methods.Common.Weights.initialize_weights iterate.initials.inertial_position = Methods.Common.Frames.initialize_inertial_position iterate.initials.planet_position = Methods.Common.Frames.initialize_planet_position # Unpack Unknowns iterate.unknowns = Process() iterate.unknowns.mission = Methods.Single_Point.Set_Speed_Set_Throttle.unpack_unknowns # Update Conditions iterate.conditions = Process() iterate.conditions.differentials = skip iterate.conditions.altitude = Methods.Common.Aerodynamics.update_altitude iterate.conditions.atmosphere = Methods.Common.Aerodynamics.update_atmosphere iterate.conditions.gravity = Methods.Common.Weights.update_gravity iterate.conditions.freestream = Methods.Common.Aerodynamics.update_freestream iterate.conditions.orientations = Methods.Common.Frames.update_orientations iterate.conditions.propulsion = Methods.Common.Energy.update_thrust iterate.conditions.aerodynamics = Methods.Common.Aerodynamics.update_aerodynamics iterate.conditions.stability = Methods.Common.Aerodynamics.update_stability iterate.conditions.weights = Methods.Single_Point.Set_Speed_Set_Throttle.update_weights iterate.conditions.forces = Methods.Common.Frames.update_forces iterate.conditions.planet_position = skip # Solve Residuals iterate.residuals = Process() iterate.residuals.total_forces = Methods.Climb.Common.residual_total_forces # -------------------------------------------------------------- # Finalize - after iteration # -------------------------------------------------------------- finalize = self.process.finalize # Post Processing finalize.post_process = Process() finalize.post_process.inertial_position = skip finalize.post_process.stability = Methods.Common.Aerodynamics.update_stability return
class Markup(Aerodynamics): """This is an intermediate class for aerodynamic analyses. Assumptions: None Source: N/A """ def __defaults__(self): """This sets the default values and methods for the analysis. Assumptions: None Source: N/A Inputs: None Outputs: None Properties Used: N/A """ self.tag = 'aerodynamics_markup' self.geometry = Data() self.settings = Data() self.process = Process() self.process.initialize = Process() self.process.compute = Process() def evaluate(self, state): """The default evaluate function. Assumptions: None Source: N/A Inputs: None Outputs: results <SUAVE data class> Properties Used: self.settings self.geometry """ settings = self.settings geometry = self.geometry results = self.process.compute(state, settings, geometry) return results def initialize(self): """The default finalize function. Calls the initialize process. Assumptions: None Source: N/A Inputs: None Outputs: None Properties Used: N/A """ self.process.initialize(self)
class Segment(Analysis): """ The first basic piece of a mission which each segment will expand upon Assumptions: There's a detailed process flow outline in defaults. A mission must be solved in that order. Source: None """ def __defaults__(self): """This sets the default values. Assumptions: None Source: N/A Inputs: None Outputs: None Properties Used: None """ self.settings = Settings() self.state = State() self.analyses = Analysis.Container() self.process = Process() self.process.initialize = Process() self.process.converge = Process() self.process.iterate = Process() self.process.iterate.unknowns = Process() self.process.iterate.initials = Process() self.process.iterate.conditions = Process() self.process.iterate.residuals = Process() self.process.finalize = Process() self.process.finalize.post_process = Process() self.conditions = self.state.conditions return def initialize(self): """ This executes the initialize process Assumptions: None Source: N/A Inputs: State [Data()] Outputs: None Properties Used: None """ state = self.state self.process.initialize(self) return def converge(self, state): """ This executes the converge process Assumptions: None Source: N/A Inputs: State [Data()] Outputs: None Properties Used: None """ self.process.converge(self, state) def iterate(self): """ This executes the iterate process Assumptions: None Source: N/A Inputs: State [Data()] Outputs: None Properties Used: None """ self.process.iterate(self) return def finalize(self): """ This executes the finalize process Assumptions: None Source: N/A Inputs: State [Data()] Outputs: None Properties Used: None """ self.process.finalize(self) return def evaluate(self, state=None): """ This executes the entire process Assumptions: None Source: N/A Inputs: State [Data()] Outputs: State [Data()] Properties Used: None """ if state is None: state = self.state self.process(self) return self def merged(self): """ Combines the states of multiple segments Assumptions: None Source: N/A Inputs: None Outputs: state_out [State()] Properties Used: None """ state_out = State() for i, (tag, sub_seg) in enumerate(self.segments.items()): sub_state = sub_seg.state for key in ['unknowns', 'conditions', 'residuals']: if i == 0: state_out[key] = deepcopy( sub_state[key] ) # Necessary deepcopy: otherwise the next step overwrites this state else: state_out[key].append_or_update(sub_state[key]) return state_out
class Segment(Analysis): """ The first basic piece of a mission which each segment will expand upon Assumptions: There's a detailed process flow outline in defaults. A mission must be solved in that order. Source: None """ def __defaults__(self): """This sets the default values. Assumptions: None Source: N/A Inputs: None Outputs: None Properties Used: None """ self.settings = Settings() self.state = State() self.analyses = Analysis.Container() self.process = Process() self.process.initialize = Process() self.process.converge = Process() self.process.iterate = Process() self.process.iterate.unknowns = Process() self.process.iterate.initials = Process() self.process.iterate.conditions = Process() self.process.iterate.residuals = Process() self.process.finalize = Process() self.process.finalize.post_process = Process() return def initialize(self,state): """ This executes the initialize process Assumptions: None Source: N/A Inputs: State [Data()] Outputs: None Properties Used: None """ self.process.initialize(self,state) return def converge(self,state): """ This executes the converge process Assumptions: None Source: N/A Inputs: State [Data()] Outputs: None Properties Used: None """ self.process.converge(self,state) def iterate(self,state): """ This executes the iterate process Assumptions: None Source: N/A Inputs: State [Data()] Outputs: None Properties Used: None """ self.process.iterate(self,state) return def finalize(self,state): """ This executes the finalize process Assumptions: None Source: N/A Inputs: State [Data()] Outputs: None Properties Used: None """ self.process.finalize(self,state) return def compile(self): """ This does nothing Assumptions: None Source: N/A Inputs: State [Data()] Outputs: None Properties Used: None """ return def evaluate(self,state=None): """ This executes the entire process Assumptions: None Source: N/A Inputs: State [Data()] Outputs: State [Data()] Properties Used: None """ if state is None: state = self.state self.process(self,state) return state
def __defaults__(self): """ This sets the default solver flow. Anything in here can be modified after initializing a segment. Assumptions: None Source: N/A Inputs: None Outputs: None Properties Used: None """ # -------------------------------------------------------------- # User inputs # -------------------------------------------------------------- self.altitude_start = None self.altitude_end = None self.air_speed_start = None self.air_speed_end = None self.objective = None # This will be a key self.minimize = True self.CL_limit = 1.e20 self.seed_climb_rate = 100. * Units['feet/min'] self.algorithm = 'SLSQP' # -------------------------------------------------------------- # State # -------------------------------------------------------------- # conditions self.state.conditions.update(Conditions.Aerodynamics()) # initials and unknowns ones_row = self.state.ones_row self.state.unknowns.throttle = ones_row(1) * 0.8 self.state.unknowns.body_angle = ones_row(1) * 5.0 * Units.degrees self.state.unknowns.flight_path_angle = ones_row( 1) * 3.0 * Units.degrees self.state.unknowns.velocity = ones_row(1) * 1.0 self.state.residuals.forces = ones_row(2) * 0.0 self.state.inputs_last = None self.state.objective_value = 0.0 self.state.constraint_values = 0.0 # -------------------------------------------------------------- # The Solving Process # -------------------------------------------------------------- # -------------------------------------------------------------- # Initialize - before iteration # -------------------------------------------------------------- initialize = self.process.initialize initialize.expand_state = Methods.expand_state initialize.solved_mission = Methods.Climb.Optimized.solve_linear_speed_constant_rate initialize.differentials = Methods.Common.Numerics.initialize_differentials_dimensionless initialize.conditions = SUAVE.Methods.skip # -------------------------------------------------------------- # Converge - starts iteration # -------------------------------------------------------------- converge = self.process.converge converge.converge_root = Methods.converge_opt # -------------------------------------------------------------- # Iterate - this is iterated # -------------------------------------------------------------- iterate = self.process.iterate # Update Initials iterate.initials = Process() iterate.initials.time = Methods.Common.Frames.initialize_time iterate.initials.weights = Methods.Common.Weights.initialize_weights iterate.initials.inertial_position = Methods.Common.Frames.initialize_inertial_position iterate.initials.planet_position = Methods.Common.Frames.initialize_planet_position # Unpack Unknowns iterate.unknowns = Process() iterate.unknowns.mission = Methods.Climb.Optimized.unpack_unknowns # Update Conditions iterate.conditions = Process() iterate.conditions.differentials = Methods.Climb.Optimized.update_differentials iterate.conditions.acceleration = Methods.Common.Frames.update_acceleration iterate.conditions.altitude = Methods.Common.Aerodynamics.update_altitude iterate.conditions.atmosphere = Methods.Common.Aerodynamics.update_atmosphere iterate.conditions.gravity = Methods.Common.Weights.update_gravity iterate.conditions.freestream = Methods.Common.Aerodynamics.update_freestream iterate.conditions.orientations = Methods.Common.Frames.update_orientations iterate.conditions.aerodynamics = Methods.Common.Aerodynamics.update_aerodynamics iterate.conditions.stability = Methods.Common.Aerodynamics.update_stability iterate.conditions.propulsion = Methods.Common.Energy.update_thrust iterate.conditions.weights = Methods.Common.Weights.update_weights iterate.conditions.forces = Methods.Common.Frames.update_forces iterate.conditions.planet_position = Methods.Common.Frames.update_planet_position # Solve Residuals iterate.residuals = Process() iterate.residuals.total_forces = Methods.Climb.Common.residual_total_forces # Set outputs iterate.outputs = Process() iterate.outputs.objective = Methods.Climb.Optimized.objective iterate.outputs.constraints = Methods.Climb.Optimized.constraints iterate.outputs.cache_inputs = Methods.Climb.Optimized.cache_inputs # -------------------------------------------------------------- # Finalize - after iteration # -------------------------------------------------------------- finalize = self.process.finalize # Post Processing finalize.post_process = Process() finalize.post_process.inertial_position = Methods.Common.Frames.integrate_inertial_horizontal_position finalize.post_process.stability = Methods.Common.Aerodynamics.update_stability return
def __defaults__(self): self.segments = Process() self.state = State.Container()
def __defaults__(self): # -------------------------------------------------------------- # User inputs # -------------------------------------------------------------- self.altitude_start = None # Optional self.altitude_end = 10. * Units.km self.throttle = 0.5 self.equivalent_air_speed = 100 * Units.kts self.settings.root_finder = scipy.optimize.root # -------------------------------------------------------------- # State # -------------------------------------------------------------- # conditions self.state.conditions.update(Conditions.Aerodynamics()) # initials and unknowns ones_row = self.state.ones_row self.state.unknowns.body_angle = ones_row(1) * 10.0 * Units.deg self.state.unknowns.wind_angle = ones_row(1) * 0.8 * Units.deg self.state.residuals.forces = ones_row(2) * 0.0 # -------------------------------------------------------------- # The Solving Process # -------------------------------------------------------------- # -------------------------------------------------------------- # Initialize - before iteration # -------------------------------------------------------------- initialize = self.process.initialize initialize.clear() initialize.expand_state = Methods.expand_state initialize.differentials = Methods.Common.Numerics.initialize_differentials_dimensionless initialize.conditions = Methods.Climb.Constant_Throttle_Constant_EAS.initialize_conditions initialize.velocities = Methods.Climb.Constant_Throttle_Constant_EAS.update_velocity_vector_from_wind_angle initialize.differentials_altitude = Methods.Climb.Constant_Throttle_Constant_EAS.update_differentials_time # -------------------------------------------------------------- # Converge - starts iteration # -------------------------------------------------------------- converge = self.process.converge converge.clear() converge.converge_root = Methods.converge_root # -------------------------------------------------------------- # Iterate - this is iterated # -------------------------------------------------------------- iterate = self.process.iterate iterate.clear() # Update Initials iterate.initials = Process() iterate.initials.time = Methods.Common.Frames.initialize_time iterate.initials.weights = Methods.Common.Weights.initialize_weights iterate.initials.inertial_position = Methods.Common.Frames.initialize_inertial_position iterate.initials.planet_position = Methods.Common.Frames.initialize_planet_position # Unpack Unknowns iterate.unpack_unknowns = Methods.Climb.Constant_Throttle_Constant_EAS.unpack_body_angle # Update Conditions iterate.conditions = Process() iterate.conditions.velocities = Methods.Climb.Constant_Throttle_Constant_EAS.update_velocity_vector_from_wind_angle iterate.conditions.differentials_a = Methods.Climb.Constant_Throttle_Constant_EAS.update_differentials_time iterate.conditions.acceleration = Methods.Climb.Constant_Throttle_Constant_EAS.update_acceleration iterate.conditions.altitude = Methods.Common.Aerodynamics.update_altitude iterate.conditions.atmosphere = Methods.Common.Aerodynamics.update_atmosphere iterate.conditions.gravity = Methods.Common.Weights.update_gravity iterate.conditions.freestream = Methods.Common.Aerodynamics.update_freestream iterate.conditions.orientations = Methods.Common.Frames.update_orientations iterate.conditions.aerodynamics = Methods.Common.Aerodynamics.update_aerodynamics iterate.conditions.stability = Methods.Common.Aerodynamics.update_stability iterate.conditions.propulsion = Methods.Common.Energy.update_thrust iterate.conditions.weights = Methods.Climb.Constant_Throttle_Constant_EAS.update_weights iterate.conditions.forces = Methods.Climb.Constant_Throttle_Constant_EAS.update_forces iterate.conditions.planet_position = Methods.Common.Frames.update_planet_position # Solve Residuals iterate.residuals = Process() iterate.residuals.total_forces = Methods.Climb.Constant_Throttle_Constant_EAS.residual_total_forces # -------------------------------------------------------------- # Finalize - after iteration # -------------------------------------------------------------- finalize = self.process.finalize finalize.clear() # Post Processing finalize.post_process = Process() finalize.post_process.inertial_position = Methods.Common.Frames.integrate_inertial_horizontal_position finalize.post_process.stability = Methods.Common.Aerodynamics.update_stability return
def __defaults__(self): """This sets the default values and methods for the analysis. Assumptions: None Source: N/A Inputs: None Outputs: None Properties Used: N/A """ self.tag = 'SU2_Euler_Super_markup' # Correction factors settings = self.settings settings.trim_drag_correction_factor = 1.02 settings.wing_parasite_drag_form_factor = 1.1 settings.fuselage_parasite_drag_form_factor = 2.3 settings.oswald_efficiency_factor = None settings.viscous_lift_dependent_drag_factor = 0.38 settings.drag_coefficient_increment = 0.0000 settings.spoiler_drag_increment = 0.00 settings.maximum_lift_coefficient = np.inf settings.half_mesh_flag = True settings.parallel = False settings.processors = 1 settings.vsp_mesh_growth_ratio = 1.3 # Build the evaluation process compute = self.process.compute compute.lift = Process() # Run SU2 compute.lift.inviscid = SU2_inviscid_Super() compute.lift.total = Common.Lift.aircraft_total # Do a traditional drag buildup compute.drag = Process() compute.drag.compressibility = Process() compute.drag.compressibility.total = Methods.Drag.compressibility_drag_total compute.drag.parasite = Process() compute.drag.parasite.wings = Process_Geometry('wings') compute.drag.parasite.wings.wing = Common.Drag.parasite_drag_wing compute.drag.parasite.fuselages = Process_Geometry('fuselages') compute.drag.parasite.fuselages.fuselage = Common.Drag.parasite_drag_fuselage compute.drag.parasite.propulsors = Process_Geometry('propulsors') compute.drag.parasite.propulsors.propulsor = Methods.Drag.parasite_drag_propulsor #compute.drag.parasite.pylons = Methods.Drag.parasite_drag_pylon # currently unavailable for supersonic compute.drag.parasite.total = Common.Drag.parasite_total compute.drag.induced = Methods.Drag.induced_drag_aircraft compute.drag.miscellaneous = Methods.Drag.miscellaneous_drag_aircraft compute.drag.untrimmed = Common.Drag.untrimmed compute.drag.trim = Common.Drag.trim compute.drag.spoiler = FZ_Methods.Drag.spoiler_drag compute.drag.total = Common.Drag.total_aircraft