-
Notifications
You must be signed in to change notification settings - Fork 56
Adding some more user guide examples #577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d3de5a5
Adding some more user guide examples
ypatel-qa e7162b3
Update doc/source/user_guide/general_settings.rst
ypatel-qa 7c22c79
Update solution.rst
ypatel-qa 666e836
Adding second set of examples
ypatel-qa 425b39a
Resolving PR feedback
ypatel-qa 0270fce
Typo Fix for mesh check
ypatel-qa bdf0131
Update doc/source/user_guide/boundary_conditions.rst
ypatel-qa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,51 +1,142 @@ | ||
Defining Boundary Conditions | ||
============================ | ||
PyFluent supports defining boundary conditions using the TUI API and :ref:`ref_settings`. | ||
|
||
Text User Interface (TUI) API | ||
----------------------------- | ||
The following example demonstrates how you can define boundary conditions using | ||
the TUI API: | ||
|
||
Defining Boundary Conditions | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
define/boundary-conditions TUI: Enters the boundary conditions menu. | ||
|
||
.. code:: python | ||
|
||
import ansys.fluent.core as pyfluent | ||
session = pyfluent.launch_fluent(precision='double', processor_count=2) | ||
session.solver.tui.file.read_case(case_file_name='file.cas.h5') | ||
session.solver.tui.define.boundary_conditions.set.velocity_inlet( | ||
"cold-inlet", [], "vmag", "no", 0.4, "quit" | ||
'cold-inlet', | ||
[], | ||
'vmag', | ||
'no', | ||
0.4, | ||
'quit' | ||
) | ||
session.solver.tui.define.boundary_conditions.set.velocity_inlet( | ||
"cold-inlet", [], "ke-spec", "no", "no", "no", "yes", "quit" | ||
'cold-inlet', | ||
[], | ||
'ke-spec', | ||
'no', | ||
'no', | ||
'no', | ||
'yes', | ||
'quit' | ||
) | ||
session.solver.tui.define.boundary_conditions.set.velocity_inlet( | ||
"cold-inlet", [], "turb-intensity", 5, "quit" | ||
'cold-inlet', | ||
[], | ||
'turb-intensity', | ||
5, | ||
'quit' | ||
) | ||
session.solver.tui.define.boundary_conditions.set.velocity_inlet( | ||
"cold-inlet", [], "turb-hydraulic-diam", 4, "quit" | ||
'cold-inlet', | ||
[], | ||
'turb-hydraulic-diam', | ||
4, | ||
'quit' | ||
) | ||
session.solver.tui.define.boundary_conditions.set.velocity_inlet( | ||
"cold-inlet", [], "temperature", "no", 293.15, "quit" | ||
'cold-inlet', | ||
[], | ||
'temperature', | ||
'no', | ||
293.15, | ||
'quit' | ||
) | ||
|
||
Copying Boundary Conditions | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
define/boundary-conditions/copy-bc TUI: Copies boundary conditions to other zones. | ||
|
||
.. code:: python | ||
|
||
session.solver.tui.define.boundary_conditions.copy_bc('cold-inlet','hot-inlet','()') | ||
|
||
Listing Zones | ||
~~~~~~~~~~~~~ | ||
define/boundary-conditions/list-zones TUI: Prints out the types and IDs of all | ||
zones in the console window. | ||
|
||
.. code:: python | ||
|
||
session.solver.tui.define.boundary_conditions.list_zones() | ||
|
||
Modifying Cell Zone Conditions | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
.. code:: python | ||
|
||
#Enabling Laminar Zone | ||
session.solver.tui.define.boundary_conditions.fluid( | ||
'elbow-fluid', | ||
'no', | ||
'no', | ||
'no', | ||
'no', | ||
'no', | ||
0, | ||
'no', | ||
0, | ||
'no', | ||
0, | ||
'no', | ||
0, | ||
'no', | ||
0, | ||
'no', | ||
1, | ||
'no', | ||
'yes', | ||
'yes', | ||
'no', | ||
'no', | ||
'no' | ||
) | ||
|
||
Settings Objects | ||
---------------- | ||
The following example demonstrates how you can define boundary conditions using | ||
:ref:`ref_settings`: | ||
|
||
Defining Boundary Conditions | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
.. code:: python | ||
|
||
session.solver.root.setup.boundary_conditions.velocity_inlet["cold-inlet"].vmag = { | ||
"option": "constant or expression", | ||
"constant": 0.4, | ||
session.solver.root.setup.boundary_conditions.velocity_inlet['cold-inlet'].vmag = { | ||
'option': 'constant or expression', | ||
'constant': 0.4, | ||
} | ||
session.solver.root.setup.boundary_conditions.velocity_inlet[ | ||
"cold-inlet" | ||
].ke_spec = "Intensity and Hydraulic Diameter" | ||
'cold-inlet' | ||
].ke_spec = 'Intensity and Hydraulic Diameter' | ||
session.solver.root.setup.boundary_conditions.velocity_inlet[ | ||
"cold-inlet" | ||
'cold-inlet' | ||
].turb_intensity = 5 | ||
session.solver.root.setup.boundary_conditions.velocity_inlet[ | ||
"cold-inlet" | ||
].turb_hydraulic_diam = "4 [in]" | ||
session.solver.root.setup.boundary_conditions.velocity_inlet["cold-inlet"].t = { | ||
"option": "constant or expression", | ||
"constant": 293.15, | ||
} | ||
'cold-inlet' | ||
].turb_hydraulic_diam = '4 [in]' | ||
session.solver.root.setup.boundary_conditions.velocity_inlet['cold-inlet'].t = { | ||
'option': 'constant or expression', | ||
'constant': 293.15, | ||
} | ||
|
||
Modifying Cell Zone Conditions | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
.. code:: python | ||
|
||
#Enabling Laminar Zone | ||
session.solver.root.setup.cell_zone_conditions.fluid['elbow-fluid'] = {'laminar' : True} |
This file contains hidden or 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,13 +1,50 @@ | ||
Applying General Settings | ||
========================= | ||
PyFluent supports defining general settings using the TUI API and | ||
:ref:`ref_settings`. | ||
|
||
Text User Interface (TUI) API | ||
----------------------------- | ||
The following example demonstrates how you can define units using | ||
the TUI API: | ||
The following examples demonstrate how you can use solver meshing commands | ||
and setup units using the TUI API: | ||
|
||
Checking Mesh | ||
~~~~~~~~~~~~~ | ||
mesh/check TUI: Performs various mesh consistency checks and displays a | ||
report in the console that lists the domain extents, the volume statistics, | ||
the face area statistics, and any warnings, as well as details about the | ||
various checks and mesh failures (depending on the setting specified for | ||
mesh/check-verbosity). | ||
|
||
.. code:: python | ||
|
||
import ansys.fluent.core as pyfluent | ||
session = pyfluent.launch_fluent(precision='double', processor_count=2) | ||
session.solver.tui.file.read_case(case_file_name='file.cas.h5') | ||
session.solver.tui.mesh.check() | ||
|
||
Reporting Mesh Quality | ||
~~~~~~~~~~~~~~~~~~~~~~ | ||
mesh/quality TUI: Displays information about the quality of the mesh in the | ||
console, including the minimum orthogonal quality and the maximum aspect ratio. | ||
The level of detail displayed depends on the setting specified for | ||
mesh/check-verbosity. | ||
|
||
.. code:: python | ||
|
||
session.solver.tui.mesh.quality() | ||
|
||
Scaling Mesh | ||
~~~~~~~~~~~~ | ||
mesh/scale TUI: Prompts for the scaling factors in each of the active Cartesian | ||
coordinate directions. | ||
|
||
.. code:: python | ||
ypatel-qa marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
session.solver.tui.mesh.scale(1,1,1) | ||
|
||
Defining Units | ||
~~~~~~~~~~~~~~ | ||
define/units TUI: Sets unit conversion factors. | ||
|
||
.. code:: python | ||
|
||
session.solver.tui.define.units("length", "in") | ||
session.solver.tui.define.units('length', 'in') |
This file contains hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.