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
Binary file added doc/source/_static/DP_table.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/source/_static/exhaust_system.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/source/_static/mixing_elbow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion examples/00-fluent/exhaust_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
unlike the watertight workflow used in Fluid Flow in a Mixing Elbow, is
appropriate for geometries with imperfections, such as gaps and leakages.

End-to-end Fault Tolerant Meshing Workflow example:
End-to-end Fault Tolerant Meshing Workflow example

- Use the Fault-tolerant Meshing guided workflow to:
- Import a CAD geometry and manage individual parts
Expand All @@ -34,6 +34,8 @@
to demonstrate the automatic leakage detection aspects of the meshing workflow.
"""

# sphinx_gallery_thumbnail_path = '_static/exhaust_system.png'

###############################################################################
# First, download the geometry file and start Fluent as a service with
# Meshing Mode, Double Precision, Number of Processors 2
Expand Down
79 changes: 3 additions & 76 deletions examples/00-fluent/mixing_elbow.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
temperature field in the area of the mixing region in order to properly design
the junction.

End-to-end Watertight Meshing Workflow example:
End-to-end Watertight Meshing Workflow example

- Use the Watertight Geometry guided workflow to:
- Import a CAD geometry
Expand All @@ -33,17 +33,14 @@
boundary conditions are given in SI units. The Reynolds number for the flow at
the larger inlet is 50, 800, so a turbulent flow model will be required.
"""
# sphinx_gallery_thumbnail_path = '_static/mixing_elbow.png'

###############################################################################
# First, download the geometry file and start Fluent as a service with
# Meshing Mode, Double Precision, Number of Processors 2

import ansys.fluent.core as pyfluent
from ansys.fluent.core import examples
from ansys.fluent.post import set_config
from ansys.fluent.post.pyvista import Graphics

set_config(blocking=True, set_view_on_display="isometric")

import_filename = examples.download_file("mixing_elbow.pmdb", "pyfluent/mixing_elbow")

Expand Down Expand Up @@ -346,21 +343,6 @@
# Solve for 100 Iterations.
session.solver.tui.solve.iterate(100)

###############################################################################
# Examine the mass flux report for convergence: Select cold-inlet, hot-inlet,
# and outlet from the Boundaries selection list.

# session.solver.tui.report.fluxes.mass_flow(
# "no",
# "cold-inlet",
# "hot-inlet",
# "outlet",
# "()",
# "yes",
# "mass-flux1.flp",
# )


###############################################################################
# Save the data file (mixing_elbow1.dat.h5).
# session.solver.tui.file.write_data('mixing_elbow1.dat.h5')
Expand All @@ -371,7 +353,6 @@
# Provide contour-vel for Contour Name. Select velocity magnitude. Select
# symmetry-xyplane from the Surfaces list. Display contour-vel contour.


session.solver.tui.display.objects.create(
"contour",
"contour-vel",
Expand Down Expand Up @@ -436,7 +417,7 @@
"2",
"quit",
)
# session.solver.tui.display.objects.display("vector-vel")
# session.solver.tui.display.objects.display("vector")

###############################################################################
# Create an iso-surface representing the intersection of the plane z=0 and the
Expand All @@ -458,59 +439,6 @@
"()",
"quit",
)
# session.solver.tui.display.objects.display("xy-outlet-temp")
# session.solver.tui.plot.plot(
# "yes",
# "temp-1.xy",
# "no",
# "no",
# "no",
# "temperature",
# "yes",
# "1",
# "0",
# "0",
# "z=0_outlet",
# "()",
# )
#

###############################################################################
# Mesh display using PyVista

graphics_session = Graphics(session)
mesh_1 = graphics_session.Meshes["mesh-1"]
mesh_1.show_edges = True
mesh_1.surfaces_list = [
"cold-inlet",
"hot-inlet",
"wall-elbow",
"wall-inlet",
"symmetry-xyplane",
"outlet",
]

mesh_1.display()

###############################################################################
# Temperature Contour display using PyVista

# contour_1 = graphics_session.Contours["contour_1"]
# contour_1.field = "temperature"
# contour_1.surfaces_list = [
# "symmetry-xyplane"
# ]
# contour_1.display()

###############################################################################
# Velocity Magnitude Contour display using PyVista

# contour_2 = graphics_session.Contours["contour_2"]
# contour_2.field = "velocity-magnitude"
# contour_2.surfaces_list = [
# "symmetry-xyplane"
# ]
# contour_2.display()

###############################################################################
# Write final case and data.
Expand All @@ -521,5 +449,4 @@

session.exit()


