Usage

FAST-OAD uses a configuration file for defining your OAD problem. You can interact with this problem using command line or Python directly.

You may also use some lower-level features of FAST-OAD to interact with OpenMDAO systems. This part is addressed in the API documentation.

The FAST-OAD configuration file

FAST-OAD configuration files are in TOML format.

title = "Sample OAD Process"

# List of folder paths where user added custom registered OpenMDAO components
module_folders = []

# Input and output files
input_file = "./problem_inputs.xml"
output_file = "./problem_outputs.xml"

# Definition of problem driver assuming the OpenMDAO convention "import openmdao.api as om"
driver = "om.ScipyOptimizeDriver()"

# Definition of OpenMDAO model
[model]
    # Solvers are defined assuming the OpenMDAO convention "import openmdao.api as om"
    nonlinear_solver = "om.NonlinearBlockGS(maxiter=100)"
    linear_solver = "om.DirectSolver()"

    # Although "model" is a mandatory name for the top level of the model, its sub-components can be freely named by user
    [model.geometry]
        # An OpenMDAO component is identified by its "id"
        id = "fastoad.geometry.legacy"
    [model.weight]
        id = "fastoad.weight.legacy"
    [model.aerodynamics.highspeed]
        id = "fastoad.aerodynamics.highspeed.legacy"
    [model.aerodynamics.landing]
        id = "fastoad.aerodynamics.landing.legacy"
        use_xfoil = false
    [model.performance]
        id = "fastoad.performances.breguet"
    [model.propulsion]
        id = "fastoad.propulsion.rubber_engine"
    [model.hq.tail_sizing]
        id = "fastoad.handling_qualities.tail_sizing"
    [model.hq.static_margin]
        id = "fastoad.handling_qualities.static_margin"
        target = 0.05
    [model.loop]
        id = "fastoad.loop.wing_area"

[optimization]
    [[optimization.design_var]]
        name = "data:geometry:wing:MAC:at25percent:x"
        lower = 10.0
        upper = 25.0
        ref = 15.0

    [[optimization.design_var]]
        name = "data:geometry:wing:aspect_ratio"
        lower = 6.0
        upper = 12.0

    [[optimization.constraint]]
        name = "data:geometry:wing:span"
        upper = 35.0

    [[optimization.objective]]
        name = "data:handling_qualities:static_margin:to_target"

Now in details:

Custom module path

module_folders = []

Provides the path where user can have his custom OpenMDAO modules. See section How to add custom OpenMDAO modules to FAST-OAD.

Input and output files

input_file = "./problem_inputs.xml"
output_file = "./problem_outputs.xml"

Specifies the input and output files of the problem. They are defined in the configuration file and DO NOT APPEAR in the command line interface.

Problem driver

# Definition of problem driver assuming the OpenMDAO convention "import openmdao.api as om"
driver = "om.ScipyOptimizeDriver()"

This belongs the domain of the OpenMDAO framework and its utilization. This setting is needed for optimization problems. It is defined as in Python when assuming the OpenMDAO convention import openmdao.api as om.

For more details, please see the OpenMDAO documentation on drivers.

Solvers

[model]
    nonlinear_solver = "om.NonlinearBlockGS(maxiter=100)"
    linear_solver = "om.DirectSolver()"

This is the starting point for defining the model of the problem. The model is a group of components. If the model involves cycles, which happens for instance when some outputs of A are inputs of B, and vice-versa, it is necessary to specify solvers as done above.

For more details, please see the OpenMDAO documentation on nonlinear solvers and linear solvers.

Problem definition

[model.geometry]
    # An OpenMDAO component is identified by its "id"
    id = "fastoad.geometry.legacy"
[model.weight]
    id = "fastoad.weight.legacy"
[model.aerodynamics.highspeed]
    id = "fastoad.aerodynamics.highspeed.legacy"
[model.aerodynamics.landing]
    id = "fastoad.aerodynamics.landing.legacy"
    use_xfoil = false
[model.performance]
    id = "fastoad.performances.breguet"
[model.propulsion]
    id = "fastoad.propulsion.rubber_engine"
[model.hq.tail_sizing]
    id = "fastoad.handling_qualities.tail_sizing"
[model.hq.static_margin]
    id = "fastoad.handling_qualities.static_margin"
    target = 0.05
[model.loop]
    id = "fastoad.loop.wing_area"

