OpenVSP API Documentation 3.55.0
Loading...
Searching...
No Matches
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. Click here to return to the main page. More...

Functions

std::string vsp::FindActuatorDisk (int disk_index)
std::string vsp::FindActuatorDiskByGeom (const std::string &geom_id, int surf_index)
std::string vsp::GetActuatorDiskGeomID (const std::string &disk_id)
int vsp::GetNumActuatorDisks ()
std::vector< std::string > vsp::GetActuatorDiskIDVec ()
std::string vsp::FindUnsteadyGroup (int group_index)
std::string vsp::GetUnsteadyGroupName (int group_index)
std::string vsp::GetUnsteadyGroupNameByID (const std::string &group_id)
std::vector< std::string > vsp::GetUnsteadyGroupCompIDs (int group_index)
std::vector< std::string > vsp::GetUnsteadyGroupCompIDsByID (const std::string &group_id)
std::vector< int > vsp::GetUnsteadyGroupSurfIndexes (int group_index)
std::vector< int > vsp::GetUnsteadyGroupSurfIndexesByID (const std::string &group_id)
int vsp::GetNumUnsteadyGroups ()
std::vector< std::string > vsp::GetUnsteadyGroupIDVec ()
int vsp::GetNumUnsteadyRotorGroups ()

Detailed Description

Function Documentation

◆ FindActuatorDisk()

std::string vsp::FindActuatorDisk ( int disk_index)
extern

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
string prop_id = AddGeom( "PROP", "" );
SetParmVal( prop_id, "PropMode", "Design", PROP_DISK );
SetParmVal( prop_id, "Diameter", "Design", 6.0 );
// Setup the actuator disk VSPAERO parms
string disk_id = FindActuatorDisk( 0 );
if ( disk_id.length() == 0 )
{
Print( "ERROR: FindActuatorDisk found nothing" );
__failure++;
}
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 );
void Print(const std::string &data, bool new_line=true)
@ PROP_DISK
std::string AddGeom(const std::string &type, const std::string &parent=std::string())
std::string FindParm(const std::string &parm_container_id, const std::string &parm_name, const std::string &group_name)
double SetParmVal(const std::string &parm_id, double val)
std::string FindActuatorDisk(int disk_index)
void Update(bool update_managers=true)
See also
PROP_MODE, FindActuatorDiskByGeom
Parameters
[in]disk_indexint Actuator disk index for the current VSPAERO set
Returns
string Actuator disk ID
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FindActuatorDiskByGeom()

std::string vsp::FindActuatorDiskByGeom ( const std::string & geom_id,
int surf_index )
extern

Find the actuator disk of a propeller surface.

string prop_id = AddGeom( "PROP" );
SetParmVal( prop_id, "PropMode", "Design", PROP_DISK );
if ( FindActuatorDiskByGeom( prop_id, 0 ) != FindActuatorDisk( 0 ) )
{
Print( "ERROR: FindActuatorDiskByGeom did not find the propeller's disk" );
__failure++;
}
std::string FindActuatorDiskByGeom(const std::string &geom_id, int surf_index)
See also
GetActuatorDiskGeomID, FindActuatorDisk
Parameters
[in]geom_idstring Propeller Geom ID
[in]surf_indexint Surface index of the propeller
Returns
string Actuator disk ID
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FindUnsteadyGroup()

std::string vsp::FindUnsteadyGroup ( int group_index)
extern

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

string wing_id = AddGeom( "WING" );
string pod_id = AddGeom( "POD" );
// Create an actuator disk
string prop_id = AddGeom( "PROP", "" );
SetParmVal( prop_id, "PropMode", "Design", PROP_BLADES );
// Setup the unsteady group VSPAERO parms
string disk_id = FindUnsteadyGroup( 1 ); // fixed components are in group 0 (wing & pod)
if ( disk_id.length() == 0 )
{
Print( "ERROR: FindUnsteadyGroup found nothing" );
__failure++;
}
SetParmVal( FindParm( disk_id, "RPM", "UnsteadyGroup" ), 1234.0 );
@ PROP_BLADES
std::string FindUnsteadyGroup(int group_index)
See also
PROP_MODE
Parameters
[in]group_indexint Unsteady group index for the current VSPAERO set
Returns
string Unsteady group ID
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetActuatorDiskGeomID()

