OpenVSP API Documentation  3.38.0
Functions
CFD Mesh Functions

This group of functions is used to setup and run the CFD Mesh tool through the API. Click here to return to the main page. More...

Functions

void vsp::SetComputationFileName (int file_type, const std::string &file_name)
 
void vsp::ComputeCFDMesh (int set, int degenset, int file_export_types)
 
void vsp::SetCFDMeshVal (int type, double val)
 
void vsp::SetCFDWakeFlag (const std::string &geom_id, bool flag)
 
void vsp::DeleteAllCFDSources ()
 
void vsp::AddDefaultSources ()
 
void vsp::AddCFDSource (int type, const std::string &geom_id, int surf_index, double l1, double r1, double u1, double w1, double l2=0, double r2=0, double u2=0, double w2=0)
 

Detailed Description

Function Documentation

◆ AddCFDSource()

void vsp::AddCFDSource ( int  type,
const std::string &  geom_id,
int  surf_index,
double  l1,
double  r1,
double  u1,
double  w1,
double  l2 = 0,
double  r2 = 0,
double  u2 = 0,
double  w2 = 0 
)

Add a CFD Mesh default source for the indicated Geom. Note, certain input params may not be used depending on the source type

//==== Add Pod Geom ====//
string pid = AddGeom( "POD", "" );
AddCFDSource( POINT_SOURCE, pid, 0, 0.25, 2.0, 0.5, 0.5 ); // Add A Point Source
void AddCFDSource(int type, const std::string &geom_id, int surf_index, double l1, double r1, double u1, double w1, double l2=0, double r2=0, double u2=0, double w2=0)
@ POINT_SOURCE
Definition: APIDefines.h:164
std::string AddGeom(const std::string &type, const std::string &parent=std::string())
See also
CFD_MESH_SOURCE_TYPE
Parameters
[in]typeCFD Mesh source type( i.e.BOX_SOURCE )
[in]geom_idstring Geom ID
[in]surf_indexMain surface index
[in]l1Source first edge length
[in]r1Source first radius
[in]u1Source first U location
[in]w1Source first W location
[in]l2Source second edge length
[in]r2Source second radius
[in]u2Source second U location
[in]w2Source second W location

◆ AddDefaultSources()

void vsp::AddDefaultSources ( )

Add default CFD Mesh sources for all Geoms

//==== Add Pod Geom ====//
string pid = AddGeom( "POD", "" );
AddDefaultSources(); // 3 Sources: Def_Fwd_PS, Def_Aft_PS, Def_Fwd_Aft_LS
void AddDefaultSources()

◆ ComputeCFDMesh()

void vsp::ComputeCFDMesh ( int  set,
int  degenset,
int  file_export_types 
)

Create a CFD Mesh for the components in the set. This analysis cannot be run through the Analysis Manager.

//==== CFDMesh Method Facet Export =====//
SetComputationFileName( CFD_FACET_TYPE, "TestCFDMeshFacet_API.facet" );
Print( "\tComputing CFDMesh..." );
ComputeCFDMesh( SET_ALL, SET_NONE, CFD_FACET_TYPE );
void ComputeCFDMesh(int set, int degenset, int file_export_types)
void SetComputationFileName(int file_type, const std::string &file_name)
@ SET_NONE
Definition: APIDefines.h:1092
@ SET_ALL
Definition: APIDefines.h:1093
See also
COMPUTATION_FILE_TYPE
Parameters
[in]setint Set index (i.e. SET_ALL)
[in]degensetint DegenSet index (i.e. SET_NONE)
[in]file_export_typesint CFD Mesh file type to export (supports XOR i.e CFD_SRF_TYPE & CFD_STL_TYPE)

◆ DeleteAllCFDSources()

void vsp::DeleteAllCFDSources ( )

Delete all CFD Mesh sources for all Geoms

//==== Add Pod Geom ====//
string pid = AddGeom( "POD", "" );
AddCFDSource( POINT_SOURCE, pid, 0, 0.25, 2.0, 0.5, 0.5 ); // Add A Point Source
void DeleteAllCFDSources()

◆ SetCFDMeshVal()

void vsp::SetCFDMeshVal ( int  type,
double  val 
)

Set the value of a specific CFD Mesh option

void SetCFDMeshVal(int type, double val)
@ CFD_MIN_EDGE_LEN
Definition: APIDefines.h:117
See also
CFD_CONTROL_TYPE
Parameters
[in]typeint CFD Mesh control type enum (i.e. CFD_GROWTH_RATIO)
[in]valdouble Value to set

◆ SetCFDWakeFlag()

void vsp::SetCFDWakeFlag ( const std::string &  geom_id,
bool  flag 
)

Activate or deactivate the CFD Mesh wake for a particular Geom. Note, the wake flag is only applicable for wing-type surfaces. Also, this function is simply an alternative to setting the value of the Parm with the available Parm setting API functions.

//==== Add Wing Geom ====//
string wid = AddGeom( "WING", "" );
SetCFDWakeFlag( wid, true );
// This is equivalent to SetParmValUpdate( wid, "Wake", "Shape", 1.0 );
// To change the scale: SetParmValUpdate( wid, "WakeScale", "WakeSettings", 10.0 );
// To change the angle: SetParmValUpdate( wid, "WakeAngle", "WakeSettings", -5.0 );
void SetCFDWakeFlag(const std::string &geom_id, bool flag)
See also
SetParmVal, SetParmValUpdate
Parameters
[in]geom_idstring Geom ID
[in]flagTrue to activate, false to deactivate

◆ SetComputationFileName()

void vsp::SetComputationFileName ( int  file_type,
const std::string &  file_name 
)

Get the file name of a specified file type. Note, this function cannot be used to set FEA Mesh file names.

//==== Set File Name ====//
SetComputationFileName( DEGEN_GEOM_CSV_TYPE, "TestDegenScript.csv" );
//==== Run Degen Geom ====//
ComputeDegenGeom( SET_ALL, DEGEN_GEOM_CSV_TYPE );
void ComputeDegenGeom(int set, int file_export_types)
See also
COMPUTATION_FILE_TYPE, SetFeaMeshFileName
Parameters
[in]file_typeFile type enum (i.e. CFD_TRI_TYPE, COMP_GEOM_TXT_TYPE)
[in]file_nameFile name