cape.pycart.tri: Cart3D .tri file interface¶
This module provides the utilities for interacting with Cart3D
triangulations or several other file formats with similar contents. This
includes annotated triangulations (including .triq files).
Triangulations can be read from a variety of formats, which are tabulated below.
Extension
Description
.triCart3D tri format, can be ASCII, Fortran unformatted (big- or little-endian), or C-style stream
.triqAnnotated Cart3D tri format, any format. This format contains a number of state variables at each point in addition to the geometry information
.uh3dUH3D format, similar to
.tribut names for faces
.surfAFLR3 surface mesh; can include quads
.unvIDEAS format; very strange
In addition to the main functions inherited from
cape.trifile.TriBase, the cape.trifile.Triq class has a few
methods that are particular to the state variables saved in Cart3D.
Cart3D also utilizes the GMP format to associate names with the faces of
component ID numbers. This is an XML format (standard name for the file
is Config.xml) that associates a name for each of the component IDs
in a triangulation. In addition, groups of component IDs can be given a
name by defining “Parent” components in the XML file. Reading a
triangulation with such a configuration can be done with the following
commands.
import cape.tri tri = cape.trifile.Tri("Components.i.tri", c="Config.xml")
Note that Cart3D’s interpretation of the XML file is very strict. There cannot be any component IDs mentioned in the XML file that are not present in the TRI file. In addition, there is no way for a component to have multiple parents. For example, it is not possible to have a group that contains fins 1 and 2 while another group contains fins 1 and 3.
The module consists of individual classes that are built off of a base
triangulation class cape.trifile.TriBase. Methods that are written for
the TriBase class apply to all other classes as well.
- See Also:
cape.tri
- class cape.pycart.trifile.Tri(fname=None, c=None, **kw)¶
- class cape.pycart.trifile.Triq(fname=None, n=1, nNode=None, Nodes=None, c=None, nTri=None, Tris=None, CompID=None, nq=None, q=None)¶
- ApplyAngularVelocity(xcg, w, Lref=1.0, M=None)¶
Perturb surface pressures with a normalized rotation rate
This is based on a method from Stalnaker:
Stalnaker, J. F. “Rapid Computation of Dynamic Stability Derivatives.” 42nd AIAA Aerospace Sciences Meeting and Exhibit. 2004. AIAA Paper 2004-210. doi:10.2514/6.2004-210
- Call:
>>> triq.ApplyAngularVelocity(xcg, w, Lref=1.0, M=None)
- Inputs:
- triq:
Triq Triangulation instance
- xcg:
np.ndarray|list Center of gravity or point about which body rotates
- w:
np.ndarray|list Angular velocity divided by Lref times freestream soundspeed
- Lref:
float Reference length used for reduced angular velocity
- M:
float Freestream Mach number for updating Cp
- triq:
- Versions:
2016-01-23
@ddalle: First version
- ApplyAngularVelocityLinear(xcg, w, Lref=1.0, M=None)¶
Perturb surface pressures with a normalized rotation rate
This is based on a method from Stalnaker:
Stalnaker, J. F. “Rapid Computation of Dynamic Stability Derivatives.” 42nd AIAA Aerospace Sciences Meeting and Exhibit. 2004. AIAA Paper 2004-210. doi:10.2514/6.2004-210
- Call:
>>> triq.ApplyAngularVelocityLinear(xcg, w, Lref=1.0, M=None)
- Inputs:
- triq:
Triq Triangulation instance
- xcg:
np.ndarray|list Center of gravity or point about which body rotates
- w:
np.ndarray|list Angular velocity divided by Lref times freestream soundspeed
- Lref:
float Reference length used for reduced angular velocity
- M:
float Freestream Mach number for updating Cp
- triq:
- Versions:
2016-01-23
@ddalle: First version