visualization.py

openconcept.utilities.visualization.plot_trajectory_grid(cases, x_var, x_unit, y_vars, y_units, phases, x_label=None, y_labels=None, grid_layout=[5, 2], marker='o', savefig=None, figsize=None)

Plots multiple trajectories against each other Cases is a list of OpenMDAO CaseReader cases which act like OpenMDAO problems

openconcept.utilities.visualization.plot_OAS_mesh(OAS_mesh, ax=None, set_xlim=True, turn_off_axis=True)

Plots the wing planform mesh from OpenConcept’s OpenAeroStruct interface.

Parameters:
  • OAS_mesh (ndarray) – The mesh numpy array pulled out of the aerodynamics model (the output of the mesh component).

  • ax (matplotlib axis object (optional)) – Axis on which to plot the wingbox. If not specified, this function creates and returns a figure and axis.

  • set_xlim (bool (optional)) – Set the x limits on the axis to just fit the span of the wing.

  • turn_off_axis (bool (optional)) – Turn off the spines, ticks, etc.

Returns:

fig, ax – If ax is not specified, returns the created figure and axis.

Return type:

matplotlib figure and axis objects

openconcept.utilities.visualization.plot_OAS_force_contours(OAS_mesh, panel_forces, ax=None, set_xlim=True, turn_off_axis=True, wing='both', force_dir=2, **contourf_kwargs)

Plots contours of the force per area on the surface of the wing. The units are the force units of panel_forces divided by the square of the lenght units of OAS_mesh.

Parameters:
  • OAS_mesh (ndarray) – The mesh numpy array pulled out of the aerodynamics model (the output of the mesh component).

  • panel_forces (ndarray) – Force from VLM for each panel (the panel_forces output of the VLM component).

  • ax (matplotlib axis object (optional)) – Axis on which to plot the wingbox. If not specified, this function creates and returns a figure and axis.

  • set_xlim (bool (optional)) – Set the x limits on the axis to just fit the span of the wing, by default True.

  • turn_off_axis (bool (optional)) – Turn off the spines, ticks, etc., by default True.

  • wing (str (optional)) – Which wing to plot, valid options are “left”, “right”, or “both”, by default both.

  • force_dir (int (optional)) – Force direction of which to plot contours. 0 is x force (drag direction), 1 is y force (spanwise inward), and 2 is z force (lift direction).

  • contourf_kwargs – Any keyword arguments to pass to matplotlib’s contourf function.

Returns:

  • c (matplotlib QuadContourSet) – Return value from the call to contourf.

  • fig, ax (matplotlib figure and axis objects) – If ax is not specified, returns the created figure and axis.