VSPAERO Actuator Disk and Propeller Functions

The following group of functions provide API capability for setting up actuator disks (Disk tab of VSPAERO GUI) and propellers (Propeller tab of VSPAERO GUI) for VSPAERO analysis. If a propeller geometry is used to model the actuator disk, the “PropMode” must be set to PROP_DISK or PROP_BOTH. Alternatively, the “PropMode” but be set to PROP_BLADE or PROP_BOTH for unsteady analysis. must be set to PROP_DISK or PROP_BOTH.

FindActuatorDisk(disk_index)

Get the ID of a VSPAERO actuator disk at the specified index.

GetNumActuatorDisks()

Get the number of actuator disks in the current VSPAERO set.

FindUnsteadyGroup(group_index)

Get the ID of the VSPAERO unsteady group at the specified index.

GetUnsteadyGroupName(group_index)

Get the name of the unsteady group at the specified index.

GetUnsteadyGroupCompIDs(group_index)

Get an array of IDs for all components in the unsteady group at the specified index.

GetUnsteadyGroupSurfIndexes(group_index)

Get an array of surface indexes for all components in the unsteady group at the specified index.

GetNumUnsteadyGroups()

Get the number of unsteady groups in the current VSPAERO set.

GetNumUnsteadyRotorGroups()

Get the number of unsteady rotor groups in the current VSPAERO set.

Details

openvsp.FindActuatorDisk(disk_index)[source]

Get the ID of a VSPAERO actuator disk at the specified index. An empty string is returned if the index is out of range.

# Add a propeller
prop_id = AddGeom( "PROP", "" )
SetParmVal( prop_id, "PropMode", "Design", PROP_DISK )
SetParmVal( prop_id, "Diameter", "Design", 6.0 )

Update()

# Setup the actuator disk VSPAERO parms
disk_id = FindActuatorDisk( 0 )
assert len( disk_id ) > 0, "FindActuatorDisk found nothing"

SetParmVal( FindParm( disk_id, "RotorRPM", "Rotor" ), 1234.0 )
SetParmVal( FindParm( disk_id, "RotorCT", "Rotor" ), 0.35 )
SetParmVal( FindParm( disk_id, "RotorCP", "Rotor" ), 0.55 )
SetParmVal( FindParm( disk_id, "RotorHubDiameter", "Rotor" ), 1.0 )

See also: PROP_MODE :param [in]: disk_index int Actuator disk index for the current VSPAERO set :rtype: string :return: string Actuator disk ID

openvsp.GetNumActuatorDisks()[source]

Get the number of actuator disks in the current VSPAERO set. This is equivalent to the number of disk surfaces in the VSPAERO set.

# Set VSPAERO set index to SET_ALL
SetParmVal( FindParm( FindContainer( "VSPAEROSettings", 0 ), "GeomSet", "VSPAERO" ), SET_ALL )

# Add a propeller
prop_id = AddGeom( "PROP", "" )
SetParmValUpdate( prop_id, "PropMode", "Design", PROP_BLADES )

num_disk = GetNumActuatorDisks() # Should be 0

assert num_disk == 0, "a bladed propeller counts as an actuator disk"

SetParmValUpdate( prop_id, "PropMode", "Design", PROP_DISK )

num_disk = GetNumActuatorDisks() # Should be 1

assert num_disk == 1, "GetNumActuatorDisks did not count the disk"

# The disk has to be findable at every index it claims.
for i in range( num_disk ):
    assert len( FindActuatorDisk( i ) ) > 0, "GetNumActuatorDisks counted a disk that cannot be found"

See also: PROP_MODE :rtype: int :return: int Number of actuator disks in the current VSPAERO set

openvsp.FindUnsteadyGroup(group_index)[source]

Get the ID of the VSPAERO unsteady group at the specified index. An empty string is returned if the index is out of range.

wing_id = AddGeom( "WING" )
pod_id = AddGeom( "POD" )

# Create an actuator disk
prop_id = AddGeom( "PROP", "" )
SetParmVal( prop_id, "PropMode", "Design", PROP_BLADES )

Update()

# Setup the unsteady group VSPAERO parms
disk_id = FindUnsteadyGroup( 1 ) # fixed components are in group 0 (wing & pod)
assert len( disk_id ) > 0, "FindUnsteadyGroup found nothing"

SetParmVal( FindParm( disk_id, "RPM", "UnsteadyGroup" ), 1234.0 )

See also: PROP_MODE :param [in]: group_index int Unsteady group index for the current VSPAERO set :rtype: string :return: string Unsteady group ID

openvsp.GetUnsteadyGroupName(group_index)[source]

Get the name of the unsteady group at the specified index. The name is derived from the group contents – a rotor group takes the name of its propeller and every other group is the fixed component group – so there is no matching setter.

# Add a pod and wing
pod_id = AddGeom( "POD", "" )
wing_id = AddGeom( "WING", pod_id )

SetParmVal( wing_id, "X_Rel_Location", "XForm", 2.5 )
Update()

print( GetUnsteadyGroupName( 0 ) )

# The pod and wing are fixed components, so they share the one fixed group.
assert GetUnsteadyGroupName( 0 ) == "Fixed_Group", "GetUnsteadyGroupName did not name the fixed component group"

# That group holds the pod and both wing surfaces.
assert len( GetUnsteadyGroupCompIDs( 0 ) ) == 3, "the fixed group does not hold the components"