std::string vsp::GetActuatorDiskGeomID ( const std::string & disk_id)
extern

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

string prop_id = AddGeom( "PROP" );
SetParmVal( prop_id, "PropMode", "Design", PROP_DISK );
if ( GetActuatorDiskGeomID( FindActuatorDisk( 0 ) ) != prop_id )
{
Print( "ERROR: GetActuatorDiskGeomID did not return the propeller" );
__failure++;
}
std::string GetActuatorDiskGeomID(const std::string &disk_id)
See also
FindActuatorDisk
Parameters
[in]disk_idstring Actuator disk ID
Returns
string Propeller Geom ID
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetActuatorDiskIDVec()

std::vector< std::string > vsp::GetActuatorDiskIDVec ( )
extern

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

string prop_id = AddGeom( "PROP" );
SetParmVal( prop_id, "PropMode", "Design", PROP_DISK );
array< string > @ids = GetActuatorDiskIDVec();
if ( ids.size() != uint( GetNumActuatorDisks() ) || ids[0] != FindActuatorDisk( 0 ) )
{
Print( "ERROR: GetActuatorDiskIDVec did not return the disks in order" );
__failure++;
}
std::vector< std::string > GetActuatorDiskIDVec()
int GetNumActuatorDisks()
See also
FindActuatorDisk
Returns
array<string> Array of actuator disk IDs
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetNumActuatorDisks()

int vsp::GetNumActuatorDisks ( )
extern

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
string prop_id = AddGeom( "PROP", "" );
SetParmValUpdate( prop_id, "PropMode", "Design", PROP_BLADES );
int num_disk = GetNumActuatorDisks(); // Should be 0
if ( num_disk != 0 )
{
Print( "ERROR: a bladed propeller counts as an actuator disk" );
__failure++;
}
SetParmValUpdate( prop_id, "PropMode", "Design", PROP_DISK );
num_disk = GetNumActuatorDisks(); // Should be 1
if ( num_disk != 1 )
{
Print( "ERROR: GetNumActuatorDisks did not count the disk" );
__failure++;
}
// The disk has to be findable at every index it claims.
for ( int i = 0; i < num_disk; i++ )
{
if ( FindActuatorDisk( i ).length() == 0 )
{
Print( "ERROR: GetNumActuatorDisks counted a disk that cannot be found" );
__failure++;
}
}
@ SET_ALL
std::string FindContainer(const std::string &name, int index)
double SetParmValUpdate(const std::string &parm_id, double val)
See also
PROP_MODE
Returns
int Number of actuator disks in the current VSPAERO set
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetNumUnsteadyGroups()

int vsp::GetNumUnsteadyGroups ( )
extern

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
string prop_id = AddGeom( "PROP" );
SetParmValUpdate( prop_id, "PropMode", "Design", PROP_DISK );
int num_group = GetNumUnsteadyGroups(); // Should be 0
if ( num_group != 0 )
{
Print( "ERROR: an actuator disk counts as an unsteady group" );
__failure++;
}
SetParmValUpdate( prop_id, "PropMode", "Design", PROP_BLADES );
num_group = GetNumUnsteadyGroups(); // Should be 1
if ( num_group != 1 )
{
Print( "ERROR: the bladed propeller was not counted" );
__failure++;
}
string wing_id = AddGeom( "WING" );
num_group = GetNumUnsteadyGroups(); // Should be 2 (includes fixed component group)
if ( num_group != 2 )
{
Print( "ERROR: the fixed component group was not counted" );
__failure++;
}
// Only the propeller is a rotor group; the wing shares the fixed group.
{
Print( "ERROR: GetNumUnsteadyGroups disagrees with GetNumUnsteadyRotorGroups" );
__failure++;
}
int GetNumUnsteadyGroups()
int GetNumUnsteadyRotorGroups()
See also
PROP_MODE, GetNumUnsteadyRotorGroups
Returns
int Number of unsteady groups in the current VSPAERO set
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetNumUnsteadyRotorGroups()

