CAPE Documentation¶
Welcome to CAPE, a computational aerosciences processing environment for efficient interaction with several high-fidelity aerodynamics codes. This includes tools for pre-processing, executing the codes, performing post-processing tasks, and creating finished databases. The approach of Cape is to provide tools that make users more efficient at some or all of the modeling and analysis process. It may be useful to use CAPE for just one step of a particular user’s project, or it may be useful to use it for the entire process.
Installation is done using the standard Python packaging tool
pip
.
Most users really would rather evaluate new tools by seeing some examples, so here are the links to the example pages for the main solvers:
Currently, CAPE has interfaces for Cart3D, OVERFLOW, and FUN3D.
The Cart3D interface, cape.pycart
has been used for several NASA
projects. One example was the creation of an aerodynamic database for booster
separation for the Space Launch System, which included over 10,000 different
adaptive Cart3D runs in a 12-dimensional run matrix.
The FUN3D interface, cape.pyfun
, reuses most of the code used to build
cape.pycart
; and the OVERFLOW interface, cape.pyover
was
constructed in a similar manner. All modules are built off of common tools in
the cape
and cape.cfdx
modulew, and so much of the usage is
common between the two interfaces. These interfaces can be used to run
OVERFLOW/FUN3D, interact with databases, and archive or clean up solutions.
There is a Python interface to solution files including easy dimensionalization
of state variables.
In addition to running CFD codes, CAPE contains a package called
cape.attdb
for cleaning and processing numerical databases whether the
original data comes from CFD or not. The key tool from this package is the
class
which can read CSV files, other ASCII text data files, MATLAB .mat
files,
Excel spreadsheets, and more.
Each CFD interface is a portmanteau of “Python” and the name of the solver. The
command-line interface is invoked with the commands pycart
, pyfun
, and
pyover
. In addition, there are several scripts matching the glob
p?_*.py
and for isolated tasks such as converting grid formats, and there
is a run_*.py
script for running the appropriate tasks for a single case of
each CFD interface.
Cape Inputs and JSON Files Inputs to Cape can be given as either command-line arguments, input files associated with the CFD solver, or JSON files. JSON is a simple but flexible format similar to XML. There are interpreters for many languages.
Common CAPE Capabilities The following bullet list of capabilities is common to all interfaces including any that will be added in the future.
Automatically create parametrically-named folders for cases in a matrix
Copy input files to run folders and edit them according to run matrix variables and multiple phases of global input settings
Create PBS scripts and submit them automatically
Built-in variables such as Mach number, angle of attack, sideslip, Reynolds number, and temperature
Automated averaging of iterative histories and statistics for databases
Automated reports using LaTeX (usually supports Tecplot and ParaView images)
pyCart Capabilities The Cart3D interface, pyCart, has quite a few capabilities. Some highlights and critical aspects are listed below.
Copy Cart3D input files to run files and edit them according to run matrix variables and global input settings
Simplified interface for refining initial volume mesh using component names
Rotate components (such as fins or separating bodies) using Euler angles or a hinge axis
Automated reports of iterative histories and Tecplot layouts
Interface for custom functions for more advanced run matrix variables such as thrust settings
The basic usage for this module is to create a file called pyCart.json
and use the script pycart
. In addition to this control file for pyCart,
several other Cart3D input files (or, more accurately, input template files)
can be provided or interfaced. The names below are canonical names; it is
possible to use other file names when setting up configurations.
Cart3D input control file,
input.cntl
Surface triangulation file,
Components.i.tri
Surface triangulation component names,
Config.xml
If an adaptive run, an adaptive run script,
aero.csh
Run matrix, either specified within
pyCart.json
or a file
pyFun Capabilities The FUN3D interface, pyFun, is newer and has somewhat fewer capabilities, although most of the database and reporting capabilities are inherited from pyCart. Some capabilities are highlighted below.
Copy FUN3D input files to run files and edit them according to run matrix variables and global input settings
Interface with AFLR3 for volume mesh generation, which can be used to have multiple bodies in different relative positions for each case in a run matrix
Interface to Chimera Grid Tools
triload
to calculate sectional loads
The basic usage for this module is to create a file called pyFun.json
and use the script pyfun
. The required FUN3D input files are described
below.
FUN3D run settings template,
fun3d.nml
Mesh file; a recommended format is AFLR3,
*.ugrid
Boundary condition file,
*.mapbc
Run matrix, either specified within
pyFun.json
or a file
pyOver Capabilities The OVERFLOW interface, pyOver, is also new but will have a rapidly expanding set of capabilities. Much of the database and report capabilities are inherited from pyCart. Some highlights are below.
Copy OVERFLOW input namelists and edit them according to run matrix variables and multiple phases of input settings
Highly generalized interface to OVERFLOW namelists that doesn’t need great amounts of user preparation
Built-in interface to OVERFLOW q files with simple access to coefficients and dimensional states
The basic usage for this module involves a file pyOver.json
, and the
primary script is pyover
. Required input files depend on whether the case
is being run in DCF or Pegasus5 mode. In this module, the user is responsible
for informing pyOver which mesh files are required, although a default list is
defined. In general the required files are the following.
OVERFLOW namelist template,
overflow.inp
Mesh files, usually in the
common/
folderRun Matrix, either within
pyOver.json
or in a CSV-like file
- 1. Requirements and Installation
- 2. About This Documentation
- 3. Usage and Common Settings
- 4. pyCart Documentation
- 5. pyFun Documentation
- 6. pyOver Documentation
- 7. CAPE Executables
- 7.1. pycart: Python interface for Cart3D
- 7.2. pyfun: Python interface for FUN3D
- 7.3. pyover: Python interface for OVERFLOW
- 7.4.
dkit
: Command-Line Interface to datakit tools - 7.5.
dkit-quickstart
: Create template for a new datakit package - 7.6.
dkit-vendorize
: Vendorize one or more packages - 7.7.
dkit-writedb
: Read raw data to create formatted datakit files - 7.8.
run_flowCart.py
: Run Cart3D for one phase - 7.9.
run_fun3d.py
: Run FUN3D for one phase - 7.10.
run_overflow.py
: Run FUN3D for one phase - 7.11. cape: Python interface for CFDX
- 7.12.
cape-writell
: Combine CAPE line load data into MAT file - 7.13.
cape-step2crv
: Convert STEP file to Plot3D multiple curve file - 7.14.
cape-steptri2crv
: Extract TRI file nodes on STEP curves - 7.15.
cape-uh3d2tri
: Convert UH3D triangulation to Cart3D format - 7.16.
cape-tri2plt
: Convert Triangulation to Tecplot PLT Format - 7.17.
cape-tri2uh3d
: Convert Cart3D Triangulation to UH3D Format - 7.18.
cape-tri2surf
: Convert surf triangulation to AFLR3 format - 7.19.
cape-expandjson
: Expand a JSON file and remove comments - 7.20.
pyfun-plt2triq
: Convert FUN3D Tecplot file to Cart3D tri file - 7.21.
triqfm
: Calculate forces and moments on a.triq
file
API Documenattion
- Introduction to CAPE Application Program Interface
- The
cape
module
cape.cfdx
: Templates for CFD control toolscape.filecntl
: Interfaces for text control filescape.argread
: Command-Line Argument Processorcape.atm
: Atmosphere Modelscape.cgns
: CGNS file interfacecape.cntl
: Base module for CFD operations and processingcape.color
: Color conversion toolscape.config
: Surface configuration modulecape.convert
: Unit and angle conversion utilitiescape.geom
: Generic geometry utilitiescape.io
: Binary file input/output toolscape.manage
: Manage CFD case folderscape.msh
: FLUENT mesh modulecape.plot3d
: Python interface to Plot3D filescape.plt
: Python interface to Tecplot PLT filescape.runmatrix
: Run matrix interfacecape.step
: Python interface to STEP Filescape.tar
: Semiautomatic folder archivingcape.text
: Module to print docstrings to STDOUTcape.tri
: Surface triangulation modulecape.tricli
: Interfaces to.tri
and related filescape.units
: Unit Conversion Modulecape.util
: Cape utilitiescape.writell
: Collect CAPE line load databookscape.xmlfile
: Extended interface to XML files_cape3
: Compiled CAPE extension- The
cape.pycart
module
cape.pycart.cntl
: Cart3D control modulecape.pycart.options
: Cart3D and pyCart Settingscape.pycart.case
: Case Control Modulecape.pycart.tri
: Cart3D Triangulation Modulecape.pycart.bin
: Cart3D executable interface modulecape.pycart.cmd
: Create commands for Cart3D executablescape.pycart.inputCntl
: Cart3Dinput.cntl
interfacecape.pycart.aeroCsh
: Cart3Daero.csh
interfacecape.pycart.preSpecCntl
: Cart3D preSpec.c3d.cntl Interfacecape.pycart.dataBook
: pyCart data book modulecape.pycart.lineLoad
: Sectional loads modulecape.pycart.pointSensor
: Cart3D point sensors modulecape.pycart.report
: Automated report interfacecape.pycart.manage
: Manage pyCart case folderscape.pycart.util
: Utilities for pyCart- The
cape.pyfun
module
cape.pyfun.cntl
: FUN3D control modulecape.pyfun.options
: FUN3D and pyFun settingscape.pyfun.case
: FUN3D case control modulecape.namelist
: FUN3D namelist modulecape.pyfun.mapbc
: FUN3D boundary condition modulecape.pyfun.faux
: FAUXGeom interface modulecape.pyfun.rubberData
: FUN3D filerubber.data
cape.pyfun.bin
: FUN3D binary interface modulecape.pyfun.cmd
: Create commands for FUN3D executablescape.pyfun.dataBook
: pyFun data book modulecape.pyfun.lineLoad
: Sectional loads modulecape.pyfun.pointSensor
: FUN3D point sensors modulecape.pyfun.plt
: Interface to FUN3D Tecplot PLT filescape.pyfun.report
: Automated report interfacecape.pyfun.manage
: Manage pyFun case folderscape.pyfun.tricli
: Special FUN3D triangulation interfacescape.pyfun.util
: Utilities for pyFun- The
cape.pyover
module
cape.pyover.cntl
: OVERFLOW control modulecape.pyover.options
: OVERFLOW and pyOver Settingscape.pyover.overNamelist
: OVERFLOW namelist modulecape.pyover.case
: OVERFLOW base control modulecape.pyover.bin
: OVERFLOW binary interface modulecape.pyover.cmd
: Create commands for OVERFLOW executablescape.pyover.plot3d
: Interface to OVERFLOW Plot3D filescape.pyover.dataBook
: pyOver data book modulecape.pyover.lineLoad
: Sectional loads modulecape.pyover.report
: Automated report interfacecape.pyover.manage
: Manage pyOver case folderscape.pyover.util
: Utilities for pyOvercape.attdb
: Package for “datakits”: database + toolkit
cape.attdb.rdb
: Main DataKit modulecape.attdb.datakithub
: Hub for importing DataKits by namecape.attdb.datakitloader
: Tools for reading DataKits from a collectioncape.attdb.dbfm
: Aerodynamics force & moment datakitscape.attdb.dbll
: Aerodynamic line load datakitscape.attdb.froot
: Nonlinear equation solvercape.attdb.ftypes
: Data file type interfacescape.tnakit.pkgutils
: Tools for creating DataKit packagescape.attdb.rdbaero
: Database Template for Aerospace Variablescape.attdb.vendorutils
: Package Vendorization Utilitiescape.attdb.writedb
: Write DataKit processed data to filecape.tnakit
: Basic TNA Python tool kit
cape.tnakit.arrayutils
: Tools for NumPy arrayscape.tnakit.kwutils
: Tools for Processing Keyword Argumentscape.tnakit.metautils
: Tools for module metadata databasescape.tnakit.modutils
: Module documentation utilitiescape.tnakit.optitem
: Option list item access toolscape.tnakit.plot_mpl
: Matplotlib/Pyplot Interfacescape.tnakit.promptutils
: Interactive Console Promptcape.tnakit.rstutils
: Tools for writing ReST filescape.tnakit.statutils
: Statistics toolscape.tnakit.textutils.wrap
: Text-wrapping toolkitcape.tnakit.typeutils
: Python 2/3 type-check utilsTesting
Authors
@ddalle
: Derek Dalle <derek.j.dalle@nasa.gov>
@serogers
: Stuart Rogers <stuart.e.rogers@nasa.gov>
@jmeeroff
: Jamie Meeroff <jamie.g.meeroff@nasa.gov>
@aburkhea
: Aaron Burkhead <aaron.c.burkhead@nasa.gov>
@dschauer
: Guy Schauerhamer <daniel.g.schauerhamer@nasa.gov>
Contributing
Notices
Copyright © 2022 United States Government as represented by the Administrator of the National Aeronautics and Space Administration. All Rights Reserved.
Disclaimers
No Warranty: THE SUBJECT SOFTWARE IS PROVIDED “AS IS” WITHOUT ANY WARRANTY OF ANY KIND, EITHER EXPRESSED, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTY THAT THE SUBJECT SOFTWARE WILL CONFORM TO SPECIFICATIONS, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR FREEDOM FROM INFRINGEMENT, ANY WARRANTY THAT THE SUBJECT SOFTWARE WILL BE ERROR FREE, OR ANY WARRANTY THAT DOCUMENTATION, IF PROVIDED, WILL CONFORM TO THE SUBJECT SOFTWARE. THIS AGREEMENT DOES NOT, IN ANY MANNER, CONSTITUTE AN ENDORSEMENT BY GOVERNMENT AGENCY OR ANY PRIOR RECIPIENT OF ANY RESULTS, RESULTING DESIGNS, HARDWARE, SOFTWARE PRODUCTS OR ANY OTHER APPLICATIONS RESULTING FROM USE OF THE SUBJECT SOFTWARE. FURTHER, GOVERNMENT AGENCY DISCLAIMS ALL WARRANTIES AND LIABILITIES REGARDING THIRD-PARTY SOFTWARE, IF PRESENT IN THE ORIGINAL SOFTWARE, AND DISTRIBUTES IT “AS IS.”
Waiver and Indemnity: RECIPIENT AGREES TO WAIVE ANY AND ALL CLAIMS AGAINST THE UNITED STATES GOVERNMENT, ITS CONTRACTORS AND SUBCONTRACTORS, AS WELL AS ANY PRIOR RECIPIENT. IF RECIPIENT’S USE OF THE SUBJECT SOFTWARE RESULTS IN ANY LIABILITIES, DEMANDS, DAMAGES, EXPENSES OR LOSSES ARISING FROM SUCH USE, INCLUDING ANY DAMAGES FROM PRODUCTS BASED ON, OR RESULTING FROM, RECIPIENT’S USE OF THE SUBJECT SOFTWARE, RECIPIENT SHALL INDEMNIFY AND HOLD HARMLESS THE UNITED STATES GOVERNMENT, ITS CONTRACTORS AND SUBCONTRACTORS, AS WELL AS ANY PRIOR RECIPIENT, TO THE EXTENT PERMITTED BY LAW. RECIPIENT’S SOLE REMEDY FOR ANY SUCH MATTER SHALL BE THE IMMEDIATE, UNILATERAL TERMINATION OF THIS AGREEMENT.