fastoad.models.performances.mission.openmdao.mission_wrapper module

Mission wrapper.

class fastoad.models.performances.mission.openmdao.mission_wrapper.MissionWrapper(mission_definition: Union[str, fastoad.models.performances.mission.mission_definition.schema.MissionDefinition], *, propulsion: Optional[fastoad.model_base.propulsion.IPropulsion] = None, reference_area: Optional[float] = None, mission_name: Optional[str] = None, variable_prefix: str = 'data:mission', force_all_block_fuel_usage: bool = False)[source]

Bases: fastoad.models.performances.mission.mission_definition.mission_builder.mission_builder.MissionBuilder

Wrapper around MissionBuilder for using with OpenMDAO.

Unlike its parent class, the mission_name argument is mandatory at instantiation, unless there is only one mission in the definition file.

Parameters
  • mission_definition – a file path or MissionDefinition instance

  • propulsion – if not provided, the property propulsion must be set before calling build()

  • reference_area – if not provided, the property reference_area must be set before calling build()

  • mission_name – name of chosen mission. Can be omitted if definition file contains only one mission.

  • variable_prefix – prefix for auto-generated variable names.

  • force_all_block_fuel_usage – if True and if mission_name is provided, the mission definition will be modified to set the target fuel consumption to variable “~:block_fuel”

force_all_block_fuel_usage()[source]

Modifies mission definition to set block fuel as target fuel consumption.

setup(component: openmdao.core.explicitcomponent.ExplicitComponent)[source]

To be used during setup() of provided OpenMDAO component.

It adds input and output variables deduced from mission definition file.

Parameters

component – the OpenMDAO component where the setup is done.

compute(start_flight_point: fastoad.model_base.flight_point.FlightPoint, inputs: openmdao.vectors.vector.Vector, outputs: openmdao.vectors.vector.Vector) pandas.core.frame.DataFrame[source]

To be used during compute() of an OpenMDAO component.

Builds the mission from input file, and computes it. outputs vector is filled with duration, burned fuel and covered ground distance for each part of the flight.

Parameters
  • start_flight_point – starting point of mission

  • inputs – the input vector of the OpenMDAO component

  • outputs – the output vector of the OpenMDAO component

Returns

a pandas DataFrame where column names match fields of FlightPoint

get_reserve_variable_name() str[source]
Returns

the name of OpenMDAO variable for fuel reserve. This name is among the declared outputs in setup().