diff --git a/doc/.vale.ini b/doc/.vale.ini index 4785e968a749..344c6c4a70cd 100644 --- a/doc/.vale.ini +++ b/doc/.vale.ini @@ -20,7 +20,7 @@ WordTemplate = \b(?:%s)\b Packages = Google # Define the Ansys vocabulary -Vocab = ANSYS, rp, config +Vocab = ANSYS [*.{md,rst}] diff --git a/doc/source/api/solver/fielddata.rst b/doc/source/api/solver/fielddata.rst index b9eb9b0906c8..889aa60a4b07 100644 --- a/doc/source/api/solver/fielddata.rst +++ b/doc/source/api/solver/fielddata.rst @@ -3,13 +3,14 @@ Field data ========== -You can use field data objects to access Fluent surface, scalar, vector, and pathlines data. +You can use field data objects to access Fluent surface, scalar, vector, and +pathlines data. Accessing field data objects ---------------------------- -In order to access field data, launch the fluent solver, and make field -data available (for example, by reading case and data files): +In order to access field data, launch the fluent solver, and make field data +available (for example, by reading case and data files): .. code-block:: python @@ -190,12 +191,13 @@ The surface ID is the same one that is passed in the request. Field name ---------- -A request returns multiple fields. The number of fields depends on the request type. +A request returns multiple fields. The number of fields depends on the request +type. Surface request ~~~~~~~~~~~~~~~ -The response to a surface request contains any of the following fields, depending on the -request arguments: +The response to a surface request contains any of the following fields, +depending on the request arguments: - ``faces``, which contain face connectivity - ``vertices``, which contain node coordinates @@ -205,14 +207,15 @@ request arguments: Scalar field request ~~~~~~~~~~~~~~~~~~~~ -The response to a scalar field request contains a single field with the same name as the -scalar field name passed in the request. +The response to a scalar field request contains a single field with the same +name as the scalar field name passed in the request. Vector field request ~~~~~~~~~~~~~~~~~~~~ The response to a vector field request contains two fields: -- ``vector field``, with the same name as the vector field name that is passed in the request +- ``vector field``, with the same name as the vector field name that is passed + in the request - ``vector-scale``, a float value indicating the vector scale. Pathlines field request @@ -222,14 +225,18 @@ The response to a pathlines field request contains the following fields: - ``pathlines-count``, which contains pathlines count. - ``lines``, which contain pathlines connectivity. - ``vertices``, which contain node coordinates. -- ``field name``, which contains pathlines field. field name is the same name as the scalar field name passed in the request. +- ``field name``, which contains pathlines field. field name is the same name as + the scalar field name passed in the request. - ``particle-time``, which contains particle time, if requested. -- ``additional field name``, which contains additional field, if requested. additional field name is the same name as the additional field name passed in the request. +- ``additional field name``, which contains additional field, if requested. + additional field name is the same name as the additional field name passed in + the request. Allowed values -------------- -Additionally there is an allowed_values provided on field name, -surface name and ids to guide the users. +Additionally there is an ``allowed_values`` method provided on all of +``field_name``, ``surface_name`` and ``surface_ids`` which tells you what object +names are accessible. Some sample use cases are demonstrated below: diff --git a/doc/source/api/solver/reduction.rst b/doc/source/api/solver/reduction.rst index ffed840377dc..c0526f399d8d 100644 --- a/doc/source/api/solver/reduction.rst +++ b/doc/source/api/solver/reduction.rst @@ -136,7 +136,7 @@ Compute the force acting on the locations specified (should be walls) as a vecto >>> reduction.force(locations) -Pressure Force +Pressure force ~~~~~~~~~~~~~~ Compute the pressure force acting on the locations specified (should be walls) as a vector. @@ -144,7 +144,7 @@ Compute the pressure force acting on the locations specified (should be walls) a >>> reduction.pressure_force(locations) -Viscous Force +Viscous force ~~~~~~~~~~~~~ Compute the viscous force acting on the locations specified (should be walls) as a vector. diff --git a/doc/source/getting_started/faqs.rst b/doc/source/getting_started/faqs.rst index 81a5e2b46bf2..a0cc5fe8c96b 100644 --- a/doc/source/getting_started/faqs.rst +++ b/doc/source/getting_started/faqs.rst @@ -31,17 +31,18 @@ separately. For more information, see :ref:`faqs_install`, which appears later o PyFluent has no GUI (graphical user interface). You interact with PyFluent through the Python environment of your choice. -How does PyFluent compare to UDFs? ----------------------------------- -PyFluent is conceptually aligned with Fluent TUI console commands (and journaling) rather than with -UDFs (user-defined functions). In other words, PyFluent is used for automation rather than -modifying the solver behavior. +How does PyFluent compare to Fluent user defined functions? +----------------------------------------------------------- +PyFluent is conceptually aligned with Fluent TUI console commands and +journaling rather than with user defined functions (UDFs). In other words, +PyFluent is primarily used for automation rather than modifying the solver +behavior. -UDFs continue to be written in C and remain important elements of -Fluent simulations. +UDFs continue to be written in C and remain important elements of Fluent +simulations. -While you cannot write UDFs in Python, you can execute PyFluent commands to compile and load UDFs, -similar to how you use TUI commands. +While you cannot write UDFs in Python, you can execute PyFluent commands to +compile and load UDFs, similar to how you use TUI commands. Who should use PyFluent? ------------------------ @@ -78,23 +79,23 @@ What can you do with PyFluent? You can use PyFluent to do tasks such as these: - Integrate Fluent as a solver seamlessly in your in-house design tools. -- Customize postprocessing, perhaps by using Python's vast external - library to extend postprocessing capabilities or by automatically generating - a PowerPoint presentation to show simulation results. +- Customize postprocessing, perhaps by using Python's vast external library to + extend postprocessing capabilities or by automatically generating a PowerPoint + presentation to show simulation results. - Use a web app to access jobs running on a cluster, monitor convergence, and generate graphs. -- Leverage ML and AI, especially for models that are solved quickly but can be - improved as additional knowledge is acquired and applied. -- Use Python APIs to couple different Ansys products. +- Leverage Python machine learning and artificial intelligence modules, + especially for models that are solved quickly but can be improved as + additional knowledge is acquired and applied. +- Use Python to couple different Ansys products together. .. _faqs_install: How do you install PyFluent? ---------------------------- -While :ref:`installation` provides basic information for quickly -installing and launching the ``ansys-fluent-core`` package, these -steps explain how to install all PyFluent packages in a Python *virtual -environment*: +While :ref:`installation` provides basic information for quickly installing and +launching the ``ansys-fluent-core`` package, these steps explain how to install +all PyFluent packages in a Python *virtual environment*: #. Install Python if it is not already installed. @@ -112,46 +113,56 @@ environment*: #. In a command window, use this code to set up and activate a local Python virtual environment:: - - python -m venv pyenv # Set up a local virtual environment - pyenv\Scripts\activate # Activate the virtual environment on Windows - source pyenv/bin/activate.csh # Activate the virtual environment on Linux (csh) - . pyenv/bin/activate # Activate the virtual environment on Linux (bash) + .. code:: bash + + .. vale off + + python -m venv venv # Set up a local virtual environment + venv\Scripts\activate # Activate the virtual environment on Windows + source venv/bin/activate.csh # Activate the virtual environment on Linux (csh) + . venv/bin/activate # Activate the virtual environment on Linux (bash) + + .. vale on #. In the same command window, use ``pip``, the package installer for Python, to install the PyFluent packages:: - python -m pip install ansys-fluent-core # Access Fluent’s core capabilities (mesh, solve, postprocess) - python -m pip install ansys-fluent-parametric # Access Fluent’s parametric capabilities (optional) - python -m pip install ansys-fluent-visualization # Access Fluents postprocessing capabilities, which work with PyVista and Matplotlib (optional) + .. code:: bash + + python -m pip install ansys-fluent-core # Use Fluent’s core capabilities (mesh, solve, postprocess) + python -m pip install ansys-fluent-parametric # Use Fluent’s parametric capabilities (optional) + python -m pip install ansys-fluent-visualization # Use Fluent's postprocessing capabilities with pyvista and matplotlib (optional) Which version of Python should you use? --------------------------------------- -PyFluent supports Python 3.7 through Python 3.10 on Windows and Linux. Python 3.7 is shipped -with Ansys 2022 R2 and later. For example, in a 2022 R2 installation, the executable file for -installing Python 3.7 is likely in +PyFluent supports Python 3.7 through Python 3.10 on Windows and Linux. Python +3.7 is shipped with Ansys 2022 R2 and later. For example, in a 2022 R2 Windows +installation, the executable file Python 3.7 is typically located at: ``C:\Program Files\ANSYS Inc\v222\commonfiles\CPython\3_7\winx64\Release\python.exe``. -Alternatively, you can download any compatible version of Python directly from the -`Downloads page `_ of the Python web site. +Alternatively, you can download any compatible version of Python directly from +the `Downloads page `_ of the Python web +site. -In either case, run the Python executable file as an administrator, selecting the -**Add Python 3.9 to PATH** checkbox on the first wizard page before proceeding with -the installation. On the last wizard page, which indicates that Python is installed -successfully, follow the instructions for disabling the path length limit if you have -long file paths. +In either case, run the Python executable file as an administrator, selecting +the **Add Python 3.9 to PATH** checkbox on the first wizard page before +proceeding with the installation. On the last wizard page, which indicates that +Python is installed successfully, follow the instructions for disabling the path +length limit if you have long file paths. Where do you find source code and documentation? ------------------------------------------------ -All PyAnsys public libraries are available from the `PyAnsys GitHub account `_. -The **Repositories** page displays the number of repositories, which are searchable by name. -For example, to find all PyFluent libraries, type ``pyfluent`` in the search option. +All PyAnsys public libraries are available from the `PyAnsys GitHub account +`_. The **Repositories** page displays the number of +repositories, which are searchable by name. For example, to find all PyFluent +libraries, type ``pyfluent`` in the search option. -The ``README.md`` file for the PyAnsys Github account lists the public PyAnsys libraries. -The links in this list are to the documentation for the respective libraries. In addition to -general usage information, the documentation for a library includes many practical examples. +The ``README.md`` file for the PyAnsys GitHub account lists the public PyAnsys +libraries. The links in this list are to the documentation for the respective +libraries. In addition to general usage information, the documentation for a +library includes many practical examples. How do you launch Fluent using PyFluent? ---------------------------------------- @@ -163,47 +174,52 @@ To launch Fluent with PyFluent commands, use this code: session=pyfluent.launch_fluent() -This example shows you how to launch a double precision Fluent session with two -processars and the Fluent GUI: +This example shows you how to launch a double precision Fluent session using two +processors and activate the Fluent user interface: .. code:: python session=pyfluent.launch_fluent(precision="double", processor_count=2, show_gui=True) -For additional launch examples, see :ref:`ref_user_guide_launch`. For descriptions of all parameters, -see the :func:`launch_fluent() ` method. +For additional launch examples, see :ref:`ref_user_guide_launch`. For +descriptions of all parameters, see the :func:`launch_fluent() +` method. .. _faqs_fluentloc: How does PyFluent infer the location to launch Fluent? ------------------------------------------------------ -PyFluent infers the Fluent location based on the following information, in increasing order of precedence: +PyFluent infers the Fluent location based on the following information, in +increasing order of precedence: #. ``AWP_ROOT`` environment variable, which is configured on Windows system - when Fluent is installed, where ```` is the Fluent release number such as - ``231`` for release 2023 R1. PyFluent automatically uses this environment + when Fluent is installed, where ```` is the Fluent release number such + as ``231`` for release 2023 R1. PyFluent automatically uses this environment variable to locate the latest Fluent installation. On Linux systems configure - ``AWP_ROOT`` to point to the absolute path of an Ansys installation such as - ``/apps/ansys_inc/v231``. + ``AWP_ROOT`` to point to the absolute path of an Ansys installation such + as ``/apps/ansys_inc/v231``. -#. Value of ``product_version`` parameter passed to :func:`launch_fluent() `. +#. Value of ``product_version`` parameter passed to :func:`launch_fluent() + `. -#. ``PYFLUENT_FLUENT_ROOT`` environment variable, set this to ``//fluent`` directory. +#. ``PYFLUENT_FLUENT_ROOT`` environment variable, set this to ``//fluent`` directory. How do you learn how to use PyFluent? ------------------------------------- -Depending on how you prefer to learn, you can use any or all of these methods -to learn how to use PyFluent: - -- Review the examples in the documentation, working first through those provided in - the :ref:_ref_example_gallery in this guide and then through those provided in the - **Examples** sections in the `PyFluent-Parametric `_ and - `Pyfluent-Visusalization `_ - guides. -- Record a journal of your actions in Fluent and review the corresponding Python script. +Depending on how you prefer to learn, you can use any or all of these methods to +learn how to use PyFluent: + +- Review the examples in the documentation, working first through those provided + in the :ref:_ref_example_gallery in this guide and then through those provided + in the **Examples** sections in the `PyFluent-Parametric + `_ and `PyFluent-Visusalization + `_ guides. +- Record a journal of your actions in Fluent and review the corresponding Python + script. .. note:: In Fluent 2022 R2, you can record a journal of your actions in Fluent @@ -236,15 +252,17 @@ to learn how to use PyFluent: How do you get help for PyFluent? --------------------------------- -Because PyFluent libraries are open source, support for issues, bugs, and feature -requests are available in their respective GitHub repositories. +Because PyFluent libraries are open source, support for issues, bugs, and +feature requests are available in their respective GitHub repositories. - To log an issue for PyFluent, use the `PyFluent Issues page `_. - To start a discussion, use the `PyFluent Discussions page `_. -For discussions about developer tools, engineering simulation, and physics for Ansys software, -visit the `Ansys Developer portal `_. The -`Ansys Discuss `_ page is where users, partners, students, and -Ansys subject matter experts connect, share ideas, discuss the latest technologies, and ask -questions to quickly obtain help and guidance. On this page, you can filter discussions by -category or apply the **Fluent** tag to view only Fluent-related discussions. +For discussions about developer tools, engineering simulation, and physics for +Ansys software, visit the `Ansys Developer portal +`_. The `Ansys Discuss +`_ page is where users, partners, students, and +Ansys subject matter experts connect, share ideas, discuss the latest +technologies, and ask questions to quickly obtain help and guidance. On this +page, you can filter discussions by category or apply the **Fluent** tag to view +only Fluent-related discussions. diff --git a/doc/source/getting_started/installation.rst b/doc/source/getting_started/installation.rst index 9447c63f2946..0b99521a4306 100644 --- a/doc/source/getting_started/installation.rst +++ b/doc/source/getting_started/installation.rst @@ -90,11 +90,11 @@ environment variable: Additional PyFluent packages ---------------------------- -In addition to the ``ansys-fluent-core`` package, you can install and use the ``pyfluent-parameteric`` -and ``pyfluent-visualization`` packages: +In addition to the ``ansys-fluent-core`` package, you can install and use the +``pyfluent-parameteric`` and ``pyfluent-visualization`` packages: -- The `pyfluent-parametric `_ package provides +- The `PyFluent-Parametric `_ package provides access to Fluent's parametric workflows. -- The `pyfluent-visualization `_ package +- The `PyFluent-Visualization `_ package provides postprocessing and visualization capabilities that use `pyvista `_ and `matplotlib `_ packages. diff --git a/doc/source/index.rst b/doc/source/index.rst index db753118733f..04f26355639f 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -17,19 +17,20 @@ Ansys Fluent is a state-of-the-art computational fluid dynamics (CFD) software package for modeling fluid flow, heat transfer, and chemical reactions in complex geometries. -Fluent provides complete mesh flexibility, including the ability to solve -your flow problems using unstructured meshes that can be generated about complex +Fluent provides complete mesh flexibility, including the ability to solve your +flow problems using unstructured meshes that can be generated about complex geometries with relative ease. Supported mesh types include: - 2D triangular and quadrilateral - 3D tetrahedral, hexahedral, pyramid, wedge, and polyhedral - Mixed (hybrid) -Fluent also enables you to refine or coarsen your mesh based on the flow solution. +Fluent also enables you to refine or coarsen your mesh based on the flow +solution. -You can read your mesh into Fluent or, for 3D geometries, create your -mesh using Fluent's meshing mode. All other operations are performed within -Fluent's solution mode, including: +You can read your mesh into Fluent or, for 3D geometries, create your mesh using +Fluent's meshing mode. All other operations are performed within Fluent's +solution mode, including: - Setting boundary conditions - Defining fluid properties @@ -41,62 +42,64 @@ Fluent's solution mode, including: What is PyFluent? ----------------- PyFluent is part of the `PyAnsys `_ ecosystem that -lets you use Fluent within a Python environment of your choice in -conjunction with other PyAnsys libraries and external Python -libraries. +lets you use Fluent within a Python environment of your choice in conjunction +with other PyAnsys libraries and external Python libraries. -PyFluent implements a client-server architecture. It uses Google remote procedure -calls, or gRPC interfaces, to launch or connect with a running Fluent process as -a server. However, you only need to interact with the Python interface. +PyFluent implements a client-server architecture. It uses Google remote +procedure calls, or gRPC interfaces, to launch or connect with a running Fluent +process as a server. However, you only need to interact with the Python +interface. You can use PyFluent to programmatically create, interact with, and control a -Fluent session to create your own customized workspace. In addition, you -can use PyFluent to enhance your productivity with highly configurable, -customized scripts. +Fluent session to create your own customized workspace. In addition, you can use +PyFluent to enhance your productivity with highly configurable, customized +scripts. Features -------- -Some of the many features in this primary PyFluent package, ``ansys-fluent-core``, -allow you to: +Some of the many features in this primary PyFluent package, +``ansys-fluent-core``, allow you to: -- Launch the Fluent solver in serial or parallel and connect to - already-running Fluent sessions. For more information, see :ref:`ref_user_guide_launch`. -- Script using Fluent's meshing capabilities. For more information, see +- Launch the Fluent solver in serial or parallel and connect to already-running + Fluent sessions. For more information, see :ref:`ref_user_guide_launch`. +- Script using Fluent's meshing capabilities. For more information, see :ref:`ref_meshing`. - Script using all of Fluent's TUI (text user interface) commands. For more information, see :ref:`ref_user_guide_tui_commands`. -- Run more than one Fluent session asynchronously. For more information, - see :ref:`ref_utils`. -- Retrieve Fluent field data as numpy arrays for custom postprocessing - using standard Python packages such as `matplotlib `_. - For more information, see :ref:`ref_field_data`. -- Register function callbacks on Fluent solver events such as when a - case file or data file is read or when the Fluent solver completes an iteration. - For more information, see :ref:`ref_events`. -- Retrieve solver monitors such as residuals. For more information, see :ref:`ref_monitors`. +- Run more than one Fluent session asynchronously. For more information, see + :ref:`ref_utils`. +- Retrieve Fluent field data as numpy arrays for custom postprocessing using + standard Python packages such as `matplotlib `_. For + more information, see :ref:`ref_field_data`. +- Register function callbacks on Fluent solver events such as when a case file + or data file is read or when the Fluent solver completes an iteration. For + more information, see :ref:`ref_events`. +- Retrieve solver monitors such as residuals. For more information, see + :ref:`ref_monitors`. Documentation and issues ------------------------ -In addition to installation and usage information, the PyFluent -documentation provides :ref:`ref_index_api`, :ref:`ref_example_gallery`, -and :ref:`ref_contributing` sections. +In addition to installation and usage information, the PyFluent documentation +provides :ref:`ref_index_api`, :ref:`ref_example_gallery`, and +:ref:`ref_contributing` sections. -On the `PyFluent Issues `_ page, you can create -issues to submit questions, report bugs, and request new features. To reach -the PyAnsys support team, email `pyansys.support@ansys.com `_. +On the `PyFluent Issues `_ page, you +can create issues to submit questions, report bugs, and request new features. To +reach the PyAnsys support team, email `pyansys.support@ansys.com +`_. License ------- PyFluent is licensed under the MIT license. -PyFluent makes no commercial claim over Ansys whatsoever. This library -extends the functionality of Ansys Fluent by adding a Python interface -to Fluent without changing the core behavior or license of the original -software. The use of the interactive control of Fluent control of PyFluent -requires a legally licensed copy of Fluent. +PyFluent makes no commercial claim over Ansys whatsoever. This library extends +the functionality of Ansys Fluent by adding a Python interface to Fluent without +changing the core behavior or license of the original software. The use of the +interactive control of Fluent control of PyFluent requires a legally licensed +copy of Fluent. -For more information on Fluent, see the `Ansys Fluent page `_ -on the Ansys website. +For more information on Fluent, see the `Ansys Fluent page +`_ on the Ansys website. Project index ------------- diff --git a/doc/source/user_guide/launching_ansys_fluent.rst b/doc/source/user_guide/launching_ansys_fluent.rst index 238b50162a7f..90273fbac78a 100644 --- a/doc/source/user_guide/launching_ansys_fluent.rst +++ b/doc/source/user_guide/launching_ansys_fluent.rst @@ -87,7 +87,7 @@ You can use this code to enable logging: You must pass the log level while enabling logging. PyFluent supports any of the logging levels (``"CRITICAL"``, ``"ERROR"``, ``"WARNING"``, ``"INFO"``, and ``"DEBUG"``) -in string or enum format. +in string or ``enum`` format. Scheduler support ----------------- diff --git a/doc/styles/Vocab/ANSYS/accept.txt b/doc/styles/Vocab/ANSYS/accept.txt index 54a40ebbd253..cee24e68a296 100644 --- a/doc/styles/Vocab/ANSYS/accept.txt +++ b/doc/styles/Vocab/ANSYS/accept.txt @@ -1,29 +1,37 @@ ANSYS Ansys ansys -Fluent -fluent -Fluent's -PyFluent +CommandArguments +config +csh EventsManager endblock endfor endif +Fluent +fluent +Fluent's fullname hexahedral +journaling matplotlib mesher meshing's MonitorsManager numpy +pathlines +Pathlines Postprocessing postprocessing postprocess -pyvista +PyAnsys +pyansys +PyFluent Pythonic +pyvista +rp +sbatch Slurm +UDFs Univa -sbatch -CommandArguments -pathlines -Pathlines \ No newline at end of file +venv