# A group index past the end has to be rejected.  The error queue is reached
# through the error manager singleton in Python.
err_mgr = ErrorMgrSingleton.getInstance()

GetUnsteadyGroupName( GetNumUnsteadyGroups() )

assert err_mgr.GetNumTotalErrors() > 0, "GetUnsteadyGroupName accepted an index past the end"

# That error was raised deliberately, so take it back off the queue.
while err_mgr.GetNumTotalErrors() > 0 :
    err = err_mgr.PopLastError()
Parameters:

[in] – group_index int Unsteady group index for the current VSPAERO set

Return type:

string

Returns:

string Unsteady group name

openvsp.GetUnsteadyGroupCompIDs(group_index)[source]

Get an array of IDs for all components in the unsteady group at the specified index.

# Add a pod and wing
pod_id = AddGeom( "POD", "" )
wing_id = AddGeom( "WING", pod_id ) # Default with symmetry on -> 2 surfaces

SetParmVal( wing_id, "X_Rel_Location", "XForm", 2.5 )
Update()

comp_ids = GetUnsteadyGroupCompIDs( 0 )

if  len(comp_ids) != 3 :
    print( "ERROR: GetUnsteadyGroupCompIDs" )
    assert False, "ERROR: GetUnsteadyGroupCompIDs"

See also: GetUnsteadyGroupSurfIndexes :param [in]: group_index int Unsteady group index for the current VSPAERO set :rtype: std::vector< std::string,std::allocator< std::string > > :return: vector <string> Array of component IDs

openvsp.GetUnsteadyGroupSurfIndexes(group_index)[source]

Get an array of surface indexes for all components in the unsteady group at the specified index.

# Add a pod and wing
pod_id = AddGeom( "POD", "" )
wing_id = AddGeom( "WING", pod_id ) # Default with symmetry on -> 2 surfaces

SetParmVal( wing_id, "X_Rel_Location", "XForm", 2.5 )
Update()

surf_indexes = GetUnsteadyGroupSurfIndexes( 0 )

if  len(surf_indexes) != 3 :
    print( "ERROR: GetUnsteadyGroupSurfIndexes" )
    assert False, "ERROR: GetUnsteadyGroupSurfIndexes"

See also: GetUnsteadyGroupCompIDs :param [in]: group_index int Unsteady group index for the current VSPAERO set :rtype: std::vector< int,std::allocator< int > > :return: vector <int> Array of surface indexes

openvsp.GetNumUnsteadyGroups()[source]

Get the number of unsteady groups in the current VSPAERO set. Each propeller is placed in its own unsteady group. All symmetric copies of propellers are also placed in an unsteady group. All other component types are placed in a single fixed component unsteady group.

# Set VSPAERO set index to SET_ALL
SetParmVal( FindParm( FindContainer( "VSPAEROSettings", 0 ), "GeomSet", "VSPAERO" ), SET_ALL )

# Add a propeller
prop_id = AddGeom( "PROP" )
SetParmValUpdate( prop_id, "PropMode", "Design", PROP_DISK )

num_group = GetNumUnsteadyGroups() # Should be 0

assert num_group == 0, "an actuator disk counts as an unsteady group"

SetParmValUpdate( prop_id, "PropMode", "Design", PROP_BLADES )

num_group = GetNumUnsteadyGroups() # Should be 1

assert num_group == 1, "the bladed propeller was not counted"

wing_id = AddGeom( "WING" )

num_group = GetNumUnsteadyGroups() # Should be 2 (includes fixed component group)

assert num_group == 2, "the fixed component group was not counted"

# Only the propeller is a rotor group; the wing shares the fixed group.
assert GetNumUnsteadyRotorGroups() == 1, "GetNumUnsteadyGroups disagrees with GetNumUnsteadyRotorGroups"

See also: PROP_MODE, GetNumUnsteadyRotorGroups :rtype: int :return: int Number of unsteady groups in the current VSPAERO set

openvsp.GetNumUnsteadyRotorGroups()[source]

Get the number of unsteady rotor groups in the current VSPAERO set. This is equivalent to the total number of propeller Geoms, including each symmetric copy, in the current VSPAERO set. While all fixed components (wings, fuseleage, etc.) are placed in their own unsteady group, this function does not consider them.

# Set VSPAERO set index to SET_ALL
SetParmVal( FindParm( FindContainer( "VSPAEROSettings", 0 ), "GeomSet", "VSPAERO" ), SET_ALL )

# Add a propeller
prop_id = AddGeom( "PROP" )
SetParmValUpdate( prop_id, "PropMode", "Design", PROP_DISK )

num_group = GetNumUnsteadyRotorGroups() # Should be 0

assert num_group == 0, "an actuator disk counts as a rotor group"

SetParmValUpdate( prop_id, "PropMode", "Design", PROP_BLADES )

num_group = GetNumUnsteadyRotorGroups() # Should be 1

assert num_group == 1, "the bladed propeller was not counted"

wing_id = AddGeom( "WING" )

num_group = GetNumUnsteadyRotorGroups() # Should be 1 still (fixed group not included)

assert num_group == 1, "the wing was counted as a rotor group"

# The wing does add a fixed component group, which the total counts.
assert GetNumUnsteadyGroups() == num_group + 1, "the fixed component group was not counted"

See also: PROP_MODE, GetNumUnsteadyGroups :rtype: int :return: int Number of unsteady rotor groups in the current VSPAERO set