This group of functions provides API control of cross-sections (XSecs). Airfoils are a type of XSec included in this group as well. API functions for Body of Revolution XSecs are included in the Specialized Geometry group. Click here to return to the main page. More...
Functions | |
void | vsp::CutXSec (const std::string &geom_id, int index) |
void | vsp::CopyXSec (const std::string &geom_id, int index) |
void | vsp::PasteXSec (const std::string &geom_id, int index) |
void | vsp::InsertXSec (const std::string &geom_id, int index, int type) |
int | vsp::GetXSecShape (const std::string &xsec_id) |
double | vsp::GetXSecWidth (const std::string &xsec_id) |
double | vsp::GetXSecHeight (const std::string &xsec_id) |
void | vsp::SetXSecWidthHeight (const std::string &xsec_id, double w, double h) |
void | vsp::SetXSecWidth (const std::string &xsec_id, double w) |
void | vsp::SetXSecHeight (const std::string &xsec_id, double h) |
std::vector< std::string > | vsp::GetXSecParmIDs (const std::string &xsec_id) |
std::string | vsp::GetXSecParm (const std::string &xsec_id, const std::string &name) |
std::vector< vec3d > | vsp::ReadFileXSec (const std::string &xsec_id, const std::string &file_name) |
void | vsp::SetXSecPnts (const std::string &xsec_id, std::vector< vec3d > &pnt_vec) |
vec3d | vsp::ComputeXSecPnt (const std::string &xsec_id, double fract) |
vec3d | vsp::ComputeXSecTan (const std::string &xsec_id, double fract) |
void | vsp::ResetXSecSkinParms (const std::string &xsec_id) |
void | vsp::SetXSecContinuity (const std::string &xsec_id, int cx) |
void | vsp::SetXSecTanAngles (const std::string &xsec_id, int side, double top, double right, double bottom, double left) |
void | vsp::SetXSecTanSlews (const std::string &xsec_id, int side, double top, double right, double bottom, double left) |
void | vsp::SetXSecTanStrengths (const std::string &xsec_id, int side, double top, double right, double bottom, double left) |
void | vsp::SetXSecCurvatures (const std::string &xsec_id, int side, double top, double right, double bottom, double left) |
void | vsp::ReadFileAirfoil (const std::string &xsec_id, const std::string &file_name) |
void | vsp::SetAirfoilUpperPnts (const std::string &xsec_id, const std::vector< vec3d > &up_pnt_vec) |
void | vsp::SetAirfoilLowerPnts (const std::string &xsec_id, const std::vector< vec3d > &low_pnt_vec) |
void | vsp::SetAirfoilPnts (const std::string &xsec_id, const std::vector< vec3d > &up_pnt_vec, const std::vector< vec3d > &low_pnt_vec) |
std::vector< vec3d > | vsp::GetHersheyBarLiftDist (const int &npts, const double &alpha, const double &Vinf, const double &span, bool full_span_flag=false) |
std::vector< vec3d > | vsp::GetHersheyBarDragDist (const int &npts, const double &alpha, const double &Vinf, const double &span, bool full_span_flag=false) |
std::vector< vec3d > | vsp::GetVKTAirfoilPnts (const int &npts, const double &alpha, const double &epsilon, const double &kappa, const double &tau) |
std::vector< double > | vsp::GetVKTAirfoilCpDist (const double &alpha, const double &epsilon, const double &kappa, const double &tau, std::vector< vec3d > xyz_data) |
std::vector< vec3d > | vsp::GetEllipsoidSurfPnts (const vec3d ¢er, const vec3d &abc_rad, int u_npts=20, int w_npts=20) |
std::vector< vec3d > | vsp::GetFeatureLinePnts (const string &geom_id) |
std::vector< double > | vsp::GetEllipsoidCpDist (const std::vector< vec3d > &surf_pnt_vec, const vec3d &abc_rad, const vec3d &V_inf) |
std::vector< vec3d > | vsp::GetAirfoilUpperPnts (const std::string &xsec_id) |
std::vector< vec3d > | vsp::GetAirfoilLowerPnts (const std::string &xsec_id) |
std::vector< double > | vsp::GetUpperCSTCoefs (const std::string &xsec_id) |
std::vector< double > | vsp::GetLowerCSTCoefs (const std::string &xsec_id) |
int | vsp::GetUpperCSTDegree (const std::string &xsec_id) |
int | vsp::GetLowerCSTDegree (const std::string &xsec_id) |
void | vsp::SetUpperCST (const std::string &xsec_id, int deg, const std::vector< double > &coefs) |
void | vsp::SetLowerCST (const std::string &xsec_id, int deg, const std::vector< double > &coefs) |
void | vsp::PromoteCSTUpper (const std::string &xsec_id) |
void | vsp::PromoteCSTLower (const std::string &xsec_id) |
void | vsp::DemoteCSTUpper (const std::string &xsec_id) |
void | vsp::DemoteCSTLower (const std::string &xsec_id) |
void | vsp::FitAfCST (const std::string &xsec_surf_id, int xsec_index, int deg) |
void | vsp::WriteBezierAirfoil (const std::string &file_name, const std::string &geom_id, const double &foilsurf_u) |
void | vsp::WriteSeligAirfoil (const std::string &file_name, const std::string &geom_id, const double &foilsurf_u) |
std::vector< vec3d > | vsp::GetAirfoilCoordinates (const std::string &geom_id, const double &foilsurf_u) |
vec3d vsp::ComputeXSecPnt | ( | const std::string & | xsec_id, |
double | fract | ||
) |
Compute 3D coordinate for a point on an XSec curve given the parameter value (U) along the curve
[in] | xsec_id | string XSec ID |
[in] | fract | double Curve parameter value (range: 0 - 1) |
vec3d vsp::ComputeXSecTan | ( | const std::string & | xsec_id, |
double | fract | ||
) |
Compute the tangent vector of a point on an XSec curve given the parameter value (U) along the curve
[in] | xsec_id | string XSec ID |
[in] | fract | double Curve parameter value (range: 0 - 1) |
void vsp::CopyXSec | ( | const std::string & | geom_id, |
int | index | ||
) |
Copy a cross-section from the specified geometry and maintain it in memory
[in] | geom_id | string Geom ID |
[in] | index | XSec index |
void vsp::CutXSec | ( | const std::string & | geom_id, |
int | index | ||
) |
Cut a cross-section from the specified geometry and maintain it in memory
[in] | geom_id | string Geom ID |
[in] | index | XSec index |
void vsp::DemoteCSTLower | ( | const std::string & | xsec_id | ) |
Demote the CST for the lower airfoil surface. The XSec must be of type XS_CST_AIRFOIL
[in] | xsec_id | XSec ID |
void vsp::DemoteCSTUpper | ( | const std::string & | xsec_id | ) |
Demote the CST for the upper airfoil surface. The XSec must be of type XS_CST_AIRFOIL
[in] | xsec_id | XSec ID |
void vsp::FitAfCST | ( | const std::string & | xsec_surf_id, |
int | xsec_index, | ||
int | deg | ||
) |
Fit a CST airfoil for an existing airfoil of type XS_FOUR_SERIES, XS_SIX_SERIES, XS_FOUR_DIGIT_MOD, XS_FIVE_DIGIT, XS_FIVE_DIGIT_MOD, XS_ONE_SIX_SERIES, or XS_FILE_AIRFOIL.
[in] | xsec_surf_id | XsecSurf ID |
[in] | xsec_index | XSec index |
[in] | deg | CST degree |
std::vector< vec3d > vsp::GetAirfoilCoordinates | ( | const std::string & | geom_id, |
const double & | foilsurf_u | ||
) |
Get the untwisted unit-length 2D coordinate points for the specified airfoil
[in] | geom_id | string Geom ID |
[in] | foilsurf_u | U location (range: 0 - 1) along the surface. The foil surface does not include root and tip caps (i.e. 2 section wing -> XSec0 @ u=0, XSec1 @ u=0.5, XSec2 @ u=1.0) |
std::vector<vec3d> vsp::GetAirfoilLowerPnts | ( | const std::string & | xsec_id | ) |
Get the coordinate points for the lower surface of an airfoil. The XSec must be of type XS_FILE_AIRFOIL
[in] | xsec_id | string XSec ID |
std::vector<vec3d> vsp::GetAirfoilUpperPnts | ( | const std::string & | xsec_id | ) |
Get the coordinate points for the upper surface of an airfoil. The XSec must be of type XS_FILE_AIRFOIL
[in] | xsec_id | string XSec ID |
std::vector<double> vsp::GetEllipsoidCpDist | ( | const std::vector< vec3d > & | surf_pnt_vec, |
const vec3d & | abc_rad, | ||
const vec3d & | V_inf | ||
) |
Generate Analytical Solution for Potential Flow for specified ellipsoid shape at input surface points for input velocity vector. Based on Munk, M. M., 'Remarks on the Pressure Distribution over the Surface of an Ellipsoid, Moving Translationally Through a Perfect Fluid,' NACA TN-196, June 1924. Function initially created to compare VSPAERO results to theory.
[in] | surf_pnt_vec | vector<vec3d> Vector of points on the ellipsoid surface to assess |
[in] | abc_rad | vec3d Radius along the A (X), B (Y), and C (Z) axes |
[in] | V_inf | vec3d 3D components of freestream velocity |
std::vector<vec3d> vsp::GetEllipsoidSurfPnts | ( | const vec3d & | center, |
const vec3d & | abc_rad, | ||
int | u_npts = 20 , |
||
int | w_npts = 20 |
||
) |
Generate the surface coordinate points for a ellipsoid at specified center of input radius along each axis. Based on the MATLAB function ellipsoid (https://in.mathworks.com/help/matlab/ref/ellipsoid.html).
[in] | center | 3D location of the ellipsoid center |
[in] | abc_rad | Radius along the A (X), B (Y), and C (Z) axes |
[in] | u_npts | Number of points in the U direction |
[in] | w_npts | Number of points in the W direction |
std::vector<vec3d> vsp::GetFeatureLinePnts | ( | const string & | geom_id | ) |
Get the points along the feature lines of a particular Geom
[in] | geom_id | string Geom ID |
std::vector<vec3d> vsp::GetHersheyBarDragDist | ( | const int & | npts, |
const double & | alpha, | ||
const double & | Vinf, | ||
const double & | span, | ||
bool | full_span_flag = false |
||
) |
Get the theoretical drag (Cd) distribution for a Hershey Bar wing with unit chord length using Glauert's Method. This function was initially created to compare VSPAERO results to Lifting Line Theory. If full_span_flag is set to true symmetry is applied to the results.
[in] | npts | Number of points along the span to assess |
[in] | alpha | Wing angle of attack (Radians) |
[in] | Vinf | Freestream velocity |
[in] | span | Hershey Bar full-span. Note, only half is used in the calculation |
[in] | full_span_flag | Flag to apply symmetry to results (default: false) |
std::vector<vec3d> vsp::GetHersheyBarLiftDist | ( | const int & | npts, |
const double & | alpha, | ||
const double & | Vinf, | ||
const double & | span, | ||
bool | full_span_flag = false |
||
) |
Get the theoretical lift (Cl) distribution for a Hershey Bar wing with unit chord length using Glauert's Method. This function was initially created to compare VSPAERO results to Lifting Line Theory. If full_span_flag is set to true symmetry is applied to the results.
[in] | npts | Number of points along the span to assess |
[in] | alpha | Wing angle of attack (Radians) |
[in] | Vinf | Freestream velocity |
[in] | span | Hershey Bar full-span. Note, only half is used in the calculation |
[in] | full_span_flag | Flag to apply symmetry to results |
std::vector<double> vsp::GetLowerCSTCoefs | ( | const std::string & | xsec_id | ) |
Get the CST coefficients for the lower surface of an airfoil. The XSec must be of type XS_CST_AIRFOIL
[in] | xsec_id | string XSec ID |
int vsp::GetLowerCSTDegree | ( | const std::string & | xsec_id | ) |
Get the CST degree for the lower surface of an airfoil. The XSec must be of type XS_CST_AIRFOIL
[in] | xsec_id | XSec ID |
std::vector<double> vsp::GetUpperCSTCoefs | ( | const std::string & | xsec_id | ) |
Get the CST coefficients for the upper surface of an airfoil. The XSec must be of type XS_CST_AIRFOIL
[in] | xsec_id | string XSec ID |
int vsp::GetUpperCSTDegree | ( | const std::string & | xsec_id | ) |
Get the CST degree for the upper surface of an airfoil. The XSec must be of type XS_CST_AIRFOIL
[in] | xsec_id | string XSec ID |
std::vector<double> vsp::GetVKTAirfoilCpDist | ( | const double & | alpha, |
const double & | epsilon, | ||
const double & | kappa, | ||
const double & | tau, | ||
std::vector< vec3d > | xyz_data | ||
) |
Get the pressure coefficient (Cp) along a Von Kármán-Trefftz airfoil of specified shape at specified points along the airfoil
[in] | alpha | double Airfoil angle of attack (Radians) |
[in] | epsilon | double Airfoil thickness |
[in] | kappa | double Airfoil camber |
[in] | tau | double Airfoil trailing edge angle (Radians) |
[in] | xyz_data | vector<vec3d> Vector of points on the airfoil to evaluate |
std::vector<vec3d> vsp::GetVKTAirfoilPnts | ( | const int & | npts, |
const double & | alpha, | ||
const double & | epsilon, | ||
const double & | kappa, | ||
const double & | tau | ||
) |
Get the 2D coordinates an input number of points along a Von K�rm�n-Trefftz airfoil of specified shape
[in] | npts | Number of points along the airfoil to return |
[in] | alpha | Airfoil angle of attack (Radians) |
[in] | epsilon | Airfoil thickness |
[in] | kappa | Airfoil camber |
[in] | tau | Airfoil trailing edge angle (Radians) |
double vsp::GetXSecHeight | ( | const std::string & | xsec_id | ) |
Get the height of an XSec. Note that POINT type XSecs have a width and height of 0, regardless of what width and height it is set to.
[in] | xsec_id | XSec ID |
std::string vsp::GetXSecParm | ( | const std::string & | xsec_id, |
const std::string & | name | ||
) |
Get a specific Parm ID from an Xsec
[in] | xsec_id | XSec ID |
[in] | name | Parm name |
std::vector<std::string> vsp::GetXSecParmIDs | ( | const std::string & | xsec_id | ) |
Get all Parm IDs for specified XSec Parm Container
[in] | xsec_id | XSec ID |
int vsp::GetXSecShape | ( | const std::string & | xsec_id | ) |
Get the shape of an XSec
[in] | xsec_id | XSec ID |
double vsp::GetXSecWidth | ( | const std::string & | xsec_id | ) |
Get the width of an XSec. Note that POINT type XSecs have a width and height of 0, regardless of what width and height it is set to.
[in] | xsec_id | XSec ID |
void vsp::InsertXSec | ( | const std::string & | geom_id, |
int | index, | ||
int | type | ||
) |
Insert a cross-section of particular type to the specified geometry after the given index
[in] | geom_id | string Geom ID |
[in] | index | XSec index |
[in] | type | XSec type enum (i.e. XS_GENERAL_FUSE) |
void vsp::PasteXSec | ( | const std::string & | geom_id, |
int | index | ||
) |
void vsp::PromoteCSTLower | ( | const std::string & | xsec_id | ) |
Promote the CST for the lower airfoil surface. The XSec must be of type XS_CST_AIRFOIL
[in] | xsec_id | XSec ID |
void vsp::PromoteCSTUpper | ( | const std::string & | xsec_id | ) |
Promote the CST for the upper airfoil surface. The XSec must be of type XS_CST_AIRFOIL
[in] | xsec_id | XSec ID |
void vsp::ReadFileAirfoil | ( | const std::string & | xsec_id, |
const std::string & | file_name | ||
) |
Read in XSec shape from airfoil file and set to the specified XSec. The XSec must be of type XS_FILE_AIRFOIL. Airfoil files may be in Lednicer or Selig format with *.af or *.dat extensions.
[in] | xsec_id | XSec ID |
[in] | file_name | Airfoil XSec file name |
std::vector<vec3d> vsp::ReadFileXSec | ( | const std::string & | xsec_id, |
const std::string & | file_name | ||
) |
Read in XSec shape from fuselage (*.fsx) file and set to the specified XSec. The XSec must be of type XS_FILE_FUSE.
[in] | xsec_id | XSec ID |
[in] | file_name | Fuselage XSec file name |
void vsp::ResetXSecSkinParms | ( | const std::string & | xsec_id | ) |
Reset all skinning Parms for a specified XSec. Set top, bottom, left, and right strengths, slew, angle, and curvature to 0. Set all symmetry and equality conditions to false.
[in] | xsec_id | string XSec ID |
void vsp::SetAirfoilLowerPnts | ( | const std::string & | xsec_id, |
const std::vector< vec3d > & | low_pnt_vec | ||
) |
Set the lower points for an airfoil. The XSec must be of type XS_FILE_AIRFOIL.
[in] | xsec_id | XSec ID |
[in] | low_pnt_vec | Array of points defining the lower surface of the airfoil |
void vsp::SetAirfoilPnts | ( | const std::string & | xsec_id, |
const std::vector< vec3d > & | up_pnt_vec, | ||
const std::vector< vec3d > & | low_pnt_vec | ||
) |
Set the upper and lower points for an airfoil. The XSec must be of type XS_FILE_AIRFOIL.
[in] | xsec_id | XSec ID |
[in] | up_pnt_vec | Array of points defining the upper surface of the airfoil |
[in] | low_pnt_vec | Array of points defining the lower surface of the airfoil |
void vsp::SetAirfoilUpperPnts | ( | const std::string & | xsec_id, |
const std::vector< vec3d > & | up_pnt_vec | ||
) |
Set the upper points for an airfoil. The XSec must be of type XS_FILE_AIRFOIL.
[in] | xsec_id | XSec ID |
[in] | up_pnt_vec | Array of points defining the upper surface of the airfoil |
void vsp::SetLowerCST | ( | const std::string & | xsec_id, |
int | deg, | ||
const std::vector< double > & | coefs | ||
) |
Set the CST degree and coefficients for the lower surface of an airfoil. The number of coefficients should be one more than the CST degree. The XSec must be of type XS_CST_AIRFOIL
[in] | xsec_id | string XSec ID |
[in] | deg | int CST degree of lower airfoil surface |
[in] | coefs | vector<double> Vector of CST coefficients for the lower airfoil surface |
void vsp::SetUpperCST | ( | const std::string & | xsec_id, |
int | deg, | ||
const std::vector< double > & | coefs | ||
) |
Set the CST degree and coefficients for the upper surface of an airfoil. The number of coefficients should be one more than the CST degree. The XSec must be of type XS_CST_AIRFOIL
[in] | xsec_id | string XSec ID |
[in] | deg | int CST degree of upper airfoil surface |
[in] | coefs | vector<double> Vector of CST coefficients for the upper airfoil surface |
void vsp::SetXSecContinuity | ( | const std::string & | xsec_id, |
int | cx | ||
) |
Set C-type continuity enforcement for a particular XSec
[in] | xsec_id | string XSec ID |
[in] | cx | int Continuity level (0, 1, or 2) |
void vsp::SetXSecCurvatures | ( | const std::string & | xsec_id, |
int | side, | ||
double | top, | ||
double | right, | ||
double | bottom, | ||
double | left | ||
) |
Set curvatures for the specified XSec
[in] | xsec_id | XSec ID |
[in] | side | Side type enum (i.e. XSEC_BOTH_SIDES) |
[in] | top | Top curvature |
[in] | right | Right curvature |
[in] | bottom | Bottom curvature |
[in] | left | Left curvature |
void vsp::SetXSecHeight | ( | const std::string & | xsec_id, |
double | h | ||
) |
Set the height of an XSec. Note that POINT type XSecs have a width and height of 0, regardless of what is input to SetXSecHeight.
[in] | xsec_id | XSec ID |
[in] | h | Xsec height |
void vsp::SetXSecPnts | ( | const std::string & | xsec_id, |
std::vector< vec3d > & | pnt_vec | ||
) |
Set the coordinate points for a specific XSec. The XSec must be of type XS_FILE_FUSE.
[in] | xsec_id | string XSec ID |
[in] | pnt_vec | vector<vec3d> Vector of XSec coordinate points |
void vsp::SetXSecTanAngles | ( | const std::string & | xsec_id, |
int | side, | ||
double | top, | ||
double | right, | ||
double | bottom, | ||
double | left | ||
) |
Set the tangent angles for the specified XSec
[in] | xsec_id | string XSec ID |
[in] | side | int Side type enum (i.e. XSEC_BOTH_SIDES) |
[in] | top | double Top angle (degrees) |
[in] | right | double Right angle (degrees) |
[in] | bottom | double Bottom angle (degrees) |
[in] | left | double Left angle (degrees) |
void vsp::SetXSecTanSlews | ( | const std::string & | xsec_id, |
int | side, | ||
double | top, | ||
double | right, | ||
double | bottom, | ||
double | left | ||
) |
Set the tangent slew angles for the specified XSec
[in] | xsec_id | XSec ID |
[in] | side | Side type enum (i.e. XSEC_BOTH_SIDES) |
[in] | top | Top angle (degrees) |
[in] | right | Right angle (degrees) |
[in] | bottom | Bottom angle (degrees) |
[in] | left | Left angle (degrees) |
void vsp::SetXSecTanStrengths | ( | const std::string & | xsec_id, |
int | side, | ||
double | top, | ||
double | right, | ||
double | bottom, | ||
double | left | ||
) |
Set the tangent strengths for the specified XSec
[in] | xsec_id | XSec ID |
[in] | side | Side type enum (i.e. XSEC_BOTH_SIDES) |
[in] | top | Top strength |
[in] | right | Right strength |
[in] | bottom | Bottom strength |
[in] | left | Left strength |
void vsp::SetXSecWidth | ( | const std::string & | xsec_id, |
double | w | ||
) |
Set the width of an XSec. Note that POINT type XSecs have a width and height of 0, regardless of what is input to SetXSecWidth.
[in] | xsec_id | XSec ID |
[in] | w | Xsec width |
void vsp::SetXSecWidthHeight | ( | const std::string & | xsec_id, |
double | w, | ||
double | h | ||
) |
Set the width and height of an XSec. Note, if the XSec is an EDIT_CURVE type and PreserveARFlag is true, the input width value will be ignored and instead set from on the input height and aspect ratio. Use SetXSecWidth and SetXSecHeight directly to avoid this.
[in] | xsec_id | XSec ID |
[in] | w | Xsec width |
[in] | h | Xsec height |
void vsp::WriteBezierAirfoil | ( | const std::string & | file_name, |
const std::string & | geom_id, | ||
const double & | foilsurf_u | ||
) |
Write out the untwisted unit-length 2D Bezier curve for the specified airfoil in custom *.bz format. The output will describe the analytical shape of the airfoil. See BezierAirfoilExample.m and BezierCtrlToCoordPnts.m for examples of discretizing the Bezier curve and generating a Selig airfoil file.
[in] | file_name | Airfoil (*.bz) output file name |
[in] | geom_id | string Geom ID |
[in] | foilsurf_u | U location (range: 0 - 1) along the surface. The foil surface does not include root and tip caps (i.e. 2 section wing -> XSec0 @ u=0, XSec1 @ u=0.5, XSec2 @ u=1.0) |
void vsp::WriteSeligAirfoil | ( | const std::string & | file_name, |
const std::string & | geom_id, | ||
const double & | foilsurf_u | ||
) |
Write out the untwisted unit-length 2D coordinate points for the specified airfoil in Selig format. Coordinate points follow the on-screen wire frame W tessellation.
[in] | file_name | Airfoil (*.dat) output file name |
[in] | geom_id | string Geom ID |
[in] | foilsurf_u | U location (range: 0 - 1) along the surface. The foil surface does not include root and tip caps (i.e. 2 section wing -> XSec0 @ u=0, XSec1 @ u=0.5, XSec2 @ u=1.0) |