AVL Analysis Interface Module (AIM)
AVL Analysis Interface Module (AIM)
|
This example contains a set of *.csm and pyCAPS (*.py) inputs that uses the AVL AIM. A user should have knowledge on the generation of parametric geometry in Engineering Sketch Pad (ESP) before attempting to integrate with any AIM. Specifically, this example makes use of Design Parameters, Set Parameters, User Defined Primitive (UDP) and attributes in ESP.
The follow code details the process in a *.csm file that generates three airfoil sections to create a wing. Note to execute in serveCSM a dictionary file must be included "serveCSM -dict $ESP_ROOT/include/intent.dict avlDocExample1.csm"
First step is to define the analysis intent that the geometry is intended support.
Next we will define the design parameters to define the wing cross section and planform.
The design parameters will then be used to set parameters for use internally to create geometry.
Finally, the airfoils are created using the User Defined Primitive (UDP) naca. The inputs used for this example to the UDP are Thickness and Camber. Cross sections are in the X-Y plane and are rotated to the X-Z plane. Reference quantities must exist on any body, otherwise AVL defaults to 1.0 for Area, Span, Chord and 0.0 for X,Y,Z moment References
An example pyCAPS script that uses the above csm file to run AVL is as follows.
First the pyCAPS and os module needs to be imported.
Note if your Python major version is less than 3 (i.e. Python 2.7). The following statement should also be included so that print statements work correctly.
Once the modules have been loaded the problem needs to be initiated.
Next the *.csm file is loaded and design parameter is changed - area in the geometry. Any despmtr from the avlWing.csm file is available inside the pyCAPS script. They are: thick, camber, area, aspect, taper, sweep, washout, dihedral...
The AVL AIM is then loaded with the capsIntent set to LINEARAERO (this is consistent with the intent specified above in the *.csm file.
After the AIM is loaded the Mach number and angle of attack are set, though all AIM Inputs are available.
Once all the inputs have been set, preAnalysis needs to be executed. During this operation, all the necessary files to run AVL are generated and placed in the analysis working directory (analysisDir)
An OS system call is then made from Python to execute AVL.
A call to postAnalysis is then made to check to see if AVL executed successfully and the expected files were generated.
Similar to the AIM inputs, after the execution of AVL and postAnalysis any of the AIM's output variables (AIM Outputs) are readily available; for example,
results in
Additionally, besides making a call to the AIM outputs, sensitivity values may be obtained in the following manner,
The avlAIM supports the control surface modeling functionality inside AVL. Trailing edge control surfaces can be added to the above example by making use of the vlmControlName attribute (see AIM Attributes regarding the attribution specifics). To add a RightFlap and LeftFlap to the previous example *.csm file the naca UDP entries are augmented with the following attributes.
Note how the root airfoil contains two attributes for both the left and right flaps.
In the pyCAPS script the AIM Inputs, AVL_Control, must be defined.
Notice how the information defined in the flap variable is assigned to the vlmControlName portion of the attributes added to the *.csm file.