Sizing analysis

The sizing analysis: assemble a case, converge it, read it back.

SizingAnalysis is the object a case file becomes. It owns the aircraft (which owns the airframe disciplines), the performance discipline (which owns the initial conditions and the continuation ladder), and the black box.

The order of operations is the same one OpenConcept’s own run scripts follow, and is not incidental:

  1. Build the box, running any registration hooks first, because OpenMDAO requires design variables, an objective and constraints to be declared before setup.

  2. Write every initial condition – the design variable values and the mission values alike. This is set_values(prob, num_nodes).

  3. Walk the continuation ladder, converging each rung before attempting the next.

  4. Converge the design mission.

  5. Read every response.

Steps 2 to 4 are what an optimizer repeats – minus the ladder, which is walked once to establish the baseline; every later design starts from its predecessor’s converged state.

class cdadt.analysis.SizingAnalysis(config, *, run=None, box=None, aircraft=None, performance=None, catalog=None, certification=None)[source]

Bases: object

A full mission sizing analysis of one aircraft against one mission.

This is the coordinator: it owns the black box and the disciplines, and it is the only thing that talks to both. The disciplines never reach each other.

Parameters:
  • config (Config) – The case. Everything else is derived from it.

  • run (RunDirectory, optional) – Where this study writes its files. None – the default – means the box builds its problem with reports off, so building it writes nothing – though a driver still writes its own log into OpenMDAO’s default output directory. The command line always supplies one; see run_directory.

  • box (optional) – The collaborators, each defaulting to what the config describes. They are injectable so that the coordinator can be driven against a substitute – a second black box, or a stand-in with no model to build – without going through a case file to do it.

  • aircraft (optional) – The collaborators, each defaulting to what the config describes. They are injectable so that the coordinator can be driven against a substitute – a second black box, or a stand-in with no model to build – without going through a case file to do it.

  • performance (optional) – The collaborators, each defaulting to what the config describes. They are injectable so that the coordinator can be driven against a substitute – a second black box, or a stand-in with no model to build – without going through a case file to do it.

  • catalog (optional) – The collaborators, each defaulting to what the config describes. They are injectable so that the coordinator can be driven against a substitute – a second black box, or a stand-in with no model to build – without going through a case file to do it.

  • certification (optional) – The collaborators, each defaulting to what the config describes. They are injectable so that the coordinator can be driven against a substitute – a second black box, or a stand-in with no model to build – without going through a case file to do it.

Examples

>>> analysis = SizingAnalysis(Config.from_yaml("cases/b738.yaml"))
>>> results = analysis.run()
>>> results["MTOW"]
78345.6...
property config: Config

The case this analysis was built from.

property box: OpenConceptSizingBox

The black box.

property aircraft: Aircraft

The airframe disciplines.

property performance: Performance

The performance discipline, which owns the conditions and the ladder.

property catalog: ResponseCatalog

The catalogue mapping response names to black-box paths.

property certification: CertificationBasis

The certification basis this study is judged against.

Certification is a domain of the study like any other, and this is the class that encapsulates it. It is deliberately not a Discipline: that abstraction means “owns a slice of the black box’s variable interface”, and certification sets nothing and publishes nothing. It reads quantities the other disciplines report and judges them, which is a different relationship to the box and would be misdescribed by the same base class.

Owned here rather than by Optimizer so that a sizing run can ask whether the aeroplane it converged actually meets its basis, without an optimization having to happen first.

property disciplines: tuple[Discipline, ...]

Every discipline of this study, airframe first and performance last.

build(register=())[source]

Build the black box and write every initial condition into it.

Parameters:

register (sequence of callable, optional) – Hooks called with the box’s group before setup, where design variables, an objective and constraints are declared. See Optimizer.

Raises:

MissionError – If a name in the case file is not something the black box publishes, either on its own or under the mission path.

Return type:

None

converge(verbose=False)[source]

Walk the continuation ladder and converge the design mission.

Raises:

openmdao.core.analysis_error.AnalysisError – If a Newton solve fails and the case asked for that to be an error.

Parameters:

verbose (bool)

Return type:

None

results()[source]

Read every discipline’s responses out of the converged box.

Return type:

SizingResults

run(verbose=False)[source]

Build, converge and read.

Parameters:

verbose (bool, optional) – Print each continuation step as it runs. Default False.

Return type:

SizingResults