Skip to main content

Effortless Visualization of Simulation Data and embed it with Modern Web Apps

Introduction

The Ansys Fluent Visualization Python Module is a dynamic client library that allows you to produce visually captivating depictions of fluid dynamics simulations using Ansys Fluent. This tool employs the features of PyVista and Matplotlib to offer a user-friendly interface for generating 3D plots, contour plots, and interactive visualizations. Regardless of whether you’re a computational fluid dynamics student or an experienced engineer, the Ansys Fluent Visualization Python Module can assist you in extracting valuable insights from your simulation data by presenting it in a manner that is both intuitive and informative. This module facilitates the export of 3D Interactive Graphics for mesh visualization, contour plots, etc., as python objects, GLTF files (GL Transmission Format), vtk, and HTML. The key advantages of 3D visualization in the browser are its ability to export the model, simulation data as HTML or other mentioned formats, making it effortless to share and embed in web pages and web applications. This capability can be leveraged to present data with modern Web Apps, Enterprise Engineering Workflows in general. Let’s explore the realm of fluid dynamics visualization and discover the potential of the ANSYS Fluent Visualization Python Module!

Overview

In this article, we will explore the various features of the Ansys Fluent Visualization Python Module and guide you on how to export 3D visualizations as HTML. For a basic understanding of the installation and setup process, and to delve into some of the module’s advanced features, including a comprehensive example, please refer to the latest release documentation. Additionally, this article includes code snippets based on the version ansys-fluent-visualization 0.7.1, which is available on the Python Package Index (PyPI), a repository of software for the Python programming language.

Features

In this article, we will delve into the following key features of the Ansys Fluent Visualization Python Module:
  • Graphics object for visualizing 3D meshes and contour plots of simulation data.
  • A demonstration on how to export 3D visualizations as HTML using PyVista Plotter.
  • XYPlot object for creating XY plots of simulation data that utilize the capabilities of Matplotlib.

Code Examples

Note: Please installation the following libraries, to get the expected outcome from these code snippets.
Required modules
  • ansys-fluent-core
  • ansys-fluent-visualization
  • trame
  • panel
  • ipywidgets

Importing the Module

To get started, we need to import the module. We can do this by using the following code:

Set visualization configuration

Downloading the example file and reading the case and data files

Create Graphics object

Visualize the mesh

Mesh Visualization

Export HTML for Mesh Visualization using Plotter object

Create a Plane object

Create a Contour object using Plane object

Contour Visualization

Export HTML for Temperature Contour using Plotter object

Create Plots object to create XYPlot

Create XYPlot

XYPlot Visualization

Conclusion

To sum up, the Ansys Fluent Visualization Python Module is a highly valuable resource for individuals engaged in computational fluid dynamics. It offers a robust and easy-to-use Python interface for producing striking visualizations of fluid dynamics simulations. The capability of exporting 3D visualizations as HTML or other formats makes it exceptionally convenient to share and embed simulation data in web pages and applications. By delving into the essential features of this module, we trust that this article has equipped you with a deeper comprehension of its possibilities and how it can enhance your work in fluid dynamics visualization.

References

  1. PyAnsys
  2. PyFluent-Visualization module available @ PyPI
  3. PyFluent-Visualization Documentation
  4. Ansys Fluent