cape.pyover.overNamelist: OVERFLOW namelist module¶
This is a module built off of the cape.filecntl.FileCntl module
customized for manipulating Fortran namelists and customized for the
OVERFLOW input file overflow.inp. Such files are split into sections
which are called “namelists.” Each name list has syntax similar to the
following.
$FLOINP FSMACH = 4.0, ALPHA = 1.0, BETA = 0.0, $END
The main feature of this module is methods to set specific properties of a namelist file, for example the Mach number or CFL number.
See also:
- class cape.pyover.overNamelist.OverNamelist(fname='over.namelist')¶
File control class for
over.namelist- Call:
>>> nml = OverNamelist(fname="over.namelist")
- Inputs:
- fname: {
"over.namelist"} |str Name of namelist file to read
- fname: {
- Outputs:
- nml:
OverNamelist Interface to OVERFLOW input namelist
- nml:
- Version:
2016-01-31
@ddalle: v1.0
- ApplyDictToALL(opts)¶
Apply a dictionary of settings to all grids
- Call:
>>> nml.ApplyDictToALL(opts)
- Inputs:
- nml:
OverNamelist Interface to OVERFLOW input namelist
- opts:
dict Dictionary of options to apply
- nml:
- Versions:
2016-02-01
@ddalle: v1.0
- ApplyDictToGrid(grdnam, opts)¶
Apply a dictionary of settings to a grid
- Call:
>>> nml.ApplyDictToGrid(grdnam, opts)
- Inputs:
- nml:
OverNamelist Interface to OVERFLOW input namelist
- grdnam:
str|int Grid name or index
- opts:
dict Dictionary of options to apply
- nml:
- Versions:
2016-02-01
@ddalle: v1.0
- GetAlpha()¶
Return the angle of attack
- Call:
>>> alpha = nml.GetAlpha()
- Inputs:
- nml:
OverNamelist Interface to OVERFLOW input namelist
- nml:
- Outputs:
- alpha:
float Angle of attack
- alpha:
- Versions:
2016-02-01
@ddalle: v1.0
- GetBeta()¶
Get the sideslip angle
- Call:
>>> beta = nml.GetBeta()
- Inputs:
- nml:
OverNamelist Interface to OVERFLOW input namelist
- nml:
- Outputs:
- beta:
float Sideslip angle
- beta:
- Versions:
2016-02-01
@ddalle: v1.0
- GetFLOINP(key)¶
Return value of key from the $FLOINP group
- Call:
>>> val = nml.GetFLOINP(key)
- Inputs:
- nml:
OverNamelist Interface to OVERFLOW input namelist
- key:
str Name of field to query
- nml:
- Outputs:
- Versions:
2016-02-01
@ddalle
- GetGLOBAL(key)¶
Return value of key from the $GLOBAL group
- Call:
>>> val = nml.GetGLOBAL(key)
- Inputs:
- nml:
OverNamelist Interface to OVERFLOW input namelist
- key:
str Name of field to query
- nml:
- Outputs:
- Versions:
2016-02-01
@ddalle
- GetGridNames()¶
Get the list of grid names in an OVERFLOW namelist
- Call:
>>> nml.GetGridNames()
- Inputs:
- nml:
OverNamelist Interface to OVERFLOW input namelist
- nml:
- Versions:
2016-01-31
@ddalle: v1.0
- GetGridNumber(grdnam)¶
Get the number of a grid from its name
- Call:
>>> i = nml.GetGridNumberByName(grdnam)
- Inputs:
- nml:
OverNamelist Interface to OVERFLOW input namelist
- grdnam:
str Name of the grid
- nml:
- Outputs:
- i:
int Grid number
- i:
- Versions:
2016-01-31
@ddalle: v1.0
- GetGridNumberByName(grdnam)¶
Get the number of a grid from its name
- Call:
>>> i = nml.GetGridNumberByName(grdnam)
- Inputs:
- nml:
OverNamelist Interface to OVERFLOW input namelist
- grdnam:
str Name of the grid
- nml:
- Outputs:
- i:
int Grid number
- i:
- Versions:
2016-01-31
@ddalle: v1.0
- GetGroupIndexByGridName(grdnam)¶
Get the indices of the first and last list in a grid by name
- Call:
>>> jbeg, jend = nml.GetGroupIndexByGridName(grdnam)
- Inputs:
- nml:
OverNamelist Interface to OVERFLOW input namelist
- grdnam:
str Name of the grid
- nml:
- Outputs:
- Versions:
2016-01-31
@ddalle: v1.0
- GetGroupNamesByGridName(grdnam)¶
Get the list names in a grid definition
- Call:
>>> grps = nml.GetGroupNamesByGridName(grdnam)
- Inputs:
- nml:
OverNamelist Interface to OVERFLOW input namelist
- grdnam:
str Name of the grid
- nml:
- Outputs:
- Versions:
2016-01-31
@ddalle: v1.0
- GetKeyFromGrid(grdnam, grp, key, i=None)¶
Get the value of a key for a grid with a specific name
This function uses fall-through, so if a setting is not explicitly defined for grid grdnam, it will check the preceding grid, and the grid before that, etc.
- Call:
>>> val = nml.GetKeyFromGrid(grdnam, grp, key, i=None)
- Inputs:
- nml:
OverNamelist Interface to OVERFLOW input namelist
- grdnam:
str Name of the grid
- grp:
str Name of the namelist group of key to query
- key:
str Name of the key to query
- i: {
None} |':'|int Index to use in the namelist, e.g. “BCPAR(i)”
- nml:
- Outputs:
- Versions:
2016-02-01
@ddalle: v1.02016-08-29
@ddalle: Added namelist indices
- GetMach()¶
Find the current Mach number
- Call:
>>> mach = nml.GetMach()
- Inputs:
- nml:
OverNamelist Interface to OVERFLOW input namelist
- nml:
- Outputs:
- Versions:
2016-02-01
@ddalle: v1.0
- GetRestart()¶
Get the current restart flag
- Call:
>>> q = nml.GetRestart()
- Inputs:
- nml:
OverNamelist Interface to OVERFLOW input namelist
- nml:
- Outputs:
- q:
bool Whether or not to run as a restart
- q:
- Versions:
2016-02-01
@ddalle: v1.0
- GetReynoldsNumber()¶
Get the Reynolds number per unit length
- Call:
>>> Re = nml.GetReynoldsNumber()
- Inputs:
- nml:
OverNamelist Interface to OVERFLOW input namelist
- nml:
- Outputs:
- Re:
float Reynolds number per unit length
- Re:
- Versions:
2016-02-01
@ddalle: v1.0
- GetTemperature()¶
Get the freestream temperature
- Call:
>>> T = nml.GetTemperature()
- Inputs:
- nml:
OverNamelist Interface to OVERFLOW input namelist
- nml:
- Outputs:
- T:
float Freestream temperature
- T:
- Versions:
2016-02-01
@ddalle: v1.0
- GetnIter()¶
Get the number of iterations
- Call:
>>> nIter = nml.GetnIter()
- Inputs:
- nml:
OverNamelist Interface to OVERFLOW input namelist
- nml:
- Outputs:
- nIter:
int Number of iterations to run
- nIter:
- Versions:
2016-02-01
@ddalle: v1.0
- SetAlpha(alpha)¶
Set the angle of attack
- Call:
>>> nml.SetAlpha(alpha)
- Inputs:
- nml:
OverNamelist Interface to OVERFLOW input namelist
- alpha:
float Angle of attack
- nml:
- Versions:
2016-02-01
@ddalle: v1.0
- SetBeta(beta)¶
Set the sideslip angle
- Call:
>>> nml.SetBeta(beta)
- Inputs:
- nml:
OverNamelist Interface to OVERFLOW input namelist
- beta:
float Sideslip angle
- nml:
- Versions:
2016-02-01
@ddalle: v1.0
- SetFLOINP(key, val)¶
Set the value of key in the $FLOINP group
- Call:
>>> nml.SetFLOINP(key, val)
- Inputs:
- nml:
OverNamelist Interface to OVERFLOW input namelist
- key:
str Name of field to query
- val:
float|list Value of field key in group
"FLOINP"
- nml:
- Versions:
2016-02-01
@ddalle
- SetGLOBAL(key, val)¶
Set value of key from the $GLOBAL group
- Call:
>>> nml.GetGLOBAL(key, val)
- Inputs:
- nml:
OverNamelist Interface to OVERFLOW input namelist
- key:
str Name of field to query
- val:
int|bool|list Value of field key in group
"GLOBAL"
- nml:
- Versions:
2016-02-01
@ddalle
- SetKeyForGrid(grdnam, grp, key, val, i=None)¶
Set the value of a key for a grid with a specific name
- Call:
>>> nml.SetKeyForGrid(grdnam, grp, key, val, i=None)
- Inputs:
- Versions:
2016-02-01
@ddalle: v1.02016-08-29
@ddalle: Added namelist indices
- SetMach(mach)¶
Set the freestream Mach number
- Call:
>>> nml.SetMach(mach)
- Inputs:
- nml:
OverNamelist Interface to OVERFLOW input namelist
- mach:
float Mach number
- nml:
- Versions:
2016-02-01
@ddalle: v1.0
- SetRestart(q=True)¶
Set or unset restart flag
- Call:
>>> nml.SetRestart(q=True)
- Inputs:
- nml:
OverNamelist Interface to OVERFLOW input namelist
- q:
bool Whether or not to run as a restart
- nml:
- Versions:
2016-02-01
@ddalle: v1.0
- SetReynoldsNumber(Re)¶
Set the Reynolds number per unit length
- Call:
>>> nml.SetReynoldsNumber(Re)
- Inputs:
- nml:
OverNamelist Interface to OVERFLOW input namelist
- Re:
float Reynolds number per unit length
- nml:
- Versions:
2016-02-01
@ddalle: v1.0
- SetTemperature(T)¶
Set the freestream temperature
- Call:
>>> nml.SetTemperature(T)
- Inputs:
- nml:
OverNamelist Interface to OVERFLOW input namelist
- T:
float Freestream temperature
- nml:
- Versions:
2016-02-01
@ddalle: v1.0
- SetnIter(nIter)¶
Set the number of iterations
- Call:
>>> nml.SetnIter(nIter)
- Inputs:
- nml:
OverNamelist Interface to OVERFLOW input namelist
- nIter:
int Number of iterations to run
- nml:
- Versions:
2016-02-01
@ddalle: v1.0
- WriteSplitmqI(fname='splitmq.i', **kw)¶
Write a
splitmq.ifile to extract surface and second layer- Call:
>>> nml.WriteSplitmqI(fname="splitmq.i", **kw)
- Inputs:
- nml:
OverNamelist Interface to OVERFLOW input namelist
- fname: {
"splitmq.i"} |str Name of
splitmqinput file to write- qin, i: {
"q.p3d"} |str Name of the input OVERFLOW solution file
- qout, o: {
"q.save"} |str Name of output OVERFLOW file for second line of “splitmq.i”
- wall: {
True} |False Only include walls if
True; else include thrust BCs
- nml:
- Versions:
2016-12-30
@ddalle: v1.0
- cape.pyover.overNamelist.gteqi(a, b)¶
Altered greater-than-or-equal-to test for Fortran array indices
Negative indices are always considered to be greater than positive ones, and negative indices closer to zero are the largest. The general pattern is
1 < 2 < 20 < -20 < -1, and-1is the maximum possible value.
- cape.pyover.overNamelist.gti(a, b)¶
Altered greater-than test for Fortran array indices
Negative indices are always considered to be greater than positive ones, and negative indices closer to zero are the largest. The general pattern is
1 < 2 < 20 < -20 < -1, and-1is the maximum possible value.
- cape.pyover.overNamelist.lteqi(a, b)¶
Altered less-than-or-equal-to test for Fortran array indices
Negative indices are always considered to be greater than positive ones, and negative indices closer to zero are the largest. The general pattern is
1 < 2 < 20 < -20 < -1, and-1is the maximum possible value.
- cape.pyover.overNamelist.lti(a, b)¶
Altered less-than test for Fortran array indices
Negative indices are always considered to be greater than positive ones, and negative indices closer to zero are the largest. The general pattern is
1 < 2 < 20 < -20 < -1, and-1is the maximum possible value.
- cape.pyover.overNamelist.maxi(a, b)¶
Altered maximum function for array indices
Negative indices are always considered to be greater than positive ones, and negative indices closer to zero are the largest. The general pattern is
1 < 2 < 20 < -20 < -1, and-1is the maximum possible value.
- cape.pyover.overNamelist.mini(a, b)¶
Altered minimum function for array indices
Negative indices are always considered to be greater than positive ones, and negative indices closer to zero are the largest. The general pattern is
1 < 2 < 20 < -20 < -1, and-1is the maximum possible value.