ard.api.interface

ard.api.interface#

Functions

set_up_ard_model(input_dict[, root_data_path])

Set up an OpenMDAO model for Ard based on the provided input dictionary or YAML file.

set_up_system_recursive(input_dict[, ...])

Recursively sets up an OpenMDAO system based on the input dictionary.

ard.api.interface.set_up_ard_model(input_dict, root_data_path=None)[source]#

Set up an OpenMDAO model for Ard based on the provided input dictionary or YAML file.

This function initializes and configures an OpenMDAO problem using a system specification, modeling options, and analysis options. It supports default system configurations (e.g., "onshore", "offshore_floating") and allows for recursive setup of subsystems and connections.

Parameters:
  • input_dict (Union[str, dict]) --

    A dictionary or a path to a YAML file containing the configuration for the Ard model. The dictionary or YAML file must include:

    • "system"str or dict

      The name of the default system to use (e.g., "onshore") or a custom system specification.

    • "modeling_options"dict

      A dictionary defining the modeling options for the system (e.g., turbine specs, farm layout).

    • "analysis_options"dict

      A dictionary defining the analysis options, including driver settings, design variables, constraints, objectives, and recorder configuration.

  • root_data_path (str, optional) -- The root path for resolving relative paths in the system configuration. Defaults to None.

Returns:

An OpenMDAO problem instance with the defined system hierarchy, modeling options, and analysis options.

Return type:

om.Problem

Raises:

ValueError -- If an invalid default system is specified or if required keys are missing in the input dictionary.

Notes

  • The function uses set_up_system_recursive to recursively build the system hierarchy.

  • Latent variables for LandBOSSE, ORBIT, and FinanceSE are automatically set up if their respective components are present in the model.

ard.api.interface.set_up_system_recursive(input_dict, system_name='top_level', work_dir='ard_prob_out', parent_group=None, modeling_options=None, analysis_options=None, _depth=0)[source]#

Recursively sets up an OpenMDAO system based on the input dictionary.

Parameters:
  • input_dict (dict) -- Dictionary defining the system hierarchy.

  • parent_group (om.Group, optional) -- The parent group to which subsystems are added. Defaults to None, which initializes the top-level problem.

  • system_name (str)

  • work_dir (str)

  • modeling_options (dict)

  • analysis_options (dict)

  • _depth (int)

Returns:

The OpenMDAO problem with the defined system hierarchy.

Return type:

om.Problem