cape.pyfun.namelist: FUN3D namelist module

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:

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'

Version:
  • 2015-10-15 @ddalle: v0.1; started

  • 2015-12-31 @ddalle: v1.0; using filecntl.namelist

  • 2023-06-15 @ddalle: v2.0; use nmlfile

GetAdaptRootname()

Get the post-adaptation project root name

Call:
>>> name = nml.GetAdaptRootname()
Inputs:
nml: Namelist

Interface to fun3d.nml file

Outputs:
name: str

Name of adapted project

Versions:
  • 2015-12-31 @ddalle: v1.0

  • 2023-06-15 @ddalle: v2.0; switch to nmlfile

GetGridFormat()

Get the mesh file extention

Call:
>>> fext = nml.GetGridFormat()
Inputs:
nml: Namelist

Interface to fun3d.nml file

Outputs:
fext: {"b8.ugrid"} | str

Mesh file extension

Versions:
  • 2016-04-05 @ddalle: v1.0

  • 2023-06-15 @ddalle: v2.0; switch to nmlfile

GetMach()

Find the current Mach number

Call:
>>> mach = nml.GetMach()
Inputs:
nml: Namelist

Interface to fun3d.nml file

Outputs:
mach: float

Mach number specified in input.cntl

Versions:
  • 2014-06-10 @ddalle: v1.0

  • 2023-06-15 @ddalle: v2.0; switch to nmlfile

GetNFlowInitVolumes()

Get the current number of flow initialization volumes

Call:
>>> n = nml.GetNFlowInitVolumes()
Inputs:
nml: Namelist

Interface to fun3d.nml file

Outputs:
n: int

Number of flow initialization volumes

Versions:
  • 2016-03-29 @ddalle: v1.0

  • 2023-06-15 @ddalle: v2.0; switch to nmlfile

GetRootname()

Get the project root name

Call:
>>> name = nml.GetRootname()
Inputs:
nml: Namelist

Interface to fun3d.nml file

Outputs:
name: str

Name of project

Versions:
  • 2015-10-18 @ddalle: v1.0

  • 2023-06-15 @ddalle: v2.0; switch to nmlfile

SetAdaptRootname(name)

Set the post-adaptation project root name

Call:
>>> nml.SetAdaptRootname(name)
Inputs:
nml: Namelist

Interface to fun3d.nml file

name: str

Name of adapted project

Versions:
  • 2015-12-31 @ddalle: v1.0

  • 2023-06-15 @ddalle: v2.0; switch to nmlfile

SetAlpha(alpha)

Set the angle of attack

Call:
>>> nml.SetAlpha(alpha)
Inputs:
nml: Namelist

Interface to fun3d.nml file

alpha: float

Angle of attack

Versions:
  • 2015-10-15 @ddalle: v1.0

  • 2023-06-15 @ddalle: v2.0; switch to nmlfile

SetBeta(beta)

Set the sideslip angle

Call:
>>> nml.SetBeta(beta)
Inputs:
nml: Namelist

Interface to fun3d.nml file

beta: float

Sideslip angle

Versions:
  • 2014-06-04 @ddalle: v1.0

  • 2023-06-15 @ddalle: v2.0; switch to nmlfile

SetDensity(rho)

Set the freestream density

Call:
>>> nml.SetDensity(rho)
Inputs:
nml: Namelist

Interface to fun3d.nml file

rho: float

Freestream density [kg/m^3]

Versions:
  • 2018-04-19 @ddalle: v1.0

  • 2023-06-15 @ddalle: v2.0; switch to nmlfile

SetMach(mach)

Set the freestream Mach number

Call:
>>> nml.SetMach(mach)
Inputs:
nml: Namelist

Interface to fun3d.nml file

mach: float

Mach number

Versions:
  • 2015-10-15 @ddalle: v1.0

  • 2023-06-15 @ddalle: v2.0; switch to nmlfile

SetNFlowInitVolumes(n)

Set the number of flow initialization volumes

Call:
>>> nml.SetNFlowInitVolumes(n)
Inputs:
nml: Namelist

Interface to fun3d.nml file

n: int

Number of flow initialization volumes

Versions:
  • 2016-03-29 @ddalle: v1.0

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.nml file

q: {True} | False | None

Restart option, None turns flag to "on"

nohist: True | {False}

If true, use ‘on_nohistorykept’ for ‘restart_read’

Versions:
  • 2015-11-03 @ddalle: v1.0

  • 2023-06-15 @ddalle: v2.0; switch to nmlfile

SetReynoldsNumber(Re)

Set the Reynolds number per unit length

Call:
>>> nml.SetReynoldsNumber(Re)
Inputs:
nml: Namelist

Interface to fun3d.nml file

Re: float

Reynolds number per unit length

Versions:
  • 2015-10-15 @ddalle: v1.0

  • 2023-06-15 @ddalle: v2.0; switch to nmlfile

SetRootname(name)

Set the project root name

Call:
>>> nml.SetRootname(name)
Inputs:
nml: Namelist

Interface to fun3d.nml file

name: str

Name of project

Versions:
  • 2015-12-31 @ddalle: v1.0

  • 2023-06-15 @ddalle: v2.0; switch to nmlfile

SetTemperature(T)

Set the freestream temperature

Call:
>>> nml.SetTemperature(T)
Inputs:
nml: Namelist

Interface to fun3d.nml file

T: float

Freestream temperature

Versions:
  • 2015-10-15 @ddalle: v1.0

  • 2023-06-15 @ddalle: v2.0; switch to nmlfile

SetTemperatureUnits(units=None)

Set the temperature units

Call:
>>> nml.SetTemperatureUnits(units)
Inputs:
nml: Namelist

Interface to fun3d.nml file

units: str

Units, defaults to "Rankine"

Versions:
  • 2015-10-15 @ddalle: v1.0

  • 2023-06-15 @ddalle: v2.0; switch to nmlfile

SetVelocity(V)

Set the freestream velocity magnitude

Call:
>>> nml.SetTemperature(T)
Inputs:
nml: Namelist

Interface to fun3d.nml file

V: float

Magnitude of freestream velocity [m/s]

Versions:
  • 2018-04-19 @ddalle: v1.0

  • 2023-06-15 @ddalle: v2.0; switch to nmlfile

SetnIter(nIter)

Set the number of iterations

Call:
>>> nml.SetnIter(nIter)
Inputs:
nml: Namelist

Interface to fun3d.nml file

nIter: int

Number of iterations to run

Versions:
  • 2015-10-20 @ddalle: v1.0

  • 2023-06-15 @ddalle: v2.0; switch to nmlfile