cape.pylch.databook: Loci/CHEM data book module

This module provides interfaces to the various CFD outputs tracked by the cape package. These versions are specific to Loci/CHEM.

class cape.pylch.databook.CaseFM(comp: str, **kw)

Iterative force & moment history for one component, one case

Call:
>>> fm = CaseFM(comp=None)
Inputs:
comp: str

Name of component

Outputs:
fm: CaseFM

One-case iterative history

get_filelist() list

Get list of files to read

Call:
>>> filelist = fm.get_filelist()
Inputs:
fm: CaseFM

Component iterative history instance

Outputs:
filelist: list[str]

List of files to read to construct iterative history

Versions:
  • 2025-05-20 @ddalle: v1.0

normalize_by_cntl(cntl: Cntl, i: int)

Normalize a force & moment history using run matrix

Call:
>>> fm.normalize_by_cntl(cntl, i)
Inputs:
fm: CaseFM

Component iterative history instance

cntl: Cntl

Run matrix control instance for this case

i: int

Index of this case in run matrix

Versions:
  • 2025-05-23 @ddalle: v1.0

normalize_by_value(q: float, aref: float, lref: float)

Normalize a force & moment history using reference values

Call:
>>> fm.normalize_by_value(a, aref, lref)
Inputs:
fm: CaseFM

Component iterative history instance

q: float

Freestream dynamic pressure [Pa]

aref: float

Reference area [m^2]

lref: float

Reference length [m]

Versions:
  • 2025-05-23 @ddalle: v1.0

read_moments(db: TSVFile)

Read dimensional force & moment history

Call:
>>> fm.read_moments(db)
Inputs:
fm: CaseFM

Component iterative history instance

db: tsvfile.TSVFile

Force-only iterative history

Versions:
  • 2025-05-20 @ddalle: v1.0

readfile(fname: str) TSVFile

Read dimensional force & moment history

Call:
>>> fm.readfile(fname)
Inputs:
fm: CaseFM

Component iterative history instance

fname: str

Name of force history file to read

Versions:
  • 2025-05-20 @ddalle: v1.0

class cape.pylch.databook.CaseResid(meta: bool = False, **kw)

Iterative residual history for one case

Call:
>>> h = CaseResid()
Inputs:
comp: str

Name of component

Outputs:
h: CaseResid

One-case iterative history

get_filelist() list

Get list of files to read

Call:
>>> filelist = h.get_filelist()
Inputs:
h: CaseResid

Iterative residual history instance

Outputs:
filelist: list[str]

List of files to read for residual history

Versions:
  • 2025-05-20 @ddalle: v1.0

readfile(fname: str) TSVFile

Read a Loci/CHEM iterative history file

Call:
>>> db = h.readfile(fname)
Inputs:
fm: CaseFM

Single-component iterative history instance

fname: str

Name of file to read

Outputs:
db: tsvfile.TSVFile

Data read from fname

Versions:
  • 2025-05-20 @ddalle: v1.0