-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
3,154 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,101 @@ | ||
.. _ref_user_guide: | ||
|
||
.. _user_guide: | ||
|
||
************ | ||
User's Guide | ||
************ | ||
This guide contains pertinent information regarding using Ansys pyfluent-visualization and its | ||
========== | ||
User Guide | ||
========== | ||
This guide provides information regarding using Ansys PyFluent and its | ||
constituent modules and components. | ||
|
||
================================================ | ||
Understanding the pyfluent-visualization Modules | ||
================================================ | ||
|
||
.. | ||
This toctreemust be a top level index to get it to show up in | ||
pydata_sphinx_theme | ||
.. toctree:: | ||
:maxdepth: 1 | ||
:hidden: | ||
|
||
postprocessing | ||
|
||
|
||
PyFluent Basic Overview | ||
======================= | ||
Session objects are the main entry point when using the PyFluent library, where | ||
one or more Fluent server sessions can be launched simultaneously from the | ||
client. For example: | ||
|
||
.. code:: python | ||
solver_session = pyfluent.launch_fluent() | ||
or | ||
|
||
.. code:: python | ||
meshing_session = pyfluent.launch_fluent(meshing_mode=True) | ||
Each session object provides access to multiple services, such as boundary | ||
contitions, meshing workflows, field data properties, and so forth. | ||
|
||
PyFluent contains several basic service modules that provide access to core | ||
Fluent capabilities. | ||
|
||
- General command and query services are encompassed in three modules: | ||
|
||
+ The 'tui' modules are a collection of Python wrappers around the | ||
Fluent's traditional Text User Interface (TUI) command-based | ||
infrastructure. | ||
|
||
.. code:: | ||
solver_session.tui.define.models.unsteady_2nd_order('yes’) | ||
+ The 'settings' module is a Pythonic interface to access Fluent's setup | ||
and solution objects, where you can, for instance, enable a | ||
physics-based model for your simulation. | ||
|
||
.. code:: | ||
session.solver.root.setup.models.energy.enabled = True | ||
+ The 'datamodel' module is a Python interface to access the | ||
datamodel-driven aspects of Fluent, such as the meshing workflows. | ||
|
||
.. code:: | ||
import_geometry.arguments.update_dict({'AppendMesh':True}) | ||
- Surface field and mesh data services are available using the 'field_data' | ||
module, such as obtaining surface data for a specified surface. | ||
|
||
.. code:: | ||
surface_data = field_data.get_surfaces(surface_ids) | ||
- There are general modules available, such as 'health_check', 'transcript', | ||
and 'events' that provide access to generic features that are useful to | ||
running your simulation. For instance, | ||
|
||
.. code:: | ||
health_check_service.check_health() | ||
or | ||
|
||
.. code:: | ||
transcript_service.begin_streaming() | ||
or | ||
|
||
.. code:: | ||
events_service.begin_streaming() | ||
- Finally, there is a 'scheme_eval' module that provides access to Scheme | ||
function evaluation. For instance, | ||
|
||
.. code:: | ||
scheme_eval.string_eval("(rp-unsteady?)") | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
Analyzing Your Results | ||
====================== | ||
PyFluent postprocessing supports graphics and plotting. | ||
|
||
Rendering Graphics Objects | ||
-------------------------- | ||
The post package library is used for rendering graphics objects. | ||
The following graphics operations are supported. | ||
|
||
Displaying Mesh Objects | ||
~~~~~~~~~~~~~~~~~~~~~~~ | ||
The following example demonstrates how you can display the mesh object: | ||
|
||
.. code:: python | ||
import ansys.fluent.core as pyfluent | ||
from ansys.fluent.core import examples | ||
from ansys.fluent.post import set_config | ||
from ansys.fluent.post.matplotlib import Plots | ||
from ansys.fluent.post.pyvista import Graphics | ||
set_config(blocking=True, set_view_on_display="isometric") | ||
import_case = examples.download_file( | ||
filename="exhaust_system.cas.h5", directory="pyfluent/exhaust_system" | ||
) | ||
import_data = examples.download_file( | ||
filename="exhaust_system.dat.h5", directory="pyfluent/exhaust_system" | ||
) | ||
session = pyfluent.launch_fluent(precision="double", processor_count=2) | ||
session.solver.tui.file.read_case(case_file_name=import_case) | ||
session.solver.tui.file.read_data(case_file_name=import_data) | ||
graphics = Graphics(session=session) | ||
mesh1 = graphics.Meshes["mesh-1"] | ||
mesh1.show_edges = True | ||
mesh1.surfaces_list = [ | ||
"in1", | ||
"in2", | ||
"in3", | ||
"out1", | ||
"solid_up:1", | ||
"solid_up:1:830", | ||
"solid_up:1:830-shadow", | ||
] | ||
mesh1.display("window-1") | ||
Displaying Iso-Surfaces | ||
~~~~~~~~~~~~~~~~~~~~~~~ | ||
The following example demonstrates how you can display the iso-surface: | ||
|
||
.. code:: python | ||
surf_outlet_plane = graphics.Surfaces["outlet-plane"] | ||
surf_outlet_plane.surface.type = "iso-surface" | ||
iso_surf1 = surf_outlet_plane.surface.iso_surface | ||
iso_surf1.field = "y-coordinate" | ||
iso_surf1.iso_value = -0.125017 | ||
surf_outlet_plane.display("window-2") | ||
Displaying Contours | ||
~~~~~~~~~~~~~~~~~~~ | ||
The following example demonstrates how you can display the contour object: | ||
|
||
.. code:: python | ||
temperature_contour_manifold = graphics.Contours["contour-temperature-manifold"] | ||
temperature_contour_manifold.field = "temperature" | ||
temperature_contour_manifold.surfaces_list = [ | ||
"in1", | ||
"in2", | ||
"in3", | ||
"out1", | ||
"solid_up:1", | ||
"solid_up:1:830", | ||
] | ||
temperature_contour_manifold.display("window-3") | ||
Displaying Vectors | ||
~~~~~~~~~~~~~~~~~~ | ||
The following example demonstrates how you can display the vector object: | ||
|
||
.. code:: python | ||
velocity_vector = graphics.Vectors["velocity-vector"] | ||
velocity_vector.surfaces_list = ["outlet-plane"] | ||
velocity_vector.scale = 1 | ||
velocity_vector.display("window-4") | ||
Plotting Your Data | ||
------------------ | ||
The following plotting operations are supported. | ||
|
||
Displaying XY Plots | ||
~~~~~~~~~~~~~~~~~~~ | ||
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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Post Processing Examples | ||
Postprocessing Examples | ||
======================== | ||
These examples demonstrate how to the PyVista package to post process Fluent | ||
These examples demonstrate how to use the PyVista package to postprocess Fluent | ||
results. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.