int vsp::GetNumUnsteadyRotorGroups ( )
extern

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
string prop_id = AddGeom( "PROP" );
SetParmValUpdate( prop_id, "PropMode", "Design", PROP_DISK );
int num_group = GetNumUnsteadyRotorGroups(); // Should be 0
if ( num_group != 0 )
{
Print( "ERROR: an actuator disk counts as a rotor group" );
__failure++;
}
SetParmValUpdate( prop_id, "PropMode", "Design", PROP_BLADES );
num_group = GetNumUnsteadyRotorGroups(); // Should be 1
if ( num_group != 1 )
{
Print( "ERROR: the bladed propeller was not counted" );
__failure++;
}
string wing_id = AddGeom( "WING" );
num_group = GetNumUnsteadyRotorGroups(); // Should be 1 still (fixed group not included)
if ( num_group != 1 )
{
Print( "ERROR: the wing was counted as a rotor group" );
__failure++;
}
// The wing does add a fixed component group, which the total counts.
if ( GetNumUnsteadyGroups() != num_group + 1 )
{
Print( "ERROR: the fixed component group was not counted" );
__failure++;
}
See also
PROP_MODE, GetNumUnsteadyGroups
Returns
int Number of unsteady rotor groups in the current VSPAERO set
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetUnsteadyGroupCompIDs()

std::vector< std::string > vsp::GetUnsteadyGroupCompIDs ( int group_index)
extern

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

// Add a pod and wing
string pod_id = AddGeom( "POD", "" );
string wing_id = AddGeom( "WING", pod_id ); // Default with symmetry on -> 2 surfaces
SetParmVal( wing_id, "X_Rel_Location", "XForm", 2.5 );
array < string > comp_ids = GetUnsteadyGroupCompIDs( 0 );
if ( comp_ids.size() != 3 )
{
Print( "ERROR: GetUnsteadyGroupCompIDs" );
__failure++;
}
std::vector< std::string > GetUnsteadyGroupCompIDs(int group_index)
See also
GetUnsteadyGroupSurfIndexes, GetUnsteadyGroupCompIDsByID
Parameters
[in]group_indexint Unsteady group index for the current VSPAERO set
Returns
vector <string> Array of component IDs
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetUnsteadyGroupCompIDsByID()

std::vector< std::string > vsp::GetUnsteadyGroupCompIDsByID ( const std::string & group_id)
extern

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

string wing_id = AddGeom( "WING" );
string prop_id = AddGeom( "PROP" );
array< string > @groups = GetUnsteadyGroupIDVec();
// Fixed components are in group 0, the propeller in group 1
string group_id = groups[1];
array< string > @comps = GetUnsteadyGroupCompIDsByID( group_id );
if ( comps.size() != 1 || comps[0] != prop_id )
{
Print( "ERROR: GetUnsteadyGroupCompIDsByID did not return the propeller" );
__failure++;
}
std::vector< std::string > GetUnsteadyGroupCompIDsByID(const std::string &group_id)
std::vector< std::string > GetUnsteadyGroupIDVec()
See also
GetUnsteadyGroupSurfIndexes, GetUnsteadyGroupCompIDs
Parameters
[in]group_idstring Unsteady group ID
Returns
array<string> Array of component Geom IDs
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetUnsteadyGroupIDVec()

std::vector< std::string > vsp::GetUnsteadyGroupIDVec ( )
extern

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

string wing_id = AddGeom( "WING" );
string prop_id = AddGeom( "PROP" );
array< string > @groups = GetUnsteadyGroupIDVec();
if ( groups.size() != uint( GetNumUnsteadyGroups() ) || groups[1] != FindUnsteadyGroup( 1 ) )
{
Print( "ERROR: GetUnsteadyGroupIDVec did not return the groups in order" );
__failure++;
}
See also
FindUnsteadyGroup
Returns
array<string> Array of unsteady group IDs
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetUnsteadyGroupName()

