OpenVSPAPI  3.23.0
Functions
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

string FindActuatorDisk (int disk_index)
 
int GetNumActuatorDisks ()
 
string FindUnsteadyGroup (int group_index)
 
string GetUnsteadyGroupName (int group_index)
 
string[] GetUnsteadyGroupCompIDs (int group_index)
 
int[] GetUnsteadyGroupSurfIndexes (int group_index)
 
int GetNumUnsteadyGroups ()
 
int GetNumUnsteadyRotorGroups ()
 

Detailed Description

Function Documentation

◆ FindActuatorDisk()

string FindActuatorDisk ( int  disk_index)

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", pod_id );
SetParmVal( prop_id, "PropMode", "Design", PROP_BLADES );
SetParmVal( prop_id, "Diameter", "Design", 6.0 );
// Setup the actuator disk VSPAERO parms
string disk_id = FindActuatorDisk( 0 );
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
Parameters
[in]disk_indexActuator disk index for the current VSPAERO set
Returns
Actuator disk ID

◆ FindUnsteadyGroup()

string FindUnsteadyGroup ( int  group_index)

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

// Create an actuator disk
string prop_id = AddGeom( "PROP", pod_id );
SetParmVal( prop_id, "PropMode", "Design", PROP_DISK );
// Setup the unsteady group VSPAERO parms
string disk_id = FindUnsteadyGroup( 1 ); // fixed components are in group 0 (wing & pod)
SetParmVal( FindParm( disk_id, "RPM", "UnsteadyGroup" ), 1234.0 );
See also
PROP_MODE
Parameters
[in]group_indexUnsteady group index for the current VSPAERO set
Returns
Unsteady group ID

◆ GetNumActuatorDisks()

int GetNumActuatorDisks ( )

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", pod_id );
SetParmValUpdate( prop_id, "PropMode", "Design", PROP_BLADES );
int num_disk = GetNumActuatorDisks(); // Should be 0
SetParmValUpdate( prop_id, "PropMode", "Design", PROP_DISK );
num_disk = GetNumActuatorDisks(); // Should be 1
See also
PROP_MODE
Returns
Number of actuator disks in the current VSPAERO set

◆ GetNumUnsteadyGroups()

int GetNumUnsteadyGroups ( )

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
SetParmValUpdate( prop_id, "PropMode", "Design", PROP_BLADES );
num_group = GetNumUnsteadyGroups(); // Should be 1
string wing_id = AddGeom( "WING" );
num_group = GetNumUnsteadyGroups(); // Should be 2 (includes fixed component group)
See also
PROP_MODE, GetNumUnsteadyRotorGroups
Returns
Number of unsteady groups in the current VSPAERO set

◆ GetNumUnsteadyRotorGroups()

int GetNumUnsteadyRotorGroups ( )

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
SetParmValUpdate( prop_id, "PropMode", "Design", PROP_BLADES );
num_group = GetNumUnsteadyRotorGroups(); // Should be 1
string wing_id = AddGeom( "WING" );
num_group = GetNumUnsteadyRotorGroups(); // Should be 1 still (fixed group not included)
See also
PROP_MODE, GetNumUnsteadyGroups
Returns
Number of unsteady rotor groups in the current VSPAERO set

◆ GetUnsteadyGroupCompIDs()

string [] GetUnsteadyGroupCompIDs ( int  group_index)

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 );
if ( comp_ids.size() != 3 )
{
Print( "ERROR: GetUnsteadyGroupCompIDs" );
}
See also
GetUnsteadyGroupSurfIndexes
Parameters
[in]group_indexUnsteady group index for the current VSPAERO set
Returns
Array of component IDs

◆ GetUnsteadyGroupName()

string GetUnsteadyGroupName ( int  group_index)

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

// 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 );
SetUnsteadyGroupName( 0, "PodAndWingGroup" );
if ( GetUnsteadyGroupName( 0 ) != "PodAndWingGroup" )
{
Print( "ERROR: Unsteady Group Name Functions" );
}
See also
SetUnsteadyGroupName
Parameters
[in]group_indexUnsteady group index for the current VSPAERO set
[in]nameName to set the for the unsteady group

◆ GetUnsteadyGroupSurfIndexes()

int [] GetUnsteadyGroupSurfIndexes ( int  group_index)

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 );
if ( comp_ids.size() != 3 )
{
Print( "ERROR: GetUnsteadyGroupSurfIndexes" );
}
See also
GetUnsteadyGroupCompIDs
Parameters
[in]group_indexUnsteady group index for the current VSPAERO set
Returns
Array of surface indexes
PROP_BLADES
@ PROP_BLADES
Definition: openvsp_as.h:1789
SET_ALL
@ SET_ALL
Definition: openvsp_as.h:1870
FindActuatorDisk
string FindActuatorDisk(int disk_index)
GetNumUnsteadyRotorGroups
int GetNumUnsteadyRotorGroups()
GetUnsteadyGroupSurfIndexes
int[] GetUnsteadyGroupSurfIndexes(int group_index)
GetUnsteadyGroupCompIDs
string[] GetUnsteadyGroupCompIDs(int group_index)
FindParm
string FindParm(const string &in parm_container_id, const string &in parm_name, const string &in group_name)
GetNumUnsteadyGroups
int GetNumUnsteadyGroups()
SetParmVal
double SetParmVal(const string &in parm_id, double val)
SetParmValUpdate
double SetParmValUpdate(const string &in parm_id, double val)
GetNumActuatorDisks
int GetNumActuatorDisks()
FindContainer
string FindContainer(const string &in name, int index)
array
AngelScript ScriptExtension for representing the C++ std::vector.
Definition: openvsp_as.h:252
PROP_DISK
@ PROP_DISK
Definition: openvsp_as.h:1791
Update
void Update(bool update_managers=true)
AddGeom
string AddGeom(const string &in type, const string &in parent=string())
Print
void Print(const string &in data, bool new_line=true)
GetUnsteadyGroupName
string GetUnsteadyGroupName(int group_index)
FindUnsteadyGroup
string FindUnsteadyGroup(int group_index)