Closed Daniel-E-B closed 3 months ago
Hi Daniel!
This looks like it's due to improper types when the asb.WingXSec
instance was constructed.
When constructing a asb.WingXSec
, the control_surfaces
argument should be a list of asb.ControlSurface
objects, rather than a single one. This is true even if only one control surface is present. The motivation here is to allow overlapping control surfaces (e.g., to make a flaperon or elevon).
Input types can be checked using the docstring of most classes, which are type-hinted:
In [1]: asb.WingXSec?
Init signature:
asb.WingXSec(
xyz_le: Union[numpy.ndarray, List] = None,
chord: float = 1.0,
twist: float = 0.0,
airfoil: aerosandbox.geometry.airfoil.airfoil.Airfoil = None,
control_surfaces: Optional[List[ForwardRef('ControlSurface')]] = None, # <<< control_surfaces type hint
analysis_specific_options: Optional[Dict[type, Dict[str, Any]]] = None,
**deprecated_kwargs,
)
Docstring: Definition for a wing cross-section ("X-section").
Init docstring:
Defines a new wing cross-section.
...
Got it, thanks!
Bug Description / Observed Behavior
Running
vlm.airplane.wings[0].control_surface_area()
on a wing with a control surface between two xsecs, The output isMy wing has a control surface:
vlm.airplane.wings[0].xsecs[2].control_surfaces
withxsecs[1]
or[2]
returnsControlSurface (name=aileron, symmetric=False, deflection=0.0, hinge_point=0.75)
but
control_surfaces
is not an iterable and can't be treated like an array here. Either that or I've made some stupid python mistake :).Steps to Reproduce
I added control surfaces to the 01-Vortex Lattice Method wing.
Expected Behavior
Should print the area of the control surface
System Information
Other Information