flobject#
Module for accessing and modifying hierarchy of Fluent settings.
The only useful method is ‘get_root`, which returns the root object for accessing Fluent settings.
Child objects can be generally accessed or modified using attribute access. Named child objects can be accessed or modified using index operators.
Calling an object will return its current value.
Example#
>>> r = flobject.get_root(proxy)
>>> is_energy_on = r.setup.models.energy.enabled()
>>> r.setup.models.energy.enabled = True
>>> r.boundary_conditions.velocity_inlet['inlet'].vmag.constant = 20
Classes:
|
Intermediate Base class for Command and Query class. |
Provides allowed values. |
|
|
Provides the base class for settings and command objects. |
|
Executes command. |
|
A |
|
A |
|
A |
|
Command object. |
|
Command Object supporting positional arguments. |
Provides creatable named objects for Fluent 2025 R1 and later. |
|
Provides creatable named objects for Fluent 2024 R2 and earlier. |
|
|
Resolves MRO for child classes. |
|
A |
|
A FilenameList object represents a list of file names. |
|
A |
|
An |
|
An |
|
A |
|
A |
|
A |
|
WildcardPath at a NamedObject path, so it can be looked up by wildcard again. |
|
Exposes attribute accessor on settings object - specific to numerical objects. |
|
Exposes attribute accessor on settings object. |
|
Query object. |
|
A |
|
A |
|
A |
|
An object representing a 3D vector. |
|
Base class for settings objects. |
|
A |
|
A |
|
Exposes attribute accessor on settings object - specific to string objects. |
|
Class wrapping a wildcard path to perform get_var and set_var on flproxy. |
Exceptions:
Provides deprecated settings warning. |
|
|
Inactive object access. |
Provides unstable settings warning. |
Functions:
|
Assert type. |
|
Check type of object. |
|
Returns path of all the child objects matching an identifier. |
|
Create a class for the object identified by "path". |
|
Get the root settings object. |
|
Convert a scheme string to a Python constant name. |
|
Convert a scheme string to a Python variable name. |
- class ansys.fluent.core.solver.flobject.Action(name=None, parent=None)#
Bases:
BaseIntermediate Base class for Command and Query class.
Methods:
__init__([name, parent])__init__ of Action class.
Attributes:
- __init__(name=None, parent=None)#
__init__ of Action class.
- argument_names = []#
- class ansys.fluent.core.solver.flobject.AllowedValuesMixin#
Bases:
objectProvides allowed values.
Methods:
Get the allowed values of the object.
- allowed_values()#
Get the allowed values of the object.
- class ansys.fluent.core.solver.flobject.Base(name=None, parent=None)#
Bases:
objectProvides the base class for settings and command objects.
- Parameters:
- name
str Name of the object if a child of a named object.
- parent: Base
Parent of the object.
- name
- Attributes:
Methods:
__init__([name, parent])__init__ of Base class.
after_execute(command_name, value, kwargs)Executes after command execution.
before_execute(command_name, value, kwargs)Executes before command execution.
find_object(relative_path)Find object.
get_attr(attr[, attr_type_or_types])Get the requested attribute for the object.
get_attrs(attrs[, recursive])Get the requested attributes for the object.
get_completer_info([prefix, excluded])Get completer info of all children.
Whether the object is active.
Whether the object is read-only.
set_flproxy(flproxy)Set flproxy object.
Attributes:
Proxy object.
Name of the scheme of this object.
Parent (container) object.
Path of the object.
Python name of this object.
Path of the object.
- __init__(name=None, parent=None)#
__init__ of Base class.
- after_execute(command_name, value, kwargs)#
Executes after command execution.
- before_execute(command_name, value, kwargs)#
Executes before command execution.
- find_object(relative_path)#
Find object.
- property flproxy#
Proxy object.
The proxy object is set at the root level and accessed via the parent for the child classes.
- fluent_name = None#
- get_attr(attr, attr_type_or_types=None)#
Get the requested attribute for the object.
- Parameters:
- Returns:
Anyattribute value
- Raises:
InactiveObjectErrorIf any attribute other than
"active?is queried when the object is not active.
- get_attrs(attrs, recursive=False)#
Get the requested attributes for the object.
- get_completer_info(prefix='', excluded=None)#
Get completer info of all children.
- Returns:
List[List[str]]Name, type and docstring of all children.
- is_active()#
Whether the object is active.
- is_read_only()#
Whether the object is read-only.
- property obj_name: str#
Name of the scheme of this object.
By default, this returns the object’s static name. If the object is a child of a named object, the object’s name is returned.
- property parent#
Parent (container) object.
- property path: str#
Path of the object.
Constructed from the
obj_nameof self and the path of parent.
- property python_name: str#
Python name of this object.
By default, this returns the object’s static name. If the object is a child of a named object, the object’s name is returned.
- property python_path: str#
Path of the object.
Constructed in python syntax from ‘python_path’ and the parents python path.
- set_flproxy(flproxy)#
Set flproxy object.
- class ansys.fluent.core.solver.flobject.BaseCommand(name=None, parent=None)#
Bases:
ActionExecutes command.
Methods:
execute_command(*args, **kwds)Execute command.
- execute_command(*args, **kwds)#
Execute command.
- class ansys.fluent.core.solver.flobject.Boolean(name=None, parent=None)#
Bases:
SettingsBase[bool],PropertyA
Booleanobject representing a Boolean value setting.
- class ansys.fluent.core.solver.flobject.BooleanList(name=None, parent=None)#
Bases:
SettingsBase[List[bool]],PropertyA
BooleanListobject representing a Boolean list setting.
- class ansys.fluent.core.solver.flobject.CombinedNamedObject(objects)#
Bases:
objectA
CombinedNamedObjectcontains the concatenated named-objects.Methods:
- __init__(objects)#
__init__ of CombinedNamedObject.
- items()#
Return items like a dictionary.
- class ansys.fluent.core.solver.flobject.Command(name=None, parent=None)#
Bases:
BaseCommandCommand object.
- class ansys.fluent.core.solver.flobject.CommandWithPositionalArgs(name=None, parent=None)#
Bases:
BaseCommandCommand Object supporting positional arguments.
- class ansys.fluent.core.solver.flobject.CreatableNamedObjectMixin#
Bases:
MutableMapping,Generic[ChildTypeT]Provides creatable named objects for Fluent 2025 R1 and later.
- class ansys.fluent.core.solver.flobject.CreatableNamedObjectMixinOld#
Bases:
CreatableNamedObjectMixinProvides creatable named objects for Fluent 2024 R2 and earlier.
Methods:
create([name])Create a named object.
- create(name='')#
Create a named object.
- Parameters:
- name: str
Name of the new object.
- Returns:
ObjectObject that has been created.
- exception ansys.fluent.core.solver.flobject.DeprecatedSettingWarning#
Bases:
PyFluentDeprecationWarningProvides deprecated settings warning.
- class ansys.fluent.core.solver.flobject.FileName(name=None, parent=None)#
Bases:
BaseResolves MRO for child classes.
- class ansys.fluent.core.solver.flobject.Filename(name=None, parent=None)#
Bases:
SettingsBase[str],TextualA
Filenameobject representing a file name.Methods:
Specifies whether this file is used as input or output by Fluent.
- file_purpose()#
Specifies whether this file is used as input or output by Fluent.
- class ansys.fluent.core.solver.flobject.FilenameList(name=None, parent=None)#
Bases:
SettingsBase[List[str]],TextualA FilenameList object represents a list of file names.
Methods:
Specifies whether this file is used as input or output by Fluent.
- file_purpose()#
Specifies whether this file is used as input or output by Fluent.
- class ansys.fluent.core.solver.flobject.Group(name=None, parent=None)#
Bases:
SettingsBase[Dict[str,StateType]]A
Groupcontainer object.A
Groupobject is a container similar to a C++ structure object. Child objects can be accessed via attribute access.- Attributes:
- child_names: list[str]
Names of the child objects
- command_names: list[str]
Names of the commands
Methods:
__init__([name, parent])__init__ of Group class.
Names of children that are currently active.
Names of commands that are currently active.
Names of queries that are currently active.
to_python_keys(value)Convert value to have keys with Python names.
to_scheme_keys(value, root_cls, path)Convert value to have keys with scheme names.
Attributes:
- __init__(name=None, parent=None)#
__init__ of Group class.
- child_names = []#
- command_names = []#
- get_active_child_names()#
Names of children that are currently active.
- get_active_command_names()#
Names of commands that are currently active.
- get_active_query_names()#
Names of queries that are currently active.
- query_names = []#
- classmethod to_python_keys(value)#
Convert value to have keys with Python names.
- classmethod to_scheme_keys(value, root_cls, path)#
Convert value to have keys with scheme names.
- Raises:
RuntimeErrorIf key is invalid.
- exception ansys.fluent.core.solver.flobject.InactiveObjectError(python_path)#
Bases:
RuntimeErrorInactive object access.
Methods:
__init__(python_path)Initialize InactiveObjectError.
- __init__(python_path)#
Initialize InactiveObjectError.
- class ansys.fluent.core.solver.flobject.Integer(name=None, parent=None)#
Bases:
SettingsBase[int],NumericalAn
Integerobject representing an integer value setting.
- class ansys.fluent.core.solver.flobject.IntegerList(name=None, parent=None)#
Bases:
SettingsBase[List[int]],NumericalAn
Integerobject representing an integer list setting.
- class ansys.fluent.core.solver.flobject.ListObject(name=None, parent=None)#
Bases:
SettingsBase[List[StateType]],Generic[ChildTypeT]A
ListObjectcontainer is a container object, similar to a Python list object. Generally, many such objects can be created.- Attributes:
- command_names: list[str]
Names of the commands.
Methods
get_size()
Get the size of the list.
Methods:
__init__([name, parent])__init__ of ListObject class.
get_size()Return the number of elements in a list object.
to_python_keys(value)Convert value to have keys with scheme names.
to_scheme_keys(value, root_cls, path)Convert value to have keys with scheme names.
Attributes:
- __init__(name=None, parent=None)#
__init__ of ListObject class.
- command_names = []#
- query_names = []#
- classmethod to_python_keys(value)#
Convert value to have keys with scheme names.
- classmethod to_scheme_keys(value, root_cls, path)#
Convert value to have keys with scheme names.
- class ansys.fluent.core.solver.flobject.Map(name=None, parent=None)#
Bases:
SettingsBase[Dict[str,StateType]]A
Mapobject representing key-value settings.
- class ansys.fluent.core.solver.flobject.NamedObject(name=None, parent=None)#
Bases:
SettingsBase[Dict[str,StateType]],Generic[ChildTypeT]A
NamedObjectcontainer is a container object similar to a Python dictionary object. Generally, many such objects can be created with different names.- Attributes:
- command_names: list[str]
Names of the commands
Methods:
__init__([name, parent])__init__ of NamedObject class.
get(name)Return the child object by key.
Object names.
items()Items.
keys()Object names.
to_python_keys(value)Convert value to have keys with Python names.
to_scheme_keys(value, root_cls, path)Convert value to have keys with scheme names.
Whether the object is user-creatable.
values()Object values.
Attributes:
- __init__(name=None, parent=None)#
__init__ of NamedObject class.
- command_names = []#
- get(name)#
Return the child object by key.
- Parameters:
- name
str Name of the child object.
- name
- Returns:
ChildTypeTChild object.
- get_object_names()#
Object names.
- items()#
Items.
- keys()#
Object names.
- query_names = []#
- classmethod to_python_keys(value)#
Convert value to have keys with Python names.
- classmethod to_scheme_keys(value, root_cls, path)#
Convert value to have keys with scheme names.
- user_creatable()#
Whether the object is user-creatable.
- values()#
Object values.
- class ansys.fluent.core.solver.flobject.NamedObjectWildcardPath(flproxy, path, state_cls, settings_cls, parent)#
Bases:
WildcardPathWildcardPath at a NamedObject path, so it can be looked up by wildcard again.
- class ansys.fluent.core.solver.flobject.Numerical(name=None, parent=None)#
Bases:
PropertyExposes attribute accessor on settings object - specific to numerical objects.
Methods:
- max()#
Get the maximum value of the object.
- min()#
Get the minimum value of the object.
- class ansys.fluent.core.solver.flobject.Property(name=None, parent=None)#
Bases:
BaseExposes attribute accessor on settings object.
Methods:
Gets the default value of the object.
- default_value()#
Gets the default value of the object.
- class ansys.fluent.core.solver.flobject.Real(name=None, parent=None)#
Bases:
SettingsBase[real],RealNumericalA
Realobject representing a real value setting.Some
Realobjects also accept string arguments representing expression values.Methods:
base_set_state([state])Set the state of the object.
set_state([state])Set the state of the object.
- base_set_state(state=None, **kwargs)#
Set the state of the object.
- set_state(state=None, **kwargs)#
Set the state of the object.
- Parameters:
- state
The type of state can be float, str (representing either an expression or a value with units), or an ansys.units.Quantity.
- kwargs
Any Keyword arguments.
- Raises:
UnhandledQuantityIf the quantity object cannot be handled for the given path. This can happen if the quantity attribute specifies an unsupported quantity, or if the units specified for the quantity are not supported.
- class ansys.fluent.core.solver.flobject.RealList(name=None, parent=None)#
Bases:
SettingsBase[List[real]],RealNumericalA
RealListobject representing a real list setting.Methods:
base_set_state([state])Set the state of the object.
set_state([state])Set the state of the object.
- base_set_state(state=None, **kwargs)#
Set the state of the object.
- set_state(state=None, **kwargs)#
Set the state of the object.
- Parameters:
- state
The type of state can be float, str (representing either an expression or a value with units), or an ansys.units.Quantity.
- kwargs
Any Keyword arguments.
- Raises:
UnhandledQuantityIf the quantity object cannot be handled for the given path. This can happen if the quantity attribute specifies an unsupported quantity, or if the units specified for the quantity are not supported.
- class ansys.fluent.core.solver.flobject.RealNumerical(name=None, parent=None)#
Bases:
NumericalA
RealNumericalobject representing a real value setting, including single real values and containers of real values, such as lists.Methods
as_quantity()
Get the current state of the object as an ansys.units.Quantity.
set_state(state)
Set the state of the object.
units()
Get the units string.
Methods:
Get the state of the object as an ansys.units.Quantity.
set_state([state])Set the state of the object.
units()Get the physical units of the object as a string.
- as_quantity()#
Get the state of the object as an ansys.units.Quantity.
- set_state(state=None, **kwargs)#
Set the state of the object.
- Parameters:
- state
The type of state can be float, str (representing either an expression or a value with units), or an ansys.units.Quantity.
- kwargs
Any Keyword arguments.
- Raises:
UnhandledQuantityIf the quantity object cannot be handled for the given path. This can happen if the quantity attribute specifies an unsupported quantity, or if the units specified for the quantity are not supported.
- units()#
Get the physical units of the object as a string.
- class ansys.fluent.core.solver.flobject.RealVector(name=None, parent=None)#
Bases:
SettingsBase[Tuple[real,real,real]],NumericalAn object representing a 3D vector.
A
RealVectorobject representing a real vector setting consisting of three real values.
- class ansys.fluent.core.solver.flobject.SettingsBase(name=None, parent=None)#
-
Base class for settings objects.
Methods
get_state()
Get the current state of the object.
set_state(state)
Set the state of the object.
Methods:
Get the state of the object.
print_state([out, indent_factor])Print the state of the object.
set_state([state])Set the state of the object.
Get the state of the object with units where available.
to_python_keys(value)Convert value to have keys with Python names.
to_scheme_keys(value, root_cls, path)Convert value to have keys with scheme names.
- get_state()#
Get the state of the object.
- print_state(out=None, indent_factor=2)#
Print the state of the object.
- set_state(state=None, **kwargs)#
Set the state of the object.
- state_with_units()#
Get the state of the object with units where available.
- classmethod to_python_keys(value)#
Convert value to have keys with Python names.
This is overridden in the
Group,NamedObject, andListObjectclasses.
- classmethod to_scheme_keys(value, root_cls, path)#
Convert value to have keys with scheme names.
This is overridden in the
Group,NamedObject, andListObjectclasses.
- class ansys.fluent.core.solver.flobject.String(name=None, parent=None)#
Bases:
SettingsBase[str],TextualA
Stringobject representing a string value setting.Methods:
base_set_state([state])Set the state of the object.
set_state([state])Set the state of the object.
- base_set_state(state=None, **kwargs)#
Set the state of the object.
- set_state(state=None, **kwargs)#
Set the state of the object.
- Parameters:
- state
Either str or VariableDescriptor.
- kwargs
Any Keyword arguments.
- class ansys.fluent.core.solver.flobject.StringList(name=None, parent=None)#
Bases:
SettingsBase[List[str]],TextualA
StringListobject representing a string list setting.
- class ansys.fluent.core.solver.flobject.Textual(name=None, parent=None)#
Bases:
PropertyExposes attribute accessor on settings object - specific to string objects.
Methods:
set_state([state])Set the state of the object.
- set_state(state=None, **kwargs)#
Set the state of the object.
- Parameters:
- state
Either str or VariableDescriptor.
- kwargs
Any Keyword arguments.
- exception ansys.fluent.core.solver.flobject.UnstableSettingWarning#
Bases:
PyFluentUserWarningProvides unstable settings warning.
- class ansys.fluent.core.solver.flobject.WildcardPath(flproxy, path, state_cls, settings_cls, parent)#
Bases:
GroupClass wrapping a wildcard path to perform get_var and set_var on flproxy.
Methods:
__init__(flproxy, path, state_cls, ...)__init__ of WildcardPath class.
items()Items.
to_python_keys(value)Convert value to have keys with Python names.
to_scheme_keys(value, root_cls, path)Convert value to have keys with scheme names.
Attributes:
- __init__(flproxy, path, state_cls, settings_cls, parent)#
__init__ of WildcardPath class.
- property flproxy#
Proxy object.
- items()#
Items.
- property path#
Path with wildcards.
- to_python_keys(value)#
Convert value to have keys with Python names.
- to_scheme_keys(value, root_cls, path)#
Convert value to have keys with scheme names.
- ansys.fluent.core.solver.flobject.assert_type(val, tp)#
Assert type.
- Raises:
TypeErrorIf the given value is not of the given type.
- ansys.fluent.core.solver.flobject.check_type(val, tp)#
Check type of object.
- ansys.fluent.core.solver.flobject.find_children(obj, identifier='*')#
Returns path of all the child objects matching an identifier.
- Parameters:
- obj: Object
Object whose children need to be queried.
- identifier: str
Identifier to find specific children.
- Returns:
List
- ansys.fluent.core.solver.flobject.get_cls(name, info, parent=None, version=None, parent_taboo=None)#
Create a class for the object identified by “path”.
- ansys.fluent.core.solver.flobject.get_root(flproxy, version='', interrupt=None, file_transfer_service=None, scheme_eval=None)#
Get the root settings object.
- Parameters:
- flproxy: Proxy
Object that interfaces with the Fluent backend.
- interrupt: optional
To interrupt interruptible commands.
- file_transfer_service
optional File transfer service. Uploads/downloads files to/from the server.
- scheme_eval
Any A gRPC service to execute Scheme code.
- version
str Fluent version.
- Returns:
rootobject
- Raises:
RuntimeErrorIf hash values are inconsistent.
- ansys.fluent.core.solver.flobject.to_constant_name(fluent_name)#
Convert a scheme string to a Python constant name.
This function replaces symbols and spaces with _ and converts the name to uppercase.
'and?symbols are ignored.
- ansys.fluent.core.solver.flobject.to_python_name(fluent_name)#
Convert a scheme string to a Python variable name.
This function replaces symbols with _.
'and?symbols are ignored.