Basic Usage Overview¶
OptVL
offers a Python API mirroring AVL's text interface.
The typical workflow involves loading a geometry file, adding constraints, and executing analysis runs.
In addition to this, though, OptVL also offers unique optimization functionality.
Below is an example of a basic analysis run, to give you an idea of the workflow.
from optvl import OVLSolver
ovl = OVLSolver(geo_file="aircraft.avl", debug=False)
# look at the geometry to see that everything is right
ovl.plot_geom()
# set the angle of attack
ovl.set_constraint("alpha", 0.00)
# set the deflection of the elevator to trim the pitching moment
ovl.set_constraint("Elevator", 0.00, con_var="Cm pitch moment")
ovl.set_parameter("Mach", 0.3)
# This is the method that acutally runs the analysis
ovl.execute_run()
# print data about the run
force_data = ovl.get_total_forces()
print(
f'CL:{force_data["CL"]:10.6f} CD:{force_data["CD"]:10.6f} CM:{force_data["CM"]:10.6f}'
)
# lets look at the cp countours
ovl.plot_cp()
The script will plot the geometry, set parameters, run an analysis, and then show a CP surface plot.
The geometry plot should look like this
and the CP surface plot should look like this
You can rotate, zoom, and pan in the window to look at different parts for the aircraft.
Limitations¶
- OptVL does not support multiple run cases
- No support for the DESIGN keyword for setting twist in the avl geometry file since we use a different system for modifying all aspects of the geometry.
- OptVL on Windows can only use a maximum of 5000 vortices compared to the default of 6000.