Skip to content

docs: Update outdated field_info docs [skip tests] #4257

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Jul 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changelog.d/4257.documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update outdated field_info docs [skip tests]
3 changes: 1 addition & 2 deletions doc/source/cheatsheet/cheat_sheet.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -617,8 +617,7 @@ field_info = solver.fields.field_info

```{python}
field_info.get_scalar_fields_info()
field_info.get_range("velocity")
field_info.get_range("cell-weight")
field_info.get_scalar_field_range("cell-weight")
```

### Get vector fields and surfaces info
Expand Down
2 changes: 1 addition & 1 deletion doc/source/user_guide/beta_feature_access.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Meshing Session

In meshing mode, the **Topology-Based Meshing** workflow is available as a beta feature. While
the associated method is visible on the session object, attempting to use it without enabling beta
features will result in a ``BetaFeaturesNotEnabled`` exception.
features results in a ``BetaFeaturesNotEnabled`` exception.

Example usage:

Expand Down
64 changes: 31 additions & 33 deletions doc/source/user_guide/fields/field_info.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,42 @@
Field info
==========

You can use field info objects to access Fluent field information.
You can use field information objects to access field-related metadata from Fluent.

Accessing field info objects
----------------------------
Accessing field information objects
-----------------------------------

.. code:: python

>>> from ansys.fluent.core.examples.downloads import download_file
>>> mixing_elbow_case_path = download_file("mixing_elbow.cas.h5", "pyfluent/mixing_elbow")

>>> import ansys.fluent.core as pyfluent
>>> solver_session = pyfluent.launch_fluent()
>>> solver_session.settings.file.read(file_type="case-dats", file_name=mixing_elbow_case_path)
>>> solver_session.settings.file.read(file_type="case", file_name=mixing_elbow_case_path)
>>> solver_session.settings.solution.initialization.hybrid_initialize()


The field info object is an attribute of the :obj:`~ansys.fluent.core.session_solver_session.Solver` object:
The field information object is available as an attribute of the :obj:`~ansys.fluent.core.session_solver_session.Solver` object:

.. code-block:: python

>>> field_info = solver_session.fields.field_info

Sample requests
---------------
Available methods
-----------------

Here are the methods for requesting field information:
You can use the following methods to retrieve various types of field metadata:

- ``get_scalar_fields_info`` for getting fields information.
- ``get_range`` for getting the range of the field.
- ``get_vector_fields_info`` for getting vector fields information.
- ``get_surfaces_info`` for getting the surfaces information.
- ``get_scalar_fields_info`` - Returns information about scalar fields.
- ``get_scalar_field_range`` - Returns the minimum and maximum values for a given scalar field.
- ``get_vector_fields_info`` - Returns information about vector fields.
- ``get_surfaces_info`` - Returns information about available surfaces.

Get scalar fields info
~~~~~~~~~~~~~~~~~~~~~~
You can request the fields information (field name, domain, and section) by
calling the ``get_scalar_fields_info`` method.
Scalar field information
~~~~~~~~~~~~~~~~~~~~~~~~
To retrieve details about scalar fields (such as field name, domain, and section), use
the :meth:`get_scalar_fields_info() <ansys.fluent.core.services.field_data.FieldInfo.get_scalar_fields_info>`:

.. code-block:: python

Expand All @@ -48,35 +51,30 @@ calling the ``get_scalar_fields_info`` method.
'absolute-pressure': {'display_name': 'Absolute Pressure', 'section': 'Pressure...', 'domain': 'mixture'},
...}

Get range
~~~~~~~~~
You can request the range (minimum and maximum values) for a given ``field`` by
calling the ``get_range`` method. It takes a ``field`` argument which can be obtained
from the keys of the dictionary returned by ``get_scalar_fields_info`` method.
Scalar field range
~~~~~~~~~~~~~~~~~~
To get the range (minimum and maximum values) of a specific scalar field, use :meth:`get_scalar_field_range() <ansys.fluent.core.services.field_data.FieldInfo.get_scalar_field_range>`.
The field name must be one of the keys returned by :meth:`get_scalar_fields_info() <ansys.fluent.core.services.field_data.FieldInfo.get_scalar_fields_info>`.

.. code-block:: python

>>> field_info.get_range("velocity")
[0.0, 0.0]
>>> field_info.get_range("cell-weight")
>>> field_info.get_scalar_field_range("cell-weight")
[8.0, 24.0]

Get vector fields info
~~~~~~~~~~~~~~~~~~~~~~
You can request the vector fields information by calling the
``get_vector_fields_info`` method.
Vector field information
~~~~~~~~~~~~~~~~~~~~~~~~~
To retrieve metadata about vector fields, use :meth:`get_vector_fields_info() <ansys.fluent.core.services.field_data.FieldInfo.get_vector_fields_info>`:

.. code-block:: python

>>> field_info.get_vector_fields_info()
{'velocity': {'x-component': 'x-velocity', 'y-component': 'y-velocity', 'z-component': 'z-velocity'},
'relative-velocity': {'x-component': 'relative-x-velocity', 'y-component': 'relative-y-velocity', 'z-component': 'relative-z-velocity'}}

Get surfaces info
~~~~~~~~~~~~~~~~~
You can request the surfaces information (surface name, ID, and type) by
calling the ``get_surfaces_info`` method.

Surface information
~~~~~~~~~~~~~~~~~~~
To get information about available surfaces (including surface ID, zone ID, and zone type),
use :meth:`get_surfaces_info() <ansys.fluent.core.services.field_data.FieldInfo.get_surfaces_info>`:
.. code-block:: python

>>> field_info.get_surfaces_info()
Expand Down
Loading