Skip to content
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
35 changes: 31 additions & 4 deletions doc/source/users_guide/postprocessing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,34 @@ The following example demonstrates how you can display the xy plot:
.. code:: python

plots_session_1 = Plots(session)
plot_1 = plots_session_1.XYPlots["plot-1"]
plot_1.surfaces_list = ["outlet"]
plot_1.y_axis_function = "temperature"
plot_1.plot("window-5")
xy_plot = plots_session_1.XYPlots["xy-plot"]
xy_plot.surfaces_list = ["outlet"]
xy_plot.y_axis_function = "temperature"
xy_plot.plot("window-5")

Plotting Residual
~~~~~~~~~~~~~~~~~
The following example demonstrates how you can plot solution residual:

.. code:: python


matplotlib_plots1 = Plots(session)
residual = matplotlib_plots1.Monitors["residual"]
residual.monitor_set_name = "residual"
residual.plot("window-6")

Plotting Solution Minitors
~~~~~~~~~~~~~~~~~~~~~~~~~~
The following example demonstrates how you can plot solution monitors:

.. code:: python

session.solver.tui.solve.initialize.hyb_initialization()
session.solver.tui.solve.set.number_of_iterations(50)
session.solver.tui.solve.iterate()
session.monitors_manager.get_monitor_set_names()
matplotlib_plots1 = Plots(session)
mass_bal_rplot = matplotlib_plots1.Monitors["mass-bal-rplot"]
mass_bal_rplot.monitor_set_name = "mass-bal-rplot"
mass_bal_rplot.plot("window-7")
53 changes: 44 additions & 9 deletions examples/00-postprocessing/post_processing_exhaust_manifold.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
- Display velocity vectors.
- Plot quantitative results using Matplotlib
"""
# sphinx_gallery_thumbnail_number = -3
# sphinx_gallery_thumbnail_number = -5

###############################################################################
import ansys.fluent.core as pyfluent
Expand Down Expand Up @@ -55,10 +55,9 @@
mesh1 = graphics.Meshes["mesh-1"]

###############################################################################
# Show edges and faces
# Show edges

mesh1.show_edges = True
mesh1.show_faces = True

###############################################################################
# Get the surfaces list
Expand Down Expand Up @@ -91,7 +90,7 @@
surf_outlet_plane.display("window-3")

###############################################################################
# Create iso-surface on the mid-plane (Issue # 276)
# Create iso-surface on the mid-plane

surf_mid_plane_x = graphics.Surfaces["mid-plane-x"]
surf_mid_plane_x.surface.type = "iso-surface"
Expand All @@ -100,6 +99,17 @@
iso_surf2.iso_value = -0.174
surf_mid_plane_x.display("window-4")

###############################################################################
# Create iso-surface using the velocity magnitude

surf_vel_contour = graphics.Surfaces["surf-vel-contour"]
surf_vel_contour.surface.type = "iso-surface"
iso_surf3 = surf_vel_contour.surface.iso_surface
iso_surf3.field = "velocity-magnitude"
iso_surf3.rendering = "contour"
iso_surf3.iso_value = 0.0
surf_vel_contour.display("window-5")

###############################################################################
# Temperature contour on the mid-plane and the outlet

Expand Down Expand Up @@ -139,18 +149,43 @@

###############################################################################
# Create a default XY-Plot
plot_1 = plots_session_1.XYPlots["plot-1"]
xy_plot = plots_session_1.XYPlots["xy-plot"]

###############################################################################
# Set the surface on which the plot is plotted and the Y-axis function
plot_1.surfaces_list = ["outlet"]
plot_1.y_axis_function = "temperature"
xy_plot.surfaces_list = ["outlet"]
xy_plot.y_axis_function = "temperature"

###############################################################################
# Plot the created XY-Plot
plot_1.plot("window-7")
xy_plot.plot("window-7")

###############################################################################
# Plot residual

matplotlib_plots1 = Plots(session)
residual = matplotlib_plots1.Monitors["residual"]
residual.monitor_set_name = "residual"
residual.plot("window-8")

#########################################################################
###############################################################################
# Solve and Plot Solution Minitors.

session.solver.tui.solve.initialize.hyb_initialization()
session.solver.tui.solve.set.number_of_iterations(50)
session.solver.tui.solve.iterate()
session.monitors_manager.get_monitor_set_names()
matplotlib_plots1 = Plots(session)
mass_bal_rplot = matplotlib_plots1.Monitors["mass-bal-rplot"]
mass_bal_rplot.monitor_set_name = "mass-bal-rplot"
mass_bal_rplot.plot("window-9")

matplotlib_plots1 = Plots(session)
point_vel_rplot = matplotlib_plots1.Monitors["point-vel-rplot"]
point_vel_rplot.monitor_set_name = "point-vel-rplot"
point_vel_rplot.plot("window-10")

###############################################################################
# Close Fluent

session.exit()