Skip to content

Commit cc530df

Browse files
Users Guide (#441)
* Users guide changes 01 * Users guide changes 02 * Users guide changes 03 * Users guide changes 04 * Users guide changes 05 * Users guide changes 06 * Users guide changes 07 * Update doc/source/users_guide/index.rst Co-authored-by: Dan Williams <[email protected]> * Update doc/source/users_guide/index.rst Co-authored-by: Dan Williams <[email protected]> * Update doc/source/users_guide/launching_ansys_fluent.rst Co-authored-by: Dan Williams <[email protected]> * Update doc/source/users_guide/materials.rst Co-authored-by: Dan Williams <[email protected]> * Update doc/source/users_guide/boundary_conditions.rst Co-authored-by: Dan Williams <[email protected]> * Update doc/source/users_guide/boundary_conditions.rst Co-authored-by: Dan Williams <[email protected]> * Update doc/source/users_guide/boundary_conditions.rst Co-authored-by: Dan Williams <[email protected]> * Update doc/source/users_guide/general_settings.rst Co-authored-by: Dan Williams <[email protected]> * Update doc/source/users_guide/materials.rst Co-authored-by: Dan Williams <[email protected]> * Update doc/source/users_guide/models.rst Co-authored-by: Dan Williams <[email protected]> * Update doc/source/users_guide/models.rst Co-authored-by: Dan Williams <[email protected]> * Update doc/source/users_guide/solution.rst Co-authored-by: Dan Williams <[email protected]> Co-authored-by: Dan Williams <[email protected]>
1 parent d12f22d commit cc530df

File tree

11 files changed

+1224
-11
lines changed

11 files changed

+1224
-11
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
Defining Boundary Conditions
2+
============================
3+
PyFluent supports defining boundary conditions using the TUI API and the
4+
the Settings API (Beta).
5+
6+
Text User Interface (TUI) API
7+
-----------------------------
8+
The following example demonstrates how you can define boundary conditions using
9+
the TUI API:
10+
11+
.. code:: python
12+
13+
session.solver.tui.define.boundary_conditions.set.velocity_inlet(
14+
"cold-inlet", [], "vmag", "no", 0.4, "quit"
15+
)
16+
session.solver.tui.define.boundary_conditions.set.velocity_inlet(
17+
"cold-inlet", [], "ke-spec", "no", "no", "no", "yes", "quit"
18+
)
19+
session.solver.tui.define.boundary_conditions.set.velocity_inlet(
20+
"cold-inlet", [], "turb-intensity", 5, "quit"
21+
)
22+
session.solver.tui.define.boundary_conditions.set.velocity_inlet(
23+
"cold-inlet", [], "turb-hydraulic-diam", 4, "quit"
24+
)
25+
session.solver.tui.define.boundary_conditions.set.velocity_inlet(
26+
"cold-inlet", [], "temperature", "no", 293.15, "quit"
27+
)
28+
29+
Settings API (Beta)
30+
----------------------
31+
The following example demonstrates how you can define boundary conditions using
32+
the Settings API:
33+
34+
.. code:: python
35+
36+
session.solver.root.setup.boundary_conditions.velocity_inlet["cold-inlet"].vmag = {
37+
"option": "constant or expression",
38+
"constant": 0.4,
39+
}
40+
session.solver.root.setup.boundary_conditions.velocity_inlet[
41+
"cold-inlet"
42+
].ke_spec = "Intensity and Hydraulic Diameter"
43+
session.solver.root.setup.boundary_conditions.velocity_inlet[
44+
"cold-inlet"
45+
].turb_intensity = 5
46+
session.solver.root.setup.boundary_conditions.velocity_inlet[
47+
"cold-inlet"
48+
].turb_hydraulic_diam = "4 [in]"
49+
session.solver.root.setup.boundary_conditions.velocity_inlet["cold-inlet"].t = {
50+
"option": "constant or expression",
51+
"constant": 293.15,
52+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Applying General Settings
2+
=========================
3+
PyFluent supports defining general settings using the TUI API and
4+
the Settings API (Beta).
5+
6+
Text User Interface (TUI) API
7+
-----------------------------
8+
The following example demonstrates how you can define units using
9+
the TUI API:
10+
11+
.. code:: python
12+
13+
session.solver.tui.define.units("length", "in")

doc/source/users_guide/index.rst

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,37 @@
1+
.. _ref_user_guide:
12

2-
.. _user_guide:
3-
4-
************
5-
User's Guide
6-
************
7-
This guide contains pertinent information regarding using Ansys PyFluent and its
3+
==========
4+
User Guide
5+
==========
6+
This guide provides information regarding using Ansys PyFluent and its
87
constituent modules and components.
98

10-
==================================
11-
Understanding the PyFluent Modules
12-
==================================
9+
10+
..
11+
This toctreemust be a top level index to get it to show up in
12+
pydata_sphinx_theme
13+
14+
.. toctree::
15+
:maxdepth: 1
16+
:hidden:
17+
18+
launching_ansys_fluent
19+
meshing_workflows
20+
general_settings
21+
solver_settings
22+
models
23+
materials
24+
boundary_conditions
25+
solution
26+
postprocessing
27+
parametric_workflows
28+
29+
30+
PyFluent Basic Overview
31+
=======================
1332
Session objects are the main entry point when using the PyFluent library, where
14-
one or more Fluent client sessions can be launched simulateously from the
15-
server. For example:
33+
one or more Fluent server sessions can be launched simultaneously from the
34+
client. For example:
1635

1736
.. code:: python
1837
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
Launching Ansys Fluent Locally
2+
==============================
3+
Fluent can be started from python in gRPC mode using
4+
:func:`launch_fluent() <ansys.fluent.core.launcher.launcher.launch_fluent>`.
5+
This starts Fluent in the background and sends commands to that service.
6+
7+
.. code:: python
8+
9+
import ansys.fluent.core as pyfluent
10+
solver_session = pyfluent.launch_fluent()
11+
12+
Fluent is now active and you can send commands to it as a Python class.
13+
14+
Launcher Options
15+
----------------
16+
Examples:
17+
18+
Solver Mode
19+
~~~~~~~~~~~
20+
The following example demonstrates how you can start Fluent using the default launcher options:
21+
22+
.. code:: python
23+
24+
solver_session = pyfluent.launch_fluent()
25+
26+
Meshing Mode
27+
~~~~~~~~~~~~
28+
The following example demonstrates how you can start Fluent in the meshing mode:
29+
30+
.. code:: python
31+
32+
meshing_session = pyfluent.launch_fluent(meshing_mode=True)
33+
34+
Precision
35+
~~~~~~~~~
36+
The following example demonstrates how you can select the double precision:
37+
38+
.. code:: python
39+
40+
solver_session = pyfluent.launch_fluent(precision="double")
41+
42+
Dimension
43+
~~~~~~~~~
44+
The following example demonstrates how you can select the 2d dimension:
45+
46+
.. code:: python
47+
48+
solver_session = pyfluent.launch_fluent(precision="double", version="2d")
49+
50+
Number of Processors
51+
~~~~~~~~~~~~~~~~~~~~
52+
The following example demonstrates how you can select the number of processors:
53+
54+
.. code:: python
55+
56+
solver_session = pyfluent.launch_fluent(precision="double", version="2d", processor_count=2)
57+
58+
API Reference
59+
-------------
60+
For more details on controlling how Ansys Fluent launches locally, see the
61+
function description for :func:`launch_fluent() <ansys.fluent.core.launcher.launcher.launch_fluent>`.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
Defining Materials
2+
==================
3+
PyFluent supports defining materials using the TUI API and
4+
Settings Module (Beta).
5+
6+
Text User Interface (TUI) API
7+
-----------------------------
8+
The following example demonstrates how you can define materials using
9+
the TUI API:
10+
11+
.. code:: python
12+
13+
session.solver.tui.define.materials.copy("fluid", "water-liquid")
14+
session.solver.tui.define.boundary_conditions.fluid(
15+
"elbow-fluid",
16+
"yes",
17+
"water-liquid",
18+
"no",
19+
"no",
20+
"no",
21+
"no",
22+
"0",
23+
"no",
24+
"0",
25+
"no",
26+
"0",
27+
"no",
28+
"0",
29+
"no",
30+
"0",
31+
"no",
32+
"1",
33+
"no",
34+
"no",
35+
"no",
36+
"no",
37+
"no",
38+
)
39+
40+
Settings API (Beta)
41+
----------------------
42+
The following example demonstrates how you can define materials using
43+
the settings module (Beta):
44+
45+
.. code:: python
46+
47+
session.solver.root.setup.materials.copy_database_material_by_name(type="fluid", name="water-liquid")
48+
session.solver.root.setup.cell_zone_conditions.fluid["elbow-fluid"].material = "water-liquid"

0 commit comments

Comments
 (0)