cape.pycart.options.configopts: Cart3Dcomponent config options

This module provides options for defining some aspects of the surface configuration for a Cart3D run. In addition to specifying a template Config.xml file for naming individual components or groups of components, the "Config" section also contains user-defined points and a set of parameters that are written to the Cart3D input file input.cntl.

This is the section in which the user specifies which components to track forces and/or moments on, and in addition it defines a moment reference point for each component.

The reference area ("RefArea") and reference length ("RefLength") parameters are also defined in this section. Cart3D does not have two separate reference lengths, so there is no "RefSpan" parameter.

Most parameters are inherited from cape.cfdx.options.confiopts.Config.

The "Xslices", "Yslices", and "Zslices" parameters are used by Cart3D to define the coordinates at which Tecplot slices are extracted. These are written to the output file cutPlanes.plt or cutPlanes.dat. Furthermore, these coordinates can be tied to user-defined points that may vary for each case in a run matrix.

The following example has a user-defined coordinate for a point that is on a component called "Fin2". Assuming there is a trajectory key that rotates "Fin2", the y-slice and z-slice coordinates will automatically be updated according to the fin position.

"Config": {
    // Define a point at the tip of a fin
    "Points": {
        "Fin2": [7.25, -0.53, 0.00]
    },
    // Write a *y* and *z* slice through the tip of the fin
    "Yslices": ["Fin2"],
    "Zslices": ["Fin2"]
}

Cart3D also contains the capability for point sensors, which record the state variables at a point, and line sensors, which provide the state at several points along a line. The line sensors are particularly useful for extracting a sonic boom signature. Both point sensors and line sensors can also be used as part of the definition of an objective function for mesh refinement. In addition, the sensors can be used to extract not only the conditions at the final iteration but also the history of relevant conditions at each iteration.

See Also:
class cape.pycart.options.configopts.ConfigOpts(*args, **kw)
add_LineSensors(val, **kw)

Get dictionary of line sensor definitions

Call:
>>> opts.add_LineSensors(LineSensors, **kw)
Inputs:
opts: ConfigOpts

options interface

LineSensors: {None} | dict

dictionary of line sensor definitions

mode: {None} | 0 | 1 | 2 | 3

Warning mode code

0:

no checks

1:

validate silently

2:

validate and show warnings

3:

raise an exception if invalid

add_PointSensors(val, **kw)

Get dictionary of point sensor definitions

Call:
>>> opts.add_PointSensors(PointSensors, **kw)
Inputs:
opts: ConfigOpts

options interface

PointSensors: {None} | object

dictionary of point sensor definitions

mode: {None} | 0 | 1 | 2 | 3

Warning mode code

0:

no checks

1:

validate silently

2:

validate and show warnings

3:

raise an exception if invalid

add_Xslices(val, **kw)

Get x-slice(s) to export

Call:
>>> opts.add_Xslices(Xslices, **kw)
Inputs:
opts: ConfigOpts

options interface

Xslices: {None} | float | str

x-slice(s) to export

mode: {None} | 0 | 1 | 2 | 3

Warning mode code

0:

no checks

1:

validate silently

2:

validate and show warnings

3:

raise an exception if invalid

add_Yslices(val, **kw)

Get y-slice(s) to export

Call:
>>> opts.add_Yslices(Yslices, **kw)
Inputs:
opts: ConfigOpts

options interface

Yslices: {None} | float | str

y-slice(s) to export

mode: {None} | 0 | 1 | 2 | 3

Warning mode code

0:

no checks

1:

validate silently

2:

validate and show warnings

3:

raise an exception if invalid

add_Zslices(val, **kw)

Get z-slice(s) to export

Call:
>>> opts.add_Zslices(Zslices, **kw)
Inputs:
opts: ConfigOpts

options interface

Zslices: {None} | float | str

z-slice(s) to export

mode: {None} | 0 | 1 | 2 | 3

Warning mode code

0:

no checks

1:

validate silently

2:

validate and show warnings

3:

raise an exception if invalid

get_ConfigForce(j=None, i=None, **kw)

Get components to only report force (not moment)

Call:
>>> Force = opts.get_ConfigForce(j=None, i=None, **kw)
Inputs:
opts: ConfigOpts

options interface

j: {None} | int

Phase index; use None to just return v

i: {None} | int | np.ndarray

opts.x index(es) to use with @expr, @map, etc.

vdef: {None} | object

Manual default

mode: {None} | 0 | 1 | 2 | 3

Warning mode code

0:

no checks

1:

validate silently

2:

validate and show warnings

3:

raise an exception if invalid

ring: {opts._optring[key]} | True | False

Override option to loop through phase inputs

listdepth: {0} | int > 0

Depth of list to treat as a scalar

x: {None} | dict

Ref conditions to use with @expr, @map, etc.; often a run matrix; used in combination with i

sample: {True} | False

Apply j, i, and other settings recursively if output is a list or dict

Outputs:
Force: {None} | list[str]

components to only report force (not moment)

get_LineSensors(j=None, i=None, **kw)

Get dictionary of line sensor definitions

Call:
>>> LineSensors = opts.get_LineSensors(j=None, i=None, **kw)
Inputs:
opts: ConfigOpts

options interface

j: {None} | int

Phase index; use None to just return v

i: {None} | int | np.ndarray

opts.x index(es) to use with @expr, @map, etc.

vdef: {None} | object

Manual default

mode: {None} | 0 | 1 | 2 | 3

Warning mode code

0:

no checks

1:

validate silently

2:

validate and show warnings

3:

raise an exception if invalid

ring: {opts._optring[key]} | True | False

Override option to loop through phase inputs

