cape.pyus.options.inputInp: US3D input.inp options¶
This module provides a class to interpret JSON options that are converted to
input.inp settings for FUN3D. The
module provides a class, pyUS.options.inputinpfile.InputInpOpts, which
interprets the settings of the "US3D" section of the master JSON file.
These settings are then applied to the main OVERFLOW input file, the
input.inp input file, which is in a format specific to US3D.
An example JSON setting is shown below.
"US3D": { "CFD_SOLVER": { "nstop": 30000, "ivisc": 11, "cfl": [1.1, 5.1, 10.1] }, "CFD_SOLVER_OPTS": { "chem_vibr_diso": 1.0 }, "MANAGE": { "flag": 4 } }
This will cause or partially cause changes to the sections [CFD_SOVER],
[CFD_SOLVER_OPTS], and [MANAGE] in the input.00.inp file.
The edits to input.02.inp are from the third entries of each list, so the
cfl parameter would be 10.1 instead of 1.1.
Each setting and section in the "US" section may be either present in
the template input.inp file or missing. It will be either edited or added
as appropriate, even if the specified section does not exist.
- See also:
cape.pyus.inputInpcape.pyus.us3d
- class cape.pyus.options.inputInp.InputInpOpts¶
Bases:
odictDictionary-based interface for US3D input file
input.inp- get_CFDSOLVER(j=None)¶
Return a
"CFD_SOLVER"settingsdict- Call:
>>> d = opts.get_CFDSOLVER(sec, j=None)
- Inputs:
- opts: :pyUS.options.Options`
Options interface
- j: {
None} |int Phase number
- Outputs:
- d:
cape.cfdx.options.odict Settings for that section
- d:
- Versions:
2019-06-27
@ddalle: First version
- get_CFDSOLVER_key(k, j=None)¶
Return a named parameter from the CFD_SOLVER section
- get_InputInp_key(sec, key, j=None)¶
Select an
input.inpsetting from a specified sectionRoughly, this returns
opts[sec][key].- Call:
>>> val = opts.get_namelist_key(sec, key, j=None)
- Inputs:
- Outputs:
- val: JSON-type
Value from JSON options
- Versions:
2015-10-19
@ddalle: First version2019-06-27
@ddalle: Fromget_namelist_var()
- select_InputInp(j=0)¶
Reduce
input.inpoptions to options for a single phase- Call:
>>> d = opts.select_InputInp(j=0)
- Inputs:
- opts:
pyUS.options.Options Options interface
- j: {
0} |int Phase number
- opts:
- Outputs:
- d:
cape.cfdx.options.odict Project settings for phase j
- d:
- Versions:
2019-06-27
@ddalle: First version
- set_InputInp_key(sec, key, val, j=None)¶
Set a namelist key for a specified phase or phases
Roughly, this sets
opts["US3D"][sec][key]oropts["US3D"][sec][key][i]equal to val- Call:
>>> opts.set_InputInp_key(sec, key, val, j=None)
- Inputs:
- Versions:
2017-04-05
@ddalle: First version2019-06-27
@ddalle: Fromset_namelist_var()