Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
 into main
  • Loading branch information
prmukherj committed Nov 28, 2024
2 parents 05faa31 + 5c7b66e commit d363cb1
Show file tree
Hide file tree
Showing 26 changed files with 1,085 additions and 120 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

## Individual Contributors

* [Adam Boutin]([https:](https://github.com/ansaboutin))
* [Adam Boutin](https://github.com/ansaboutin)
* [Alexander Carvalho](https://github.com/acarvalh-work)
* [Aseem Jain](https://github.com/ajain-work)
* [Dan Williams](https://github.com/dnwillia-work)
* [Harshal Pohekar](https://github.com/hpohekar)
* [Mainak Kundu](https://github.com/mkundu1)
* [Prithwish Mukherjee](https://github.com/prmukherj)
* [Raphael Luciano](https://github.com/raph-luc)
* [Raphael Luciano](https://github.com/raph-luc)
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ the PyFluent-Visualization documentation.
graphics = Graphics(session=session)
temperature_contour = graphics.Contours["contour-temperature"]
temperature_contour.field = "temperature"
temperature_contour.surfaces_list = ["in1", "in2", "out1"]
temperature_contour.surfaces = ["in1", "in2", "out1"]
temperature_contour.display("window-1")
Usage in a JupyterLab environment
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api/visualization/graphics_windows_manager.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ the end of every time step and creates an animation.
#Create contour.
contour1 = graphics_session.Contours["contour-1"]
contour1.field = "velocity-magnitude"
contour1.surfaces_list = ['symmetry']
contour1.surfaces = ['symmetry']
#Display contour on window-1.
contour1.display("window-1")
Expand Down
10 changes: 5 additions & 5 deletions doc/source/api/visualization/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ standard Fluent commands to write graphics to a file.

.. code:: python
solver_session.tui.display.objects.contour['contour-1'] = {'boundary_values': True, 'color_map': {'color': 'field-velocity', 'font_automatic': True, 'font_name': 'Helvetica', 'font_size': 0.032, 'format': '%0.2e', 'length': 0.54, 'log_scale': False, 'position': 1, 'show_all': True, 'size': 100, 'user_skip': 9, 'visible': True, 'width': 6.0}, 'coloring': {'smooth': False}, 'contour_lines': False, 'display_state_name': 'None', 'draw_mesh': False, 'field': 'pressure', 'filled': True, 'mesh_object': '', 'node_values': True, 'range_option': {'auto_range_on': {'global_range': True}}, 'surfaces_list': [2, 5]}
solver_session.tui.display.objects.contour['contour-1'] = {'boundary_values': True, 'color_map': {'color': 'field-velocity', 'font_automatic': True, 'font_name': 'Helvetica', 'font_size': 0.032, 'format': '%0.2e', 'length': 0.54, 'log_scale': False, 'position': 1, 'show_all': True, 'size': 100, 'user_skip': 9, 'visible': True, 'width': 6.0}, 'coloring': {'smooth': False}, 'contour_lines': False, 'display_state_name': 'None', 'draw_mesh': False, 'field': 'pressure', 'filled': True, 'mesh_object': '', 'node_values': True, 'range_option': {'auto_range_on': {'global_range': True}}, 'surfaces': [2, 5]}
solver_session.tui.display.objects.contour['contour-1']()
solver_session.tui.display.objects.contour['contour-1'].field.set_state('velocity-magnitude')
solver_session.tui.display.objects.contour['contour-1'].field()
Expand Down Expand Up @@ -46,14 +46,14 @@ environment. PyVista is then used to visualize the extracted data.
# mesh
mesh1.show_edges = True
mesh1.surfaces_list = ['symmetry']
mesh1.surfaces = ['symmetry']
# contour
contour1.field = "velocity-magnitude"
contour1.surfaces_list = ['symmetry']
contour1.surfaces = ['symmetry']
contour2.field = "temperature"
contour2.surfaces_list = ['symmetry', 'wall']
contour2.surfaces = ['symmetry', 'wall']
# copy
graphics_session1.Contours["contour-3"] = contour2()
Expand Down Expand Up @@ -99,7 +99,7 @@ environment. Matplotlib is then used to plot data.
plot1=plots_session1.XYPlots["plot-1"]
#set properties
plot1.surfaces_list = ["symmetry"]
plot1.surfaces = ["symmetry"]
plot1.y_axis_function = "temperature"
#Draw plot
Expand Down
4 changes: 2 additions & 2 deletions doc/source/api/visualization/plots.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ a monitor plot.
plots_session = Plots(session)
plot1 = plots_session.XYPlots["plot-1"]
plot1.surfaces_list = ['symmetry', 'wall']
plot1.surfaces = ['symmetry', 'wall']
plot1.y_axis_function = "temperature"
plot1.plot("window-0")
Expand All @@ -26,7 +26,7 @@ a monitor plot.
pyvista_surface_provider = Graphics(session).Surfaces
plots_session = Plots(session, pyvista_surface_provider)
plot2 = plots_session.XYPlots["plot-2"]
plot2.surfaces_list = ['iso-surface-1']
plot2.surfaces = ['iso-surface-1']
plot2.y_axis_function = "temperature"
plot2.plot("window-0")
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api/visualization/plotter_windows_manager.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ of every time step.
#Create xy plot.
plot1 = plots_session.XYPlots["plot-1"]
plot1.surfaces_list = ['symmetry']
plot1.surfaces = ['symmetry']
plot1.y_axis_function = "temperature"
Expand Down
3 changes: 2 additions & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ def _stop_fluent_container(gallery_conf, fname):
# Pattern to search for example files
"filename_pattern": r"\.py",
# Disabled example scripts
"ignore_pattern": r"script_manifold\.py|flycheck*",
"ignore_pattern": r"script_manifold\.py|"
r"updated_script_manifold_example\.py|flycheck*",
# Remove the "Download all examples" button from the top level gallery
"download_all_examples": False,
# Sort gallery example by file name instead of number of lines (default)
Expand Down
8 changes: 4 additions & 4 deletions doc/source/users_guide/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ This example shows how you can display a mesh:
graphics = Graphics(session=solver_session)
mesh1 = graphics.Meshes["mesh-1"]
mesh1.show_edges = True
mesh1.surfaces_list = [
mesh1.surfaces = [
"in1",
"in2",
"in3",
Expand Down Expand Up @@ -74,7 +74,7 @@ This example shows how you can display a contour:
temperature_contour_manifold = graphics.Contours["contour-temperature-manifold"]
temperature_contour_manifold.field = "temperature"
temperature_contour_manifold.surfaces_list = [
temperature_contour_manifold.surfaces = [
"in1",
"in2",
"in3",
Expand Down Expand Up @@ -111,7 +111,7 @@ This example shows how you can display a vector:
.. code:: python
velocity_vector = graphics.Vectors["velocity-vector"]
velocity_vector.surfaces_list = ["outlet-plane"]
velocity_vector.surfaces = ["outlet-plane"]
velocity_vector.scale = 1
velocity_vector.display("window-4")
Expand All @@ -128,7 +128,7 @@ This example shows how you can display the XY plot:
plots_session_1 = Plots(solver_session)
xy_plot = plots_session_1.XYPlots["xy-plot"]
xy_plot.surfaces_list = ["outlet"]
xy_plot.surfaces = ["outlet"]
xy_plot.y_axis_function = "temperature"
xy_plot.plot("window-5")
Expand Down
12 changes: 6 additions & 6 deletions examples/00-postprocessing/post_processing_exhaust_manifold.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
# ~~~~~~~~~~~~~~~~~
# Get the surfaces list.

mesh1.surfaces_list = [
mesh1.surfaces = [
"in1",
"in2",
"in3",
Expand Down Expand Up @@ -170,7 +170,7 @@

temperature_contour = graphics.Contours["contour-temperature"]
temperature_contour.field = "temperature"
temperature_contour.surfaces_list = ["mid-plane-x", "outlet-plane"]
temperature_contour.surfaces = ["mid-plane-x", "outlet-plane"]
temperature_contour.display("window-6")

###############################################################################
Expand All @@ -180,7 +180,7 @@

temperature_contour_manifold = graphics.Contours["contour-temperature-manifold"]
temperature_contour_manifold.field = "temperature"
temperature_contour_manifold.surfaces_list = [
temperature_contour_manifold.surfaces = [
"in1",
"in2",
"in3",
Expand All @@ -197,7 +197,7 @@

velocity_vector = graphics.Vectors["velocity-vector"]
velocity_vector.field = "pressure"
velocity_vector.surfaces_list = ["solid_up:1:830"]
velocity_vector.surfaces = ["solid_up:1:830"]
velocity_vector.scale = 2
velocity_vector.display("window-8")

Expand All @@ -208,7 +208,7 @@

pathlines = graphics.Pathlines["pathlines"]
pathlines.field = "velocity-magnitude"
pathlines.surfaces_list = ["inlet", "inlet1", "inlet2"]
pathlines.surfaces = ["inlet", "inlet1", "inlet2"]
pathlines.display("window-9")

###############################################################################
Expand All @@ -230,7 +230,7 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Set the surface on which to generate the plot and the Y-axis function.

xy_plot.surfaces_list = ["outlet"]
xy_plot.surfaces = ["outlet"]
xy_plot.y_axis_function = "temperature"

###############################################################################
Expand Down
29 changes: 22 additions & 7 deletions examples/00-postprocessing/script_manifold.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,23 @@
# exec(open("script_manifold.py").read())

import ansys.fluent.core as pyfluent
from ansys.fluent.core import examples

session = pyfluent.connect_to_fluent(ip="10.18.44.105", port=62599, password="hzk1dhbc")
import_case = examples.download_file(
file_name="exhaust_system.cas.h5", directory="pyfluent/exhaust_system"
)

import_data = examples.download_file(
file_name="exhaust_system.dat.h5", directory="pyfluent/exhaust_system"
)

session = pyfluent.launch_fluent(
precision="double",
processor_count=2,
start_transcript=False,
mode="solver",
ui_mode="gui",
)

from ansys.fluent.visualization import set_config

Expand All @@ -31,25 +46,25 @@
# mesh
mesh1 = graphics_session1.Meshes["mesh-1"]
mesh1.show_edges = True
mesh1.surfaces_list = ["solid_up:1:830"]
mesh1.surfaces = ["solid_up:1:830"]

# pathlines
pathlines1 = graphics_session1.Pathlines["pathlines-1"]
pathlines1.field = "velocity-magnitude"
pathlines1.surfaces_list = ["inlet"]
pathlines1.surfaces = ["inlet"]

# contour
contour1 = graphics_session1.Contours["contour-1"]
contour1.field = "velocity-magnitude"
contour1.surfaces_list = ["solid_up:1:830"]
contour1.surfaces = ["solid_up:1:830"]


graphics_session1.Contours["contour-2"]
graphics_session1_1.Contours["contour-3"]

# vector
vector1 = graphics_session1_1.Vectors["vector-1"]
vector1.surfaces_list = ["solid_up:1:830"]
vector1.surfaces = ["solid_up:1:830"]
vector1.scale = 4.0
vector1.skip = 0
vector1.field = "temperature"
Expand All @@ -68,8 +83,8 @@


p1 = matplotlib_plots1.XYPlots["p1"]
p1.surfaces_list = ["solid_up:1:830", "surface-1"]
p1.surfaces_list = ["solid_up:1:830"]
p1.surfaces = ["solid_up:1:830", "surface-1"]
p1.surfaces = ["solid_up:1:830"]
p1.y_axis_function = "temperature"
p1.plot("p1")

Expand Down
Loading

0 comments on commit d363cb1

Please sign in to comment.