rpvars#

Client-side service allowing access and modification of rpvars.

The primary interaction with Fluent should not be through low-level variables like rpvars but instead through the high-level object-based interfaces: solver settings objects and task-based meshing workflow.

Classes:

RPVarType(value[, names, module, qualname, ...])

Enumeration of rpvar types mapping Python types to Fluent type strings.

RPVars(eval_fn)

Access to rpvars in a specific session.

class ansys.fluent.core.rpvars.RPVarType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)#

Bases: Enum

Enumeration of rpvar types mapping Python types to Fluent type strings.

Attributes:

Methods:

from_python_type(python_type)

Convert Python type to RPVarType.

BOOLEAN = 'boolean'#
CUSTOM = 'none'#
INTEGER = 'integer'#
REAL = 'real'#
STRING = 'string'#
classmethod from_python_type(python_type)#

Convert Python type to RPVarType.

Parameters:
python_typetype

Python type to convert.

Returns:
RPVarType

Corresponding RPVarType enum value.

Raises:
ValueError

For unsupported python types.

class ansys.fluent.core.rpvars.RPVars(eval_fn)#

Bases: object

Access to rpvars in a specific session.

Methods:

__init__(eval_fn)

Initialize RPVars.

allowed_values()

Returns list with the allowed rpvars names.

create(name, value, var_type)

Create a new rpvar.

__init__(eval_fn)#

Initialize RPVars.

allowed_values()#

Returns list with the allowed rpvars names.

Returns:
List[str]

List with all allowed rpvars names.

create(name, value, var_type)#

Create a new rpvar.

Parameters:
namestr

Name of the rpvar to create.

valueAny

Initial value for the rpvar.

var_typeRPVarType | type | None

Type of the rpvar, either as RPVarType enum or Python type. Allowed Python types: int, float, bool, str or None.

Raises:
NameError

If the rpvar name already exists.

TypeError

If the value type doesn’t match the specified var_type.

RuntimeError

If ‘make-new-rpvar’ returns #f for a reason other than the variable name already matching an existing entry.