cape.pyfun.namelist¶
This is a module built off of the cape.nmlfile.namelist module
customized for manipulating FUN3D’s namelist files. Such files are
split into sections which are called “namelists.” Each namelist has
syntax similar to the following.
&project project_rootname = "pyfun" case_title = "Test case" /
and this module is designed to recognize such sections. The main feature of this module is methods to set specific properties of a namelist file, for example the Mach number or CFL number.
Namelists are the primary FUN3D input file, and one is written for each
phase of a FUN3D case. The namelist files prepared using this module
are written to fun3d.00.nml, fun3d.01.nml, etc. These must be
linked to a hard-coded file name fun3d.nml as appropriate for the
currently running phase.
See also:
cape.nmlfile
cape.pyfun.GetNamelist()
- class cape.pyfun.namelist.Namelist(*args, **kw)¶
File control class for
fun3d.nml- Call:
>>> nml = Namelist() >>> nml = Namelist(fname)
- Inputs:
- fname:
str Name of namelist file to read, defaults to
'fun3d.nml'
- fname:
- Version:
2015-10-15
@ddalle: v0.1; started2015-12-31
@ddalle: v1.0; usingfilecntl.namelist2023-06-15
@ddalle: v2.0; usenmlfile
- GetAdaptRootname()¶
Get the post-adaptation project root name
- GetGridFormat()¶
Get the mesh file extention
- GetMach()¶
Find the current Mach number
- GetNFlowInitVolumes()¶
Get the current number of flow initialization volumes
- GetRootname()¶
Get the project root name
- SetAdaptRootname(name)¶
Set the post-adaptation project root name
- SetAlpha(alpha)¶
Set the angle of attack
- SetBeta(beta)¶
Set the sideslip angle
- SetDensity(rho)¶
Set the freestream density
- SetMach(mach)¶
Set the freestream Mach number
- SetNFlowInitVolumes(n)¶
Set the number of flow initialization volumes
- SetRestart(q=True, nohist=False)¶
Set the FUN3D restart flag on or off
- Call:
>>> nml.SetRestart(q=True, nohist=False)
- Inputs:
- nml:
Namelist Interface to
fun3d.nmlfile- q: {
True} |False|None Restart option,
Noneturns flag to"on"- nohist:
True| {False} If true, use ‘on_nohistorykept’ for ‘restart_read’
- nml:
- Versions:
2015-11-03
@ddalle: v1.02023-06-15
@ddalle: v2.0; switch tonmlfile
- SetReynoldsNumber(Re)¶
Set the Reynolds number per unit length
- SetRootname(name)¶
Set the project root name
- SetTemperature(T)¶
Set the freestream temperature
- SetTemperatureUnits(units=None)¶
Set the temperature units
- SetVelocity(V)¶
Set the freestream velocity magnitude