### Create a minimal example with pytornado --make-example Source: https://github.com/airinnova/pytornado/blob/master/docs/source/user_guide/getting_started.rst Run this command in a terminal to create a folder named 'pytornado' in the current directory. This folder contains a minimal working example. ```bash pytornado --make-example ``` -------------------------------- ### Install prerequisites on Linux (Ubuntu 18.04) Source: https://github.com/airinnova/pytornado/blob/master/docs/source/user_guide/installation.rst Commands to install pip for Python 3 and Numpy on Linux/Ubuntu. Numpy provides C++ header files needed for compiling pytornado. Tested with Ubuntu 18.04. ```bash sudo apt install python3-pip pip3 install --user numpy ``` -------------------------------- ### Install pytornado from source using pip Source: https://github.com/airinnova/pytornado/blob/master/docs/source/user_guide/installation.rst The command to compile and install pytornado from the source code root folder. Requires a setup.py file in the current directory. The --user flag is recommended; on Linux/Ubuntu the executable may be pip3 instead of pip. ```bash pip install --user . ``` -------------------------------- ### Simple state file example (JSON) Source: https://github.com/airinnova/pytornado/blob/master/docs/source/user_guide/input_file_state.rst A basic state file defining a single flight state. The file must be located in the 'state' directory. ```json { "airspeed": 100.0, "alpha": 5.0, "altitude": 1000.0, "beta": 0.0, "density": 1.225, "mach": 0.3, "rate_P": 0.0, "rate_Q": 0.0, "rate_R": 0.0 } ``` -------------------------------- ### Run VLM analysis with settings file Source: https://github.com/airinnova/pytornado/blob/master/docs/source/user_guide/cli.rst Use the --run argument followed by the path to the settings file to start an analysis. The project directory is automatically detected based on the provided path. ```bash pytornado --run settings/template.json ``` -------------------------------- ### Combine CLI arguments Source: https://github.com/airinnova/pytornado/blob/master/docs/source/user_guide/cli.rst Multiple arguments can be combined. This example cleans up previous results, runs in verbose mode, and executes the analysis using the specified settings file. ```bash pytornado -cvr settings/template.json ``` -------------------------------- ### APMS batch analysis state file example (JSON) Source: https://github.com/airinnova/pytornado/blob/master/docs/source/user_guide/input_file_state.rst An example state file for batch analyses (APMS) where each keyword is a list of values. Each list must have equal length; the first item of each list defines the first flight state, the second item the second, etc. Valid combinations of airspeed, altitude, mach, and density are: airspeed+density, airspeed+altitude, mach+altitude. ```json { "airspeed": [100.0, 150.0, 200.0], "alpha": [5.0, 10.0, 15.0], "altitude": [1000.0, 2000.0, 3000.0], "beta": [0.0, 0.0, 0.0], "density": [1.225, 1.0, 0.8], "mach": [0.3, 0.4, 0.5], "rate_P": [0.0, 0.0, 0.0], "rate_Q": [0.0, 0.0, 0.0], "rate_R": [0.0, 0.0, 0.0] } ``` -------------------------------- ### Configure plot settings Source: https://github.com/airinnova/pytornado/blob/master/docs/source/user_guide/input_file_settings.rst Example configuration for plot sub-keys, defining optional settings and toggling interactive display or file saving. ```json "sub-key-name": { "opt": ["some_optional_setting", "another_optional_setting"], "show": true, "save": false }, ``` -------------------------------- ### Fix pytornado command not found on Linux Source: https://github.com/airinnova/pytornado/blob/master/docs/source/user_guide/getting_started.rst If you get a 'pytornado: command not found' error, add ~/.local/bin to your PATH variable by running these commands in your terminal. ```bash echo 'PATH=$PATH:~/.local/bin' >> ~/.bashrc source ~/.bashrc ``` -------------------------------- ### Airfoil file format a (two-column coordinates) Source: https://github.com/airinnova/pytornado/blob/master/docs/source/user_guide/input_file_airfoil.rst Format a: first row is the airfoil name or comment, followed by two columns of x- and y-coordinates. Data typically starts at x = 1. ```text AIRFOIL NAME 1.00 0.00 0.80 0.05 0.60 0.10 0.40 0.10 0.20 0.05 0.00 -0.01 0.20 -0.05 0.40 -0.10 0.60 -0.10 0.80 -0.10 1.00 -0.00 ``` -------------------------------- ### Run a VLM analysis with pytornado -v --run settings/template.json Source: https://github.com/airinnova/pytornado/blob/master/docs/source/user_guide/getting_started.rst After changing into the created 'pytornado' folder, run this command to execute a VLM analysis. The -v flag enables verbose mode, and --run specifies the path to the main settings file. If successful, a plot of a simple rectangular wing is displayed. ```bash pytornado -v --run settings/template.json ``` -------------------------------- ### Project directory structure Source: https://github.com/airinnova/pytornado/blob/master/docs/source/user_guide/input_file_settings.rst The expected file structure for a PyTornado project, showing the placement of the settings, aircraft, and state files. ```text . ├── aircraft │   └── template_aircraft.json ├── airfoils ├── deformation ├── log.txt ├── _plots ├── _results ├── settings │   └── template.json └── state └── template.json ``` -------------------------------- ### Configure segment panels Source: https://github.com/airinnova/pytornado/blob/master/docs/source/user_guide/input_file_aircraft.rst Manually sets the number of spanwise (num_s) and chordwise (num_c) panels for a segment. This setting is optional. ```json "panels": { "num_s": 10, "num_c": 5 } ``` -------------------------------- ### Configure chordwise panels with panels Source: https://github.com/airinnova/pytornado/blob/master/docs/source/user_guide/input_file_aircraft.rst The panels setting is optional and allows manual definition of the number of chordwise panels for a control surface. Spanwise panel counts are automatically determined by the underlying segment. ```json "panels": { "num_c": 5 } ``` -------------------------------- ### Include Python.h header Source: https://github.com/airinnova/pytornado/blob/master/docs/source/dev_doc/c_api.rst Required to access the Python C API for data exchange between C and Python. ```c #include ``` -------------------------------- ### Configure state for CPACS analysis Source: https://github.com/airinnova/pytornado/blob/master/docs/source/user_guide/input_file_settings.rst To perform analyses based on a CPACS file, set the state field to the special keyword __CPACS. ```json "state": "__CPACS", ``` -------------------------------- ### Define Numpy API version and include arrayobject.h Source: https://github.com/airinnova/pytornado/blob/master/docs/source/dev_doc/c_api.rst Sets the Numpy API version to avoid deprecated API warnings and includes the Numpy C API definitions. ```c #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION #include ``` -------------------------------- ### Airfoil file format b (upper/lower coordinate blocks) Source: https://github.com/airinnova/pytornado/blob/master/docs/source/user_guide/input_file_airfoil.rst Format b: first row is the airfoil name or comment, second row contains two integers for the number of upper and lower coordinates. Then two blocks of x,y coordinates follow: the first for upper points, the second for lower points. ```text AIRFOIL NAME 43. 41. 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.01 0.00 0.01 0.00 0.01 0.01 0.01 0.01 0.01 0.01 0.02 0.02 0.02 0.03 0.02 0.04 0.03 0.05 0.03 0.06 0.03 0.08 0.04 0.11 0.04 0.15 0.04 0.20 0.05 0.25 0.05 0.30 0.05 0.35 0.05 0.40 0.05 0.45 0.04 0.50 0.04 0.55 0.04 0.60 0.04 0.65 0.03 0.69 0.03 0.73 0.02 0.77 0.02 0.81 0.02 0.84 0.01 0.88 0.01 0.91 0.00 0.93 0.00 0.95 0.00 0.97 0.00 0.98 0.00 0.99 0.00 0.99 0.00 1.00 0.00 0.00 0.00 0.00 -.00 0.00 -.00 0.00 -.00 0.00 -.00 0.00 -.00 0.01 -.00 0.01 -.01 0.01 -.01 0.02 -.01 0.03 -.01 0.04 -.01 0.05 -.01 0.07 -.01 0.09 -.01 0.11 -.02 0.15 -.02 0.20 -.02 0.25 -.02 0.30 -.02 0.35 -.02 0.40 -.02 0.45 -.02 0.50 -.02 0.55 -.02 0.60 -.02 0.65 -.02 0.69 -.02 0.73 -.02 0.77 -.02 0.81 -.01 0.84 -.01 0.88 -.01 0.91 -.01 0.93 -.00 0.95 -.00 0.97 -.00 0.98 -.00 0.99 -.00 0.99 -.00 1.00 -.00 ``` -------------------------------- ### Wings list structure Source: https://github.com/airinnova/pytornado/blob/master/docs/source/user_guide/input_file_aircraft.rst The structure for defining multiple wings within the aircraft configuration. ```json "wings": [ { << description of wing object 1 >> }, { << description of wing object 2 >> } ] ``` -------------------------------- ### Segments list structure Source: https://github.com/airinnova/pytornado/blob/master/docs/source/user_guide/input_file_aircraft.rst The structure for defining multiple segments within a wing object. ```json "segments": [ { << description of wing segment object 1 >> }, { << description of wing segment object 2 >> } ] ``` -------------------------------- ### Define control surface segment boundaries with segment_uid Source: https://github.com/airinnova/pytornado/blob/master/docs/source/user_guide/input_file_aircraft.rst Use the segment_uid keyword to specify the inner and outer segments that a control surface spans. Both referenced segments must exist and reside on the same wing. ```json "segment_uid": { "inner": "uid_of_the_INNER_segment", "outer": "uid_of_the_OUTER_segment" }, ``` -------------------------------- ### Convert CPACS file to JSON Source: https://github.com/airinnova/pytornado/blob/master/docs/source/user_guide/cli.rst Converts a CPACS aircraft definition file to PyTornado's native JSON format. The new file is created in the same directory and will overwrite any existing file with the same name. ```bash pytornado --cpacs2json aircraft/CPACS_file.xml ``` -------------------------------- ### Aircraft definition structure Source: https://github.com/airinnova/pytornado/blob/master/docs/source/user_guide/input_file_aircraft.rst A template showing the hierarchical structure of an aircraft definition file. ```json { "uid": "aircraft_name", "refs": { "area": 10.0, "span": 5.0, "chord": 2.0, "gcenter": [0.0, 0.0, 0.0], "rcenter": [0.0, 0.0, 0.0] }, "wings": [ { "uid": "main_wing", "symmetry": 2, "segments": [ { "uid": "segment_1", "vertices": [[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0]] } ] } ] } ``` -------------------------------- ### Structure wing control surfaces Source: https://github.com/airinnova/pytornado/blob/master/docs/source/user_guide/input_file_aircraft.rst Defines the structure for the controls list, which contains descriptions for one or more control surface objects. ```json "controls": [ { << description of wing control object 1 >> }, { << description of wing control object 2 >> } ] ``` -------------------------------- ### Define wing segment vertices Source: https://github.com/airinnova/pytornado/blob/master/docs/source/user_guide/input_file_aircraft.rst Defines a wing segment as a quadrilateral using four vertices (a, b, c, d) in 3D space. ```json "vertices": { "a": [0, 0, 0], "b": [0, 5, 0], "c": [2, 5, 0], "d": [2, 0, 0] } ``` -------------------------------- ### Define segment airfoils Source: https://github.com/airinnova/pytornado/blob/master/docs/source/user_guide/input_file_aircraft.rst Specifies inner and outer airfoils using either a NACA 4-digit string or a relative path to a coordinate file. ```json "airfoils": { "inner": "NACA2412", "outer": "airfoils/file_with_airfoil_coordinates.dat" } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.