cape.pyfun.databook
: Post-processing for FUN3D data¶
This module contains functions for reading and processing forces,
moments, and other statistics from cases in a trajectory. Data books
are usually created by using the
cape.pyfun.cntl.Cntl.ReadDataBook()
function.
# Read FUN3D control instance cntl = pyFun.Cntl("pyFun.json") # Read the data book cntl.ReadDataBook() # Get a handle DB = cntl.DataBook # Read a line load component DB.ReadLineLoad("CORE_LL") DBL = DB.LineLoads["CORE_LL"] # Read a target DB.ReadTarget("t97") DBT = DB.Targets["t97"]
Data books can be created without an overall control structure, but it
requires creating a run matrix object using
cape.pyfun.runmatrix.RunMatrix
, so it is a more involved process.
Data book modules are also invoked during update and reporting command-line calls.
$ pyfun --aero $ pyfun --ll $ pyfun --pt $ pyfun --triqfm $ pyfun --report
The available components mirror those described on the template data
book modules, cape.cfdx.databook
, cape.cfdx.lineload
, and
cape.cfdx.pointsensor
. However, some data book types may not be
implemented for all CFD solvers.
- See Also:
cape.cfdx.dataBook
cape.options.databookopts
- class cape.pyfun.databook.CaseFM(proj: str, comp: str, **kw)¶
Iterative force & moment histories for one case, one component
This class contains methods for reading data about an the history of an individual component for a single casecntl. It reads the Tecplot file
$proj_fm_$comp.dat
where proj is the lower-case root project name and comp is the name of the component. From this file it determines which coefficients are recorded automatically.- Call:
>>> fm = CaseFM(proj, comp)
- Inputs:
- Outputs:
- fm:
CaseFM
Instance of the force and moment class
- fm:
- Versions:
2014-11-12
@ddalle
: v0.1; starter version2015-10-16
@ddalle
: v1.02016-05-05
@ddalle
: v1.1; handle adaptive cases2016-10-28
@ddalle
: v1.2; catch iteration resets
- get_flow_folder() str ¶
Get the working folder for primal solutions
This will be either
""
(base dir) or"Flow"
- Call:
>>> workdir = fm.get_flow_folder()
- Inputs:
- fm:
CaseFM
Force & moment iterative history
- fm:
- Outputs:
- workdir:
""
|"Flow"
Current working folder for primal (flow) solutions
- workdir:
- Versions:
2024-01-23
@ddalle
: v1.0
- class cape.pyfun.databook.CaseResid(proj: str, runner: CaseRunner, **kw)¶
FUN3D iterative history class
This class provides an interface to residuals, CPU time, and similar data for a given case
- Call:
>>> hist = CaseResid(proj)
- Inputs:
- proj:
str
Project root name
- proj:
- Outputs:
- hist:
cape.pyfun.databook.CaseResid
Instance of the run history class
- hist:
- PlotR1(**kw)¶
Plot the density
- Call:
>>> h = hist.PlotR1(n=None, nFirst=None, nLast=None, **kw)
- Inputs:
- Outputs:
- h:
dict
Dictionary of figure/plot handles
- h:
- Versions:
2015-10-21
@ddalle
: v1.0
- PlotTurbResid(**kw)¶
Plot the turbulence residual
- Call:
>>> h = hist.PlotTurbResid(n=None, nFirst=None, nLast=None, **kw)
- Inputs:
- Outputs:
- h:
dict
Dictionary of figure/plot handles
- h:
- Versions:
2015-10-21
@ddalle
: v1.0
- get_flow_folder() str ¶
Get the working folder for primal solutions
This will be either
""
(base dir) or"Flow"
- Call:
>>> workdir = fm.get_flow_folder()
- Inputs:
- fm:
CaseFM
Force & moment iterative history
- fm:
- Outputs:
- workdir:
""
|"Flow"
Current working folder for primal (flow) solutions
- workdir:
- Versions:
2024-01-23
@ddalle
: v1.0
- readfile_subiter(fname: str) dict ¶
Read a Tecplot sub-iterative history file
These files, e.g.
{PROJECT}_subhist.dat
, are written when the solver is in time-accurate mode.- Call:
>>> db = fm.readfile_subhist(fname, di)
- Inputs:
- Outputs:
- db:
tsvfile.TSVTecDatFile
Data read from fname
- db:
- Versions:
2024-01-23
@ddalle
: v1.0 (readfile_subhist)2024-02-21
@ddalle
: v2.0
- class cape.pyfun.databook.CaseTS(proj: str, comp: str, **kw)¶
-
- get_flow_folder() str ¶
Get the working folder for primal solutions
This will be either
""
(base dir) or"Flow"
- Call:
>>> workdir = fm.get_flow_folder()
- Inputs:
- fm:
CaseFM
Force & moment iterative history
- fm:
- Outputs:
- workdir:
""
|"Flow"
Current working folder for primal (flow) solutions
- workdir:
- Versions:
2024-01-23
@ddalle
: v1.0