###############################################################################
33 changes: 1 addition & 32 deletions examples/00-fluent/mixing_elbow_settings_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
temperature field in the area of the mixing region in order to properly design
the junction.

This example demonstrates use of 'settings' modules (Beta):
This example demonstrates use of 'settings' modules (Beta)

- Launch Ansys Fluent
- Import Mesh
Expand All @@ -18,7 +18,6 @@
- Setup Boundary Conditions
- Iniialize and Solve
- Compute Mass Flow Rate and Temperature
- Display Mesh and Contour using PyVista

Problem Description:
A cold fluid at 20 deg C flows into the pipe through a large inlet, and mixes
Expand All @@ -27,18 +26,13 @@
boundary conditions are given in SI units. The Reynolds number for the flow at
the larger inlet is 50, 800, so a turbulent flow model will be required.
"""
# sphinx_gallery_thumbnail_number = 2

###############################################################################
# First, download the mesh file and start Fluent as a service with
# Solver Mode, Double Precision, Number of Processors 2

import ansys.fluent.core as pyfluent
from ansys.fluent.core import examples
from ansys.fluent.post import set_config
from ansys.fluent.post.pyvista import Graphics

set_config(blocking=True, set_view_on_display="isometric")

import_filename = examples.download_file("mixing_elbow.msh.h5", "pyfluent/mixing_elbow")

Expand Down Expand Up @@ -196,31 +190,6 @@
session.solver.root.solution.report_definitions.flux["mass_flow_rate"].print_state()
session.solver.root.solution.report_definitions.compute(report_defs=["mass_flow_rate"])

###############################################################################
# Mesh display using PyVista

graphics_session = Graphics(session)
mesh_1 = graphics_session.Meshes["mesh-1"]
mesh_1.show_edges = True
mesh_1.surfaces_list = [
"cold-inlet",
"hot-inlet",
"wall-elbow",
"wall-inlet",
"symmetry-xyplane",
"outlet",
]

mesh_1.display()

###############################################################################
# Temperature Contour display using PyVista

contour_1 = graphics_session.Contours["contour_1"]
contour_1.field = "temperature"
contour_1.surfaces_list = ["symmetry-xyplane"]
contour_1.display()

###############################################################################
# Write final case and data.
# session.solver.tui.file.write_case_data('mixing_elbow2_set.cas.h5')
Expand Down
20 changes: 3 additions & 17 deletions examples/01-parametric/parametric_static_mixer_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

Parametric Study Workflow
------------------------------
This parametric study workflow example performs these steps:

This parametric study workflow example performs these steps

- Reads a case file and data file
- Creates input and output parameters
Expand All @@ -13,6 +14,7 @@
- Creates, updates, and deletes more DPs
- Creates, renames, duplicates and deletes parametric studies
"""
# sphinx_gallery_thumbnail_path = '_static/DP_table.png'

############################################################################
from pathlib import Path
Expand All @@ -21,7 +23,6 @@
from ansys.fluent.core import examples
from ansys.fluent.parametric import ParametricProject, ParametricStudy
from ansys.fluent.post import set_config
from ansys.fluent.post.pyvista import Graphics

set_config(blocking=True, set_view_on_display="isometric")

Expand Down Expand Up @@ -146,21 +147,6 @@

study_1.update_all_design_points()

#########################################################################
# Mesh display using PyVista

graphics_session = Graphics(session)
mesh_1 = graphics_session.Meshes["mesh-1"]
mesh_1.show_edges = True
mesh_1.surfaces_list = [
"inlet1",
"inlet2",
"wall",
"outlet",
]

mesh_1.display()

###############################################################################
# Export design point table as a CSV table

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
The flow through the manifold is turbulent and
involves conjugate heat transfer.

This example demonstrates postprocessing using pyvista:
This example demonstrates postprocessing using pyvista

- Create surfaces for the display of 3D data.
- Display filled contours of temperature on several surfaces.
- Display velocity vectors.
- Plot quantitative results using Matplotlib
"""
# sphinx_gallery_thumbnail_number = -1
# sphinx_gallery_thumbnail_number = -3

###############################################################################
import ansys.fluent.core as pyfluent
Expand Down Expand Up @@ -127,8 +127,8 @@
# Currently using outlet-plane since mid-plane is affected by Issue # 276

velocity_vector = graphics.Vectors["velocity-vector"]
velocity_vector.surfaces_list = ["outlet-plane"]
velocity_vector.scale = 1
velocity_vector.surfaces_list = ["solid_up:1:830"]
velocity_vector.scale = 2
velocity_vector.display("window-6")

###############################################################################
Expand Down