cape.pyover.plot3d: Interface to OVERFLOW Plot3D files

This module provides a generic Plot3D file interface for reading OVERFLOW grid system and solution files using the classes pyOver.plot3d.X and pyOver.plot3d.Q.

These classes contain customizations of the generic Plot3D grid interface cape.plot3d.X for OVERFLOW. In addition to reading the custommized header from OVERFLOW q files, it also contains special calculators such as Q.get_Cp() that calculate derived quantities from the native OVERFLOW output state variables.

See also:
class cape.pyover.plot3d.P3D(fname=None)

Base OVERFLOW Plot3D file interface

Call:
>>> q = pyOver.plot3d.P3D(fname, endian=None)
Inputs:
fname: str

Name of file to read

endian: {None} | “big” | “little”

Manually-specified byte order

Outputs:
q: pyOver.plot3d.Q

General OVERFLOW q-file interface

Versions:
  • 2016-02-26 @ddalle: First version

close()

Close a file if open

Call:
>>> q.close()
Inputs:
q: pyOver.plot3d.P3D

General OVERFLOW Plot3D file interface

Attributes:
q.f: file

File handle closed

Versions:
  • 2019-05-24 @ddalle: First version

expand_grid_indices(IG, **kw)

Expand grid indices using a variety of input methods

Portions of a grid can be extracted either by using a list of indices using the J, K, L keyword arguments, individual indices using the J, K, L keyword arguments, or start-end subsets using JS, JE, etc. The J keyword takes precedence over JS, JE if bot hare specified.

Call:
>>> J, K, L = q.expand_grid_indices(IG, **kw)
Inputs:
q: pyOver.plot3d.Q

General OVERFLOW q-file interface

IG: int

Grid number (one-based index)

Keyword arguments:
J: int | list[int]

Single grid index, j direction

JS: int

Start index, j direction

JE: int

End index, j direction

K: int | list[int]

Single grid index, k direction

KS: int

Start index, k direction

KE: int

End index, k direction

L: int | list[int]

Single grid index, l direction

LS: int

Start index, l direction

LE: int

End index, l direction

Outputs:
J: np.ndarray[int]

Array of grid indices in j direction

K: np.ndarray[int]

Array of grid indices in k direction

L: np.ndarray[int]

Array of grid indices in l direction

Versions:
  • 2016-03-07 @ddalle: First version

get_byteorder(endian=None)

Determine the proper byte order automatically if necessary

Call:
>>> q.get_byteorder(endian=None)
Inputs:
q: pyOver.plot3d.Q

General OVERFLOW q-file interface

endian: {None} | “big” | “little”

Manually-specified byte order

Versions:
  • 2016-02-26 @ddalle: First version

get_dtypes()

Save NumPy data types to prevent later look-ups

Call:
>>> q.get_dtypes()
Inputs:
q: pyOver.plot3d.Q

General OVERFLOW q-file interface

Data members:
q.itype: ‘<i4’ | ‘>i4’

Data type for integer entries

q.ftype: ‘<f8’ | ‘>f8’

Data type for floating-point entries

Versions:
  • 2016-02-26 @ddalle: First version

open()

Open a file with appropriate flags

Call:
>>> q.open()
Inputs:
q: pyOver.plot3d.P3D

General OVERFLOW Plot3D file interface

Attributes:
q.f: file

File handle open "rb"

Versions:
  • 2019-05-24 @ddalle: First version

read_float(n=None)

Read one or more floats (doubles)

Call:
>>> v = q.read_float()
>>> V = q.read_float(n)
Inputs:
q: pyOver.plot3d.Q

General OVERFLOW q-file interface

n: {None} | int > 0

Read n integers, if None, return a scalar

Outputs:
v: float

Real number read from file

V: np.ndarray[float]

Array of n real numbers

Versions:
  • 2019-05-24 @ddalle: First version

read_int(n=None)

Read one or more integers

Call:
>>> i = q.read_int()
>>> I = q.read_int(n)
Inputs:
q: pyOver.plot3d.Q

General OVERFLOW q-file interface

n: {None} | int > 0

Read n integers, if None, return a scalar

Outputs:
i: int

Integer read from file

I: np.ndarray[int]

Array of n integers

Versions:
  • 2019-05-24 @ddalle: First version

class cape.pyover.plot3d.Q(fname, endian=None)

General OVERFLOW q file interface

Call:
>>> q = pyOver.plot3d.Q(fname, endian=None)
Inputs:
fname: str

Name of file to read

endian: {None} | “big” | “little”

Manually-specified byte order

Outputs:
q: pyOver.plot3d.Q

General OVERFLOW q-file interface

Versions:
  • 2016-02-26 @ddalle: First version

GetGridDims()

Read the dimensions for each grid

Call:
>>> q.GetGridDims()
Inputs:
q: pyOver.plot3d.Q

General OVERFLOW q-file interface

Data members:
q.JD: numpy.ndarray (int size=*q.nGrid*)

J dimensions of each grid

q.KD: numpy.ndarray (int size=*q.nGrid*)

K dimensions of each grid

q.LD: numpy.ndarray (int size=*q.nGrid*)

L dimensions of each grid

q.NQ: int

Number of conserved variables plus one for gamma

q.NQC: int

Number of species concentrations, 0 if not using

Versions:
  • 2016-02-26 @ddalle: First version

GetNGrid()