std::string vsp::GetUnsteadyGroupName ( int group_index)
extern

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
string pod_id = AddGeom( "POD", "" );
string wing_id = AddGeom( "WING", pod_id );
SetParmVal( wing_id, "X_Rel_Location", "XForm", 2.5 );
// The pod and wing are fixed components, so they share the one fixed group.
if ( GetUnsteadyGroupName( 0 ) != "Fixed_Group" )
{
Print( "ERROR: GetUnsteadyGroupName did not name the fixed component group" );
__failure++;
}
// That group holds the pod and both wing surfaces.
if ( GetUnsteadyGroupCompIDs( 0 ).size() != 3 )
{
Print( "ERROR: the fixed group does not hold the components" );
__failure++;
}
// A group index past the end has to be rejected.
if ( GetNumTotalErrors() == 0 )
{
Print( "ERROR: GetUnsteadyGroupName accepted an index past the end" );
__failure++;
}
// That error was raised deliberately, so take it back off the queue.
while ( GetNumTotalErrors() > 0 )
{
ErrorObj err = PopLastError();
}
std::string GetUnsteadyGroupName(int group_index)
See also
GetUnsteadyGroupNameByID
Parameters
[in]group_indexint Unsteady group index for the current VSPAERO set
Returns
string Unsteady group name
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetUnsteadyGroupNameByID()

std::string vsp::GetUnsteadyGroupNameByID ( const std::string & group_id)
extern

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

string wing_id = AddGeom( "WING" );
string prop_id = AddGeom( "PROP" );
array< string > @groups = GetUnsteadyGroupIDVec();
// Fixed components are in group 0, the propeller in group 1
string group_id = groups[1];
{
Print( "ERROR: GetUnsteadyGroupNameByID did not find the group" );
__failure++;
}
std::string GetUnsteadyGroupNameByID(const std::string &group_id)
See also
GetUnsteadyGroupIDVec, GetUnsteadyGroupName
Parameters
[in]group_idstring Unsteady group ID
Returns
string Unsteady group name
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetUnsteadyGroupSurfIndexes()

std::vector< int > vsp::GetUnsteadyGroupSurfIndexes ( int group_index)
extern

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

// Add a pod and wing
string pod_id = AddGeom( "POD", "" );
string wing_id = AddGeom( "WING", pod_id ); // Default with symmetry on -> 2 surfaces
SetParmVal( wing_id, "X_Rel_Location", "XForm", 2.5 );
array < int > surf_indexes = GetUnsteadyGroupSurfIndexes( 0 );
if ( surf_indexes.size() != 3 )
{
Print( "ERROR: GetUnsteadyGroupSurfIndexes" );
__failure++;
}
std::vector< int > GetUnsteadyGroupSurfIndexes(int group_index)
See also
GetUnsteadyGroupCompIDs, GetUnsteadyGroupSurfIndexesByID
Parameters
[in]group_indexint Unsteady group index for the current VSPAERO set
Returns
vector <int> Array of surface indexes
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetUnsteadyGroupSurfIndexesByID()

std::vector< int > vsp::GetUnsteadyGroupSurfIndexesByID ( const std::string & group_id)
extern

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

string wing_id = AddGeom( "WING" );
string prop_id = AddGeom( "PROP" );
array< string > @groups = GetUnsteadyGroupIDVec();
// Fixed components are in group 0, the propeller in group 1
string group_id = groups[1];
array< int > @surfs = GetUnsteadyGroupSurfIndexesByID( group_id );
array< int > @by_index = GetUnsteadyGroupSurfIndexes( 1 );
if ( surfs.size() != 1 || surfs[0] != by_index[0] )
{
Print( "ERROR: GetUnsteadyGroupSurfIndexesByID did not return the propeller's surface" );
__failure++;
}
std::vector< int > GetUnsteadyGroupSurfIndexesByID(const std::string &group_id)
See also
GetUnsteadyGroupCompIDs, GetUnsteadyGroupSurfIndexes
Parameters
[in]group_idstring Unsteady group ID
Returns
array<int> Array of surface indexes
Here is the call graph for this function:
Here is the caller graph for this function: