Skip to content

Commit 2d39a32

Browse files
Doc/update documentation (#504)
update documentation structure. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent dbd8085 commit 2d39a32

File tree

7 files changed

+130
-177
lines changed

7 files changed

+130
-177
lines changed

doc/source/getting_started/index.rst

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -43,27 +43,9 @@ install with:
4343
Any changes that you make locally are reflected in your setup after you restart
4444
the Python kernel.
4545

46-
*************
47-
Launch Fluent
48-
*************
49-
50-
You can launch Fluent from PyFluent using the ``launch_fluent`` function:
51-
52-
.. code:: python
53-
54-
import ansys.fluent.core as pyfluent
55-
session = pyfluent.launch_fluent(precision="double", processor_count=2, mode="solver")
56-
session.check_health()
57-
session.start_transcript() # Streaming the transcript locally
58-
59-
PyFluent-Visualization seamlessly integrates with both
60-
`PyVista <https://www.pyvista.org/>`_ and `Matplotlib <https://matplotlib.org/>`_.
61-
Additionally, it offers flexibility to incorporate other open-source data visualization tools,
62-
such as `Plotly <https://plotly.com/python/>`_, see :ref:`ref_configure`
63-
64-
If you want to print the debug information for development, set the following
65-
environment variable:
66-
67-
.. code:: python
68-
69-
pyfluent.set_log_level('DEBUG') # for development, by default only errors are shown
46+
.. note::
47+
PyFluent-Visualization seamlessly integrates with
48+
`PyVista <https://www.pyvista.org/>`_, `Matplotlib <https://matplotlib.org/>`_
49+
and `Plotly <https://plotly.com/python/>`_.
50+
Additionally, it offers flexibility to `integrate other data visualization
51+
tools <ref_integration>`_.

doc/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ PyFluent-Visualization documentation |version|
77

88
getting_started/index
99
users_guide/index
10-
users_guide/configure
10+
users_guide/integration
1111
visualization/visualization_contents.rst
1212
examples/index
1313
contributing

doc/source/users_guide/configure.rst

Lines changed: 0 additions & 35 deletions
This file was deleted.

doc/source/users_guide/index.rst

Lines changed: 45 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,14 @@ Use the following script to launch Fluent and load your case and data files:
2626
file_name="exhaust_system.dat.h5", directory="pyfluent/exhaust_system"
2727
)
2828
29-
solver_session = pyfluent.launch_fluent(precision="double", processor_count=2, mode="solver")
29+
solver_session = pyfluent.launch_fluent(
30+
precision=pyfluent.Precision.DOUBLE,
31+
processor_count=2,
32+
mode=pyfluent.FluentMode.SOLVER,
33+
)
3034
31-
solver_session.tui.file.read_case(import_case)
32-
solver_session.tui.file.read_data(import_data)
35+
solver_session.settings.file.read_case(file_name=import_case)
36+
solver_session.settings.file.read_data(file_name=import_data)
3337
3438
Graphics operations
3539
-------------------
@@ -43,25 +47,13 @@ The following example demonstrates how to display a mesh with and without edges:
4347
4448
from ansys.fluent.visualization import GraphicsWindow, Mesh
4549
46-
mesh_surfaces_list = [
47-
"in1",
48-
"in2",
49-
"in3",
50-
"out1",
51-
"solid_up:1",
52-
"solid_up:1:830",
53-
"solid_up:1:830-shadow",
54-
]
55-
56-
mesh_object_1 = Mesh(solver=solver_session, show_edges=True, surfaces=mesh_surfaces_list)
57-
mesh_window = GraphicsWindow(grid=(1, 2))
58-
mesh_window.add_graphics(mesh1, position=(0, 0))
59-
60-
mesh_object_2 = Mesh(solver=solver_session, surfaces=mesh_surfaces_list)
61-
mesh_object_2.show_edges = False
50+
mesh = Mesh(solver=solver_session, show_edges=True, surfaces=["in1", "in2", "in3"])
51+
window = GraphicsWindow(grid=(1, 2))
52+
window.add_graphics(mesh, position=(0, 0))
6253
63-
mesh_window.add_graphics(mesh2, position=(0, 1))
64-
mesh_window.show()
54+
mesh = Mesh(solver=solver_session, surfaces=["in1", "in2", "in3"])
55+
window.add_graphics(mesh, position=(0, 1))
56+
window.show()
6557
6658
Display plane-surface
6759
~~~~~~~~~~~~~~~~~~~~~
@@ -75,20 +67,25 @@ Create and visualize a plane surface at a specified z-coordinate:
7567
surf_xy_plane.type = "plane-surface"
7668
surf_xy_plane.creation_method = "xy-plane"
7769
surf_xy_plane.z = -0.0441921
78-
surface_window = GraphicsWindow()
79-
surface_window.add_graphics(surf_xy_plane)
80-
surface_window.show()
70+
window = GraphicsWindow()
71+
window.add_graphics(surf_xy_plane)
72+
window.show()
8173
8274
Display iso-surface
8375
~~~~~~~~~~~~~~~~~~~
8476
Generate an iso-surface based on the y-coordinate:
8577

8678
.. code-block:: python
8779
88-
surf_outlet_plane = Surface(solver=solver_session, type="iso-surface", field="y-coordinate", iso_value=-0.125017)
89-
surface_window = GraphicsWindow()
90-
surface_window.add_graphics(surf_outlet_plane)
91-
surface_window.show()
80+
surf_outlet_plane = Surface(
81+
solver=solver_session,
82+
type="iso-surface",
83+
field="y-coordinate",
84+
iso_value=-0.125017
85+
)
86+
window = GraphicsWindow()
87+
window.add_graphics(surf_outlet_plane)
88+
window.show()
9289
9390
Display contour
9491
~~~~~~~~~~~~~~~
@@ -98,22 +95,14 @@ Plot a temperature contour over selected surfaces:
9895
9996
from ansys.fluent.visualization import Contour
10097
101-
cont_surfaces_list = [
102-
"in1",
103-
"in2",
104-
"in3",
105-
"out1",
106-
"solid_up:1",
107-
"solid_up:1:830",
108-
]
10998
temperature_contour_manifold = Contour(
11099
solver=solver_session,
111100
field="temperature",
112-
surfaces=cont_surfaces_list,
101+
surfaces=["in1", "in2", "in3"],
113102
)
114-
contour_window = GraphicsWindow()
115-
contour_window.add_graphics(temperature_contour_manifold)
116-
contour_window.show()
103+
window = GraphicsWindow()
104+
window.add_graphics(temperature_contour_manifold)
105+
window.show()
117106
118107
Display vector
119108
~~~~~~~~~~~~~~
@@ -129,9 +118,9 @@ Visualize velocity vectors over a selected surface:
129118
surfaces=["solid_up:1:830"],
130119
scale=2,
131120
)
132-
vector_window = GraphicsWindow()
133-
vector_window.add_graphics(velocity_vector)
134-
vector_window.show()
121+
window = GraphicsWindow()
122+
window.add_graphics(velocity_vector)
123+
window.show()
135124
136125
Display pathlines
137126
~~~~~~~~~~~~~~~~~
@@ -145,9 +134,9 @@ Visualize pathlines to analyze flow patterns:
145134
pathlines.field = "velocity-magnitude"
146135
pathlines.surfaces = ["inlet", "inlet1", "inlet2"]
147136
148-
pathlines_window = GraphicsWindow()
149-
pathlines_window.add_graphics(pathlines)
150-
pathlines_window.show()
137+
window = GraphicsWindow()
138+
window.add_graphics(pathlines)
139+
window.show()
151140
152141
Plot operations
153142
---------------
@@ -166,9 +155,9 @@ Generate an XY plot of temperature variations at an outlet:
166155
surfaces=["outlet"],
167156
y_axis_function="temperature",
168157
)
169-
xy_plot_window = GraphicsWindow()
170-
xy_plot_window.add_graphics(xy_plot)
171-
xy_plot_window.show()
158+
window = GraphicsWindow()
159+
window.add_graphics(xy_plot)
160+
window.show()
172161
173162
Display solution residual plot
174163
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -180,9 +169,9 @@ Plot solution residuals:
180169
181170
residual = Monitor(solver=solver_session)
182171
residual.monitor_set_name = "residual"
183-
monitor_window = GraphicsWindow()
184-
monitor_window.add_graphics(residual)
185-
monitor_window.show()
172+
window = GraphicsWindow()
173+
window.add_graphics(residual)
174+
window.show()
186175
187176
Display solution monitors plot
188177
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -195,12 +184,12 @@ Monitor solution convergence using mass balance and velocity plots:
195184
196185
mass_bal_rplot = Monitor(solver=solver_session)
197186
mass_bal_rplot.monitor_set_name = "mass-bal-rplot"
198-
monitor_window = GraphicsWindow(grid=(1, 2))
199-
monitor_window.add_graphics(mass_bal_rplot, position=(0, 0))
187+
window = GraphicsWindow(grid=(1, 2))
188+
window.add_graphics(mass_bal_rplot, position=(0, 0))
200189
201190
point_vel_rplot = Monitor(solver=solver_session, monitor_set_name="point-vel-rplot")
202-
monitor_window.add_graphics(point_vel_rplot, position=(0, 1))
203-
monitor_window.show()
191+
window.add_graphics(point_vel_rplot, position=(0, 1))
192+
window.show()
204193
205194
Interactive Graphics
206195
--------------------
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.. _ref_integration:
2+
3+
==================================================================
4+
Integrating Custom Rendering Libraries with PyFluent-Visualization
5+
==================================================================
6+
7+
Will be available soon.

0 commit comments

Comments
 (0)