Components of the model can be systems, or sub-groups. They are defined with a section key like [model.<some_name>]. Unlike “model”, which is the root element, the name of sub-components can be defined freely by user.

Here above are defined systems. A system is defined by its “id” key. See How to get list of registered systems.

Optimization settings

This settings are used only when using optimization (see Run Multi-Disciplinary Optimization). They are ignored when doing analysis (see Run Multi-Disciplinary Analysis)

Design variables

[[optimization.design_var]]
    name = "propulsion:MTO_thrust"
    lower = 0
    ref = 1.5e5
    ref0 = 50000

Here are defined design variables (relevant only for optimization). Keys of this section are named after parameters of the OpenMDAO System.add_design_var() method

This section can be repeated several times to add as many design variables as necessary.

Also, see How to get list of variables.

Objective function

[[optimization.objective]]
    name = "weight:aircraft:MTOW"
    ref = 90000
    ref0 = 60000

Here is defined the objective function (relevant only for optimization). Keys of this section are named after parameters of the OpenMDAO System.add_objective() method

Also, see How to get list of variables.

Constraints

[[optimization.constraint]]
    name = "propulsion:thrust_rate"
    lower = 0
    upper = 1

Here are defined constraint variables (relevant only for optimization). Keys of this section are named after parameters of the OpenMDAO System.add_constraint() method

This section can be repeated several times to add as many constraint variables as necessary.

Also, see How to get list of variables.

Using FAST-OAD through Command line

FAST-OAD can be used through shell command line or Python. This section deals with the shell command line, but if you prefer using Python, you can skip this part and go to Using FAST-OAD through Python.

The FAST-OAD command is fastoad. Inline help is available with:

$ fastoad -h

fastoad works through sub-commands. Each sub-command provides its own inline help using

$ fastoad <sub-command> -h

How to generate a configuration file

FAST-OAD can provide a ready-to use configuration file with:

$ fastoad gen_conf my_conf.toml

This generates the file my_conf.toml

How to get list of registered systems

If you want to change the list of components in the model in the configuration file, you need the list of available systems.

List of FAST-OAD systems can be obtained with:

$ fastoad list_systems

If you added custom systems in your configuration file my_conf.toml (see how to add custom OpenMDAO modules to FAST-OAD<Add modules>), they can be listed along FAST-OAD systems with:

$ fastoad list_systems my_conf.toml

How to get list of variables

Once your problem is defined in my_conf.toml, you can get a list of the variables of your problem with:

$ fastoad list_variables my_conf.toml

How to generate an input file

The name of the input file is defined in your configuration file my_conf.toml. This input file can be generated with:

$ fastoad gen_inputs my_conf.toml

The generated file will be an XML file that contains needed inputs for your problem. Values will be the default values from system definitions, which means several ones will be “nan”. Actual value must be filled before the process is run.

If you already have a file that contains these values, you can use it to populate your new input files with:

$ fastoad gen_inputs my_conf.toml my_ref_values.xml

If you are using the configuration file provided by the gen_conf sub-command (see :ref`Generate conf file`), you may download our CeRAS01_baseline.xml and use it as source for generating your input file.

How to view the problem process

FAST-OAD proposes two graphical ways to look at the problem defined in configuration file. This is especially useful to see how models and variables are connected.

N2 diagram

FAST-OAD can use OpenMDAO to create a N2 diagram. It provides in-depth information about the whole process.

You can create a n2.html file with:

$ fastoad n2 my_conf.toml

XDSM

Using WhatsOpt as web service, FAST-OAD can provide a XDSM.

XDSM offers a more synthetic view than N2 diagram.

As it uses a web service, see WhatsOpt documentation for how to gain access to the online WhatsOpt server, or see WhatsOpt developer documentation to run your own server.

You can create a xdsm.html file with:

$ fastoad xdsm my_conf.toml

Note: it may take a couple of minutes

How to run the problem

Run Multi-Disciplinary Analysis

Once your problem is defined in my_conf.toml, you can simply run it with:

$ fastoad eval my_conf.toml

Note: this is equivalent to OpenMDAO’s run_model()

Run Multi-Disciplinary Optimization

You can also run the defined optimization with:

$ fastoad optim my_conf.toml

Note: this is equivalent to OpenMDAO’s run_driver()

Using FAST-OAD through Python

The command line interface can generate Jupyter notebooks that show how to use the high-level interface of FAST-OAD.

To do so, type this command in your terminal:

$ fastoad notebooks

Then run the Jupyter server as indicated in the obtained message.