fastoad.models.propulsion.fuel_propulsion.rubber_engine.openmdao module

OpenMDAO wrapping of RubberEngine.

class fastoad.models.propulsion.fuel_propulsion.rubber_engine.openmdao.OMRubberEngineWrapper[source]

Bases: fastoad.model_base.propulsion.IOMPropulsionWrapper

Wrapper class of for rubber engine model.

It is made to allow a direct call to RubberEngine in an OpenMDAO component.

Example of usage of this class:

import openmdao.api as om

class MyComponent(om.ExplicitComponent):
    def initialize():
        self._engine_wrapper = OMRubberEngineWrapper()

    def setup():
        # Adds OpenMDAO variables that define the engine
        self._engine_wrapper.setup(self)

        # Do the normal setup
        self.add_input("my_input")
        [finish the setup...]

    def compute(self, inputs, outputs, discrete_inputs=None, discrete_outputs=None):
        [do something]

        # Get the engine instance, with parameters defined from OpenMDAO inputs
        engine = self._engine_wrapper.get_model(inputs)

        # Run the engine model. This is a pure Python call. You have to define
        # its inputs before, and to use its outputs according to your needs
        sfc, thrust_rate, thrust = engine.compute_flight_points(
            mach,
            altitude,
            engine_setting,
            use_thrust_rate,
            thrust_rate,
            thrust
            )

        [do something else]

)
setup(component: openmdao.core.component.Component)[source]

Defines the needed OpenMDAO inputs for propulsion instantiation as done in get_model()

Use add_inputs and declare_partials methods of the provided component

Parameters

component

static get_model(inputs)fastoad.model_base.propulsion.IPropulsion[source]
Parameters

inputs – input parameters that define the engine

Returns

a RubberEngine instance

class fastoad.models.propulsion.fuel_propulsion.rubber_engine.openmdao.OMRubberEngineComponent(**kwargs)[source]

Bases: fastoad.model_base.propulsion.BaseOMPropulsionComponent

Parametric engine model as OpenMDAO component

See RubberEngine for more information.

Store some bound methods so we can detect runtime overrides.

Parameters

**kwargs (dict of keyword arguments) – Keyword arguments that will be mapped into the Component options.

setup()[source]

Declare inputs and outputs.

Available attributes:

name pathname comm options

setup_partials()[source]

Declare partials.

This is meant to be overridden by component classes. All partials should be declared here since this is called after all size/shape information is known for all variables.

static get_wrapper()fastoad.models.propulsion.fuel_propulsion.rubber_engine.openmdao.OMRubberEngineWrapper[source]

This method defines the used IOMPropulsionWrapper instance.

Returns

an instance of OpenMDAO wrapper for propulsion model