It is not necessary to install OpenVSP on your machine for this example, since most of the analysis input and output data can also be accessed by opening the files in a simple text editor.However, you will need to install OpenVSP if you want to run the component code locally since we will be using the OpenVSP python API in the next section.
The compute.py module makes use of the OpenVSP python API to read the model files, to apply the input values to the model, to setup and execute the VSPAERO analysis and to recover the analysis outputs.
The API is contained in the vsp object that is imported at the top of the file (import openvsp as vsp).
Copy the contents of the setup.py, compute.py, Cessna-210_metric.vsp3 and Cessna-210_metric.des files from below into a text editor, save them locally.Then upload the first 2 files under the Properties tab and upload the .vsp3 and .des files under the Parameters tab by selecting upload user input files.
This is a simple analytical implicit component that calculates the force and pitching moment residuals at the aircraft CG.The inputs are the lift and pitching moment coefficients from the vspaero component and the flight velocity (Vinfinity).Fixed parameters include the aircraft total mass, flight altitude and wing reference area (S).
The driver component is identical to the OpenMDAO component used in the Simple optimisation problem example, except for the driver parameters (defined on the Parameters tab), which have been adjusted for this problem:
Next, close the Run log and select the open-mdao component.Then select the Log tab and click on download files snapshot.The outputs folder should include the n2 diagram (shown below), the driver log file (useful to check Newton solver convergence), one results file per driver thread in JSON format and results plots in .png format.
The figure below shows the L/D variation obtained.The maximum L/D cruise velocity occurs between 55m/s and 60m/s.As expected, the maximum L/D increases with increasing half-wing aspect ratio and the maximum L/D cruise velocity decreases.
c80f0f1006