Read the number of grids and determine multiple grid status

Call:
>>> nGrid = q.GetNGrid()
Inputs:
q: pyOver.plot3d.Q

General OVERFLOW q-file interface

Outputs:
nGrid: int

Number of grids

Versions:
  • 2016-02-26 @ddalle: First version

InitHeaders()

Initialize reference quantities for each grid

Call:
>>> q.InitHeaders()
Inputs:
q: pyOver.plot3d.Q

Generic OVERFLOW module

Versions:
  • 2016-02-26 @ddalle: First version

Read()

Read an OVERFLOW generic Q file

Call:
>>> q.Read()
Inputs:
q: pyOver.plot3d.Q

General OVERFLOW q-file interface

Data members:
q.nGrid: int

Number of grids

q.mGrid: bool

Whether or not file is a multiple-grid file

q.Q: list (numpy.ndarray)

List of solution arrays

Versions:
  • 2016-02-26 @ddalle: First version

ReadQData(IG=None)

Read the data

Call:
>>> q.ReadQData(IG=None)
Inputs:
q: pyOver.plot3d.Q

General OVERFLOW q-file interface

IG: int

Grid number to read, defaults to len(q.Q)+1

Data members:
q.Q[IG-1]: numpy.ndarray[float]

Solution array

Versions:
  • 2016-02-26 @ddalle: First version

ReadQHeader(IG=None)

Read header info assuming the file marker is in the correct place

Call:
>>> q.ReadQHeader(IG=None)
Inputs:
q: pyOver.plot3d.Q

Generic OVERFLOW module

IG: int

Grid number to read, defaults to len(q.Q)+1

Versions:
  • 2016-02-26 @ddalle: First version

get_Cp(IG, **kw)

Get pressure coefficients from a grid

Call:
>>> Cp = q.get_Cp(IG, **kw)
Inputs:
q: pyOver.plot3d.Q

General OVERFLOW q-file interface

IG: int

Grid number (one-based index)

Keyword arguments:
J: int | list[int]

Single grid index, j direction

JS: int

Start index, j direction

JE: int

End index, j direction

K: int | list[int]

Single grid index, k direction

KS: int

Start index, k direction

KE: int

End index, k direction

L: int | list[int]

Single grid index, l direction

LS: int

Start index, l direction

LE: int

End index, l direction

Outputs:
Cp: float | numpy.ndarray[float]

Pressure coefficient or array of pressure coefficients

See also:

expand_grid_indices()

Versions:
  • 2016-02-26 @ddalle: First version

get_M(IG, **kw)

Get Mach numbers from a grid

Call:
>>> M = q.get_M(IG, **kw)
Inputs:
q: pyOver.plot3d.Q

General OVERFLOW q-file interface

IG: int

Grid number (one-based index)

Keyword arguments:
J: int | list[int]

Single grid index, j direction

JS: int

Start index, j direction

JE: int

End index, j direction

K: int | list[int]

Single grid index, k direction

KS: int

Start index, k direction

KE: int

End index, k direction

L: int | list[int]

Single grid index, l direction

LS: int

Start index, l direction

LE: int

End index, l direction

Outputs:
M: float | numpy.ndarray[float]

Mach number or array of Mach numbers

See also:

expand_grid_indices()

Versions:
  • 2016-03-07 @ddalle: First version

get_T(IG, **kw)

Get dimensional point temperatures from a grid in degrees Rankine

Call:
>>> p = q.get_p(IG, **kw)
Inputs:
q: pyOver.plot3d.Q

General OVERFLOW q-file interface

IG: int

Grid number (one-based index)

Keyword arguments:
J: int | list[int]

Single grid index, j direction

JS: int

Start index, j direction

JE: int

End index, j direction

K: int | list[int]

Single grid index, k direction

KS: int

Start index, k direction

KE: int

End index, k direction

L: int | list[int]

Single grid index, l direction

LS: int

Start index, l direction

LE: int

End index, l direction

Outputs:
T: float | numpy.ndarray[float]

Temperature or array of temperatures [R]

See also:

expand_grid_indices()

Versions:
  • 2016-03-07 @ddalle: First version

get_p(IG, **kw)

Get dimensional point pressures from a grid in lb/ft^2

Call:
>>> p = q.get_p(IG, **kw)
Inputs:
q: pyOver.plot3d.Q

General OVERFLOW q-file interface

IG: int

Grid number (one-based index)

Keyword arguments:
J: int | list[int]

Single grid index, j direction

JS: int

Start index, j direction

JE: int

End index, j direction

K: int | list[int]

Single grid index, k direction

KS: int

Start index, k direction

KE: int

End index, k direction

L: int | list[int]

Single grid index, l direction

LS: int

Start index, l direction

LE: int

End index, l direction

Outputs:
p: float | numpy.ndarray[float]

Pressure or array of pressures [psf]

See also:

expand_grid_indices()

Versions:
  • 2016-03-07 @ddalle: First version

class cape.pyover.plot3d.X(fname, endian=None)

General OVERFLOW x file interface

Call:
>>> x = pyOver.plot3d.X(fname, endian=None)
Inputs:
fname: str

Name of file to read

endian: {None} | “big” | “little”

Manually-specified byte order

Outputs:
x: pyOver.plot3d.X

General OVERFLOW x-file interface

Versions:
  • 2016-08-31 @ddalle: First version