listdepth: {0} | int > 0

Depth of list to treat as a scalar

x: {None} | dict

Ref conditions to use with @expr, @map, etc.; often a run matrix; used in combination with i

sample: {True} | False

Apply j, i, and other settings recursively if output is a list or dict

Outputs:
LineSensors: {None} | dict

dictionary of line sensor definitions

get_PointSensors(j=None, i=None, **kw)

Get dictionary of point sensor definitions

Call:
>>> PointSensors = opts.get_PointSensors(j=None, i=None, **kw)
Inputs:
opts: ConfigOpts

options interface

j: {None} | int

Phase index; use None to just return v

i: {None} | int | np.ndarray

opts.x index(es) to use with @expr, @map, etc.

vdef: {None} | object

Manual default

mode: {None} | 0 | 1 | 2 | 3

Warning mode code

0:

no checks

1:

validate silently

2:

validate and show warnings

3:

raise an exception if invalid

ring: {opts._optring[key]} | True | False

Override option to loop through phase inputs

listdepth: {0} | int > 0

Depth of list to treat as a scalar

x: {None} | dict

Ref conditions to use with @expr, @map, etc.; often a run matrix; used in combination with i

sample: {True} | False

Apply j, i, and other settings recursively if output is a list or dict

Outputs:
PointSensors: {None} | object

dictionary of point sensor definitions

get_Xslices(j=None, **kw)

Return the x-slice(s) to export

Call:
>>> x = opts.get_Xslices(j=None)
Inputs:
opts: cape.cfdx.options.Options

Options interface

j: {None} | int

Index of cut plane coordinate to extract

Outputs:
x: float | np.ndarray

Cut plane coordinate(s)

Versions:
  • 2014-10-08 @ddalle: Version 1.0

  • 2022-11-01 @ddalle: Version 2.0; optdict

get_Yslices(j=None, **kw)

Return the y-slice(s) to export

Call:
>>> y = opts.get_Yslices(j=None)
Inputs:
opts: cape.cfdx.options.Options

Options interface

j: {None} | int

Index of cut plane coordinate to extract

Outputs:
y: float | np.ndarray

Cut plane coordinate(s)

Versions:
  • 2014-10-08 @ddalle: Version 1.0

  • 2022-11-01 @ddalle: Version 2.0; optdict

get_Zslices(j=None, **kw)

Return the z-slice(s) to export

Call:
>>> z = opts.get_Zslices(j=None)
Inputs:
opts: cape.cfdx.options.Options

Options interface

j: {None} | int

Index of cut plane coordinate to extract

Outputs:
z: float | np.ndarray

Cut plane coordinate(s)

Versions:
  • 2014-10-08 @ddalle: Version 1.0

  • 2022-11-01 @ddalle: Version 2.0; optdict

set_LineSensors(v, j=None, mode=None)

Get dictionary of line sensor definitions

Call:
>>> opts.set_LineSensors(LineSensors, j=None, i=None, **kw)
Inputs:
opts: ConfigOpts

options interface

LineSensors: {None} | dict

dictionary of line sensor definitions

j: {None} | int

Phase index; use None to just return v

mode: {None} | 0 | 1 | 2 | 3

Warning mode code

0:

no checks

1:

validate silently

2:

validate and show warnings

3:

raise an exception if invalid

listdepth: {0} | int > 0

Depth of list to treat as a scalar

set_PointSensors(v, j=None, mode=None)

Get dictionary of point sensor definitions

Call:
>>> opts.set_PointSensors(PointSensors, j=None, i=None, **kw)
Inputs:
opts: ConfigOpts

options interface

PointSensors: {None} | object

dictionary of point sensor definitions

j: {None} | int

Phase index; use None to just return v

mode: {None} | 0 | 1 | 2 | 3

Warning mode code

0:

no checks

1:

validate silently

2:

validate and show warnings

3:

raise an exception if invalid

listdepth: {0} | int > 0

Depth of list to treat as a scalar

set_Xslices(v, j=None, mode=None)

Get x-slice(s) to export

Call:
>>> opts.set_Xslices(Xslices, j=None, i=None, **kw)
Inputs:
opts: ConfigOpts

options interface

Xslices: {None} | float | str

x-slice(s) to export

j: {None} | int

Phase index; use None to just return v

mode: {None} | 0 | 1 | 2 | 3

Warning mode code

0:

no checks

1:

validate silently

2:

validate and show warnings

3:

raise an exception if invalid

listdepth: {0} | int > 0

Depth of list to treat as a scalar

set_Yslices(v, j=None, mode=None)

Get y-slice(s) to export

Call:
>>> opts.set_Yslices(Yslices, j=None, i=None, **kw)
Inputs:
opts: ConfigOpts

options interface

Yslices: {None} | float | str

y-slice(s) to export

j: {None} | int

Phase index; use None to just return v

mode: {None} | 0 | 1 | 2 | 3

Warning mode code

0:

no checks

1:

validate silently

2:

validate and show warnings

3:

raise an exception if invalid

listdepth: {0} | int > 0

Depth of list to treat as a scalar

set_Zslices(v, j=None, mode=None)

Get z-slice(s) to export

Call:
>>> opts.set_Zslices(Zslices, j=None, i=None, **kw)
Inputs:
opts: ConfigOpts

options interface

Zslices: {None} | float | str

z-slice(s) to export

j: {None} | int

Phase index; use None to just return v

mode: {None} | 0 | 1 | 2 | 3

Warning mode code

0:

no checks

1:

validate silently

2:

validate and show warnings

3:

raise an exception if invalid

listdepth: {0} | int > 0

Depth of list to treat as a scalar