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.

FindActuatorDiskByGeom(geom_id, surf_index)

Find the actuator disk of a propeller surface.

GetActuatorDiskGeomID(disk_id)

Get the ID of the propeller an actuator disk belongs to.

GetNumActuatorDisks()

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

GetActuatorDiskIDVec()

Get the IDs of the actuator disks, in the order of their indexes.

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.

GetUnsteadyGroupNameByID(group_id)

Get the name of a VSPAERO unsteady group, by group ID.

GetUnsteadyGroupCompIDs(group_index)

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

GetUnsteadyGroupCompIDsByID(group_id)

Get the IDs of the components in a VSPAERO unsteady group, by group ID.

GetUnsteadyGroupSurfIndexes(group_index)

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

GetUnsteadyGroupSurfIndexesByID(group_id)

Get the surface indexes of the components in a VSPAERO unsteady group, by group ID.

GetNumUnsteadyGroups()

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

GetUnsteadyGroupIDVec()

Get the IDs of the VSPAERO unsteady groups, in the order of their indexes.

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, FindActuatorDiskByGeom :param [in]: disk_index int Actuator disk index for the current VSPAERO set :rtype: string :return: string Actuator disk ID

openvsp.FindActuatorDiskByGeom(geom_id, surf_index)[source]

Find the actuator disk of a propeller surface.

prop_id = AddGeom( "PROP" )

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

Update()

assert FindActuatorDiskByGeom( prop_id, 0 ) == FindActuatorDisk( 0 ), "FindActuatorDiskByGeom did not find the propeller's disk"

See also: GetActuatorDiskGeomID, FindActuatorDisk :param [in]: geom_id string Propeller Geom ID :param [in]: surf_index int Surface index of the propeller :rtype: string :return: string Actuator disk ID

openvsp.GetActuatorDiskGeomID(disk_id)[source]

Get the ID of the propeller an actuator disk belongs to.

prop_id = AddGeom( "PROP" )

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

Update()

assert GetActuatorDiskGeomID( FindActuatorDisk( 0 ) ) == prop_id, "GetActuatorDiskGeomID did not return the propeller"

See also: FindActuatorDisk :param [in]: disk_id string Actuator disk ID :rtype: string :return: string Propeller Geom 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.GetActuatorDiskIDVec()[source]

Get the IDs of the actuator disks, in the order of their indexes.

prop_id = AddGeom( "PROP" )

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

Update()

ids = GetActuatorDiskIDVec()

assert len( ids ) == GetNumActuatorDisks() and ids[0] == FindActuatorDisk( 0 ), "GetActuatorDiskIDVec did not return the disks in order"

See also: FindActuatorDisk :rtype: std::vector< std::string,std::allocator< std::string > > :return: array<string> Array of actuator disk IDs

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()

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

openvsp.GetUnsteadyGroupNameByID(group_id)[source]

Get the name of a VSPAERO unsteady group, by group ID.

wing_id = AddGeom( "WING" )

prop_id = AddGeom( "PROP" )

Update()

# Fixed components are in group 0, the propeller in group 1
group_id = GetUnsteadyGroupIDVec()[1]

assert GetUnsteadyGroupNameByID( group_id ) == GetUnsteadyGroupName( 1 ), "GetUnsteadyGroupNameByID did not find the group"

See also: GetUnsteadyGroupIDVec, GetUnsteadyGroupName :param [in]: group_id string Unsteady group ID :rtype: string :return: 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, GetUnsteadyGroupCompIDsByID :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.GetUnsteadyGroupCompIDsByID(group_id)[source]

Get the IDs of the components in a VSPAERO unsteady group, by group ID.

wing_id = AddGeom( "WING" )

prop_id = AddGeom( "PROP" )

Update()

# Fixed components are in group 0, the propeller in group 1
group_id = GetUnsteadyGroupIDVec()[1]

assert list( GetUnsteadyGroupCompIDsByID( group_id ) ) == [ prop_id ], "GetUnsteadyGroupCompIDsByID did not return the propeller"

See also: GetUnsteadyGroupSurfIndexes, GetUnsteadyGroupCompIDs :param [in]: group_id string Unsteady group ID :rtype: std::vector< std::string,std::allocator< std::string > > :return: array<string> Array of component Geom 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, GetUnsteadyGroupSurfIndexesByID :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.GetUnsteadyGroupSurfIndexesByID(group_id)[source]

Get the surface indexes of the components in a VSPAERO unsteady group, by group ID.

wing_id = AddGeom( "WING" )

prop_id = AddGeom( "PROP" )

Update()

# Fixed components are in group 0, the propeller in group 1
group_id = GetUnsteadyGroupIDVec()[1]

assert list( GetUnsteadyGroupSurfIndexesByID( group_id ) ) == list( GetUnsteadyGroupSurfIndexes( 1 ) ), "GetUnsteadyGroupSurfIndexesByID did not return the propeller's surface"

See also: GetUnsteadyGroupCompIDs, GetUnsteadyGroupSurfIndexes :param [in]: group_id string Unsteady group ID :rtype: std::vector< int,std::allocator< int > > :return: array<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.GetUnsteadyGroupIDVec()[source]

Get the IDs of the VSPAERO unsteady groups, in the order of their indexes.

wing_id = AddGeom( "WING" )

prop_id = AddGeom( "PROP" )

Update()

groups = GetUnsteadyGroupIDVec()

assert len( groups ) == GetNumUnsteadyGroups() and groups[1] == FindUnsteadyGroup( 1 ), "GetUnsteadyGroupIDVec did not return the groups in order"

See also: FindUnsteadyGroup :rtype: std::vector< std::string,std::allocator< std::string > > :return: array<string> Array of unsteady group IDs

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