fastoad.models.performances.mission.openmdao.mission_wrapper module
Mission wrapper.
- class fastoad.models.performances.mission.openmdao.mission_wrapper.MissionWrapper(mission_definition: str | PathLike | MissionDefinition, *, propulsion: IPropulsion = None, reference_area: float = None, mission_name: str | None = None, variable_prefix: str = 'data:mission', force_all_block_fuel_usage: bool = False)[source]
Bases:
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 callingbuild()
reference_area – if not provided, the property
reference_area
must be set before callingbuild()
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: 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: FlightPoint, inputs: Vector, outputs: Vector) 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