diff --git a/doc/source/user_guide/boundary_conditions.rst b/doc/source/user_guide/boundary_conditions.rst index be7738488bb..bf00c678608 100644 --- a/doc/source/user_guide/boundary_conditions.rst +++ b/doc/source/user_guide/boundary_conditions.rst @@ -10,8 +10,20 @@ and modify cell zone conditions using :ref:`ref_solver_tui_commands`. Defining boundary conditions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The ``define.boundary_counditions.set.velocity_inlet`` TUI command defines velocity -boundary conditions at inlets. +The following example shows a comparison between the TUI command and the +Python code for defining velocity boundary conditions at inlets. + +**TUI command** + +.. code:: scheme + + /define/boundary-counditions/set/velocity-inlet cold-inlet () vmag no 0.4 quit + /define/boundary-counditions/set/velocity-inlet cold-inlet () ke-spec no no no yes quit + /define/boundary-counditions/set/velocity-inlet cold-inlet() cold-inlet () turb-intensity 5 quit + /define/boundary-counditions/set/velocity-inlet cold-inlet () cold-inlet () turb-hydraulic-diam 4 quit + /define/boundary-counditions/set/velocity-inlet cold-inlet () cold-inlet () temperature no 293.15 quit + +**Python code** .. code:: python @@ -20,7 +32,7 @@ boundary conditions at inlets. 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, @@ -28,7 +40,7 @@ boundary conditions at inlets. ) session.solver.tui.define.boundary_conditions.set.velocity_inlet( 'cold-inlet', - [], + (), 'ke-spec', 'no', 'no', @@ -38,21 +50,21 @@ boundary conditions at inlets. ) session.solver.tui.define.boundary_conditions.set.velocity_inlet( 'cold-inlet', - [], + (), 'turb-intensity', 5, 'quit' ) session.solver.tui.define.boundary_conditions.set.velocity_inlet( 'cold-inlet', - [], + (), 'turb-hydraulic-diam', 4, 'quit' ) session.solver.tui.define.boundary_conditions.set.velocity_inlet( 'cold-inlet', - [], + (), 'temperature', 'no', 293.15, @@ -61,8 +73,16 @@ boundary conditions at inlets. Copying boundary conditions ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The ``define.boundary_conditions.copy_bc`` TUI command copies boundary conditions -to other zones. +The following example shows a comparison between the TUI command and the +Python code for copying boundary conditions to other zones. + +**TUI command** + +.. code:: scheme + + /define/boundary-conditions/copy-bc cold-inlet hot-inlet () + +**Python code** .. code:: python @@ -70,8 +90,16 @@ to other zones. Listing zones ~~~~~~~~~~~~~ -The ``define.boundary_conditions.list_zones`` TUI command prints in the Fluent console -the types and IDs of all zones. +The following example shows a comparison between the TUI command and the +Python code for printing to the Fluent console the types and IDs of all zones. + +**TUI command** + +.. code:: scheme + + /define/boundary-conditions/list-zones + +**Python code** .. code:: python @@ -79,7 +107,16 @@ the types and IDs of all zones. Modifying cell zone conditions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The ``define.boundary_conditions.fluid`` TUI command modifies cell zone conditions. +The following example shows a comparison between the TUI command and the +Python code for modifying cell zone conditions. + +**TUI command** + +.. code:: scheme + + /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 + +**Python code** .. code:: python @@ -118,6 +155,8 @@ The following examples show how you define boundary conditions using Defining boundary conditions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +**Python code** + .. code:: python session.solver.root.setup.boundary_conditions.velocity_inlet['cold-inlet'].vmag = { @@ -141,6 +180,8 @@ Defining boundary conditions Modifying cell zone conditions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +**Python code** + .. code:: python #Enabling Laminar Zone diff --git a/doc/source/user_guide/general_settings.rst b/doc/source/user_guide/general_settings.rst index 26a320c5b5d..fb705a02053 100644 --- a/doc/source/user_guide/general_settings.rst +++ b/doc/source/user_guide/general_settings.rst @@ -8,11 +8,21 @@ and set up units using :ref:`ref_solver_tui_commands`. Checking the mesh ----------------- -The ``mesh.check`` TUI performs various mesh consistency checks and displays a +The following example shows a comparison between the TUI command and the +Python code for performing mesh consistency checks and displaying a report in the console that lists domain extents, volume statistics, -face area statistics, any warnings, and information about various check and mesh -failures. THe level of information shown depends on the setting specified for -``mesh.check-verbosity``. +face area statistics, any warnings, and information about failures. +The level of information shown depends on the setting specified for +the verbosity (level 0 to 3). + +**TUI command** + +.. code:: scheme + + /mesh/check + /mesh/check-verbosity 1 + +**Python code** .. code:: python @@ -23,10 +33,17 @@ failures. THe level of information shown depends on the setting specified for Reporting mesh quality ---------------------- -The ``mesh.quality`` TUI displays information about the quality of the mesh in the +The following example shows a comparison between the TUI command and the +Python code for displaying information about the quality of the mesh in the console, including the minimum orthogonal quality and maximum aspect ratio. -The level of information that is shown depends on the setting specified for -``mesh.check-verbosity``. + +**TUI command** + +.. code:: scheme + + /mesh/quality + +**Python code** .. code:: python @@ -34,16 +51,34 @@ The level of information that is shown depends on the setting specified for Scaling mesh ------------ -The ``mesh.scale`` TUI prompts for the scaling factors in each of the active Cartesian +The following example shows a comparison between the TUI command and the +Python code for the scaling the mesh in each of the active Cartesian coordinate directions. +**TUI command** + +.. code:: scheme + + /mesh/scale 1 1 1 + +**Python code** + .. code:: python session.solver.tui.mesh.scale(1,1,1) Defining units -------------- -The ``define.units`` TUI sets unit conversion factors. +The following example shows a comparison between the TUI command and the +Python code for setting the unit conversion factors. + +**TUI command** + +.. code:: scheme + + /define/units length 'in' + +**Python code** .. code:: python diff --git a/doc/source/user_guide/materials.rst b/doc/source/user_guide/materials.rst index db5ee850603..7f6efb45c8b 100644 --- a/doc/source/user_guide/materials.rst +++ b/doc/source/user_guide/materials.rst @@ -5,10 +5,16 @@ PyFluent supports defining materials using :ref:`ref_solver_tui_commands` and Using solver TUI commands ------------------------- -This example shows how you define materials using -:ref:`ref_solver_tui_commands`. +The following example shows a comparison between the TUI command and the +Python code for defining the fluid material being modelled on a cell zone. + +**TUI command** + +.. code:: scheme -The ``define.materials`` TUI enters the materials menu. + /define/materials elbow-fluid yes water-liquid no no no no 0 no 0 no 0 no 0 no 0 no 1 no no no no no + +**Python code** .. code:: python @@ -47,6 +53,8 @@ Using settings objects This example shows how you define materials using :ref:`ref_settings`. +**Python code** + .. code:: python session.solver.root.setup.materials.copy_database_material_by_name(type='fluid', name='water-liquid') diff --git a/doc/source/user_guide/models.rst b/doc/source/user_guide/models.rst index 49488d9ad5c..3c93781cc03 100644 --- a/doc/source/user_guide/models.rst +++ b/doc/source/user_guide/models.rst @@ -8,7 +8,16 @@ The following examples show how you define models using :ref:`ref_solver_tui_com Enabling the energy model ~~~~~~~~~~~~~~~~~~~~~~~~~ -The ``define.models.energy`` TUI enables and disables the energy model. +The following example shows a comparison between the TUI command and the +Python code for enabling and disabling the energy model. + +**TUI command** + +.. code:: scheme + + /define/models/energy yes no no no yes + +**Python code** .. code:: python @@ -19,12 +28,18 @@ The ``define.models.energy`` TUI enables and disables the energy model. Enabling the viscous model ~~~~~~~~~~~~~~~~~~~~~~~~~~ -The ``define.models.viscous.laminar`` TUI enables and disables the laminar flow model. +The following example shows a comparison between the TUI command and the +Python code for enabling and disabling the various viscous models. -The ``define.models.viscous.kw_sst`` TUI enables and disables the SST-kw turbulence model. +**TUI command** -The ``define.models.viscous.ke_standard`` TUI enables and disables the standard-ke -turbulence model. +.. code:: scheme + + /define/models/viscous/laminar yes + /define/models/viscous/kw-sst yes + /define/models/viscous/ke-standard yes + +**Python code** .. code:: python @@ -34,7 +49,17 @@ turbulence model. Enabling the radiation model ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The ``define.models.radiation`` TUI provides options for selecting different radiation models. +The following example shows a comparison between the TUI command and the +Python code for selecting different radiation models. + +**TUI command** + +.. code:: scheme + + /define/models/radiation/s2s yes + /define/models/radiation/p1 yes + +**Python code** .. code:: python @@ -43,7 +68,19 @@ The ``define.models.radiation`` TUI provides options for selecting different rad Enabling the multiphase model ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The ``define.models.multiphase`` TUI provides options for selecting different multiphase models. +The following example shows a comparison between the TUI command and the +Python code for selecting different multiphase models. + +**TUI command** + +.. code:: scheme + + /define/models/multiphase/model vof + /define/models/multiphase/model eulerian + /define/models/multiphase/model mixture + /define/models/multiphase/model wetsteam + +**Python code** .. code:: python @@ -59,6 +96,8 @@ The following examples show how you define models using :ref:`ref_settings`. Enabling the energy model ~~~~~~~~~~~~~~~~~~~~~~~~~ +**Python code** + .. code:: python session.solver.root.setup.models.energy.enabled = True @@ -66,6 +105,8 @@ Enabling the energy model Enabling the viscous model ~~~~~~~~~~~~~~~~~~~~~~~~~~ +**Python code** + .. code:: python session.solver.root.setup.models.viscous.k_epsilon_model.enabled = True diff --git a/doc/source/user_guide/solution.rst b/doc/source/user_guide/solution.rst index 79915904666..f4c7790027d 100644 --- a/doc/source/user_guide/solution.rst +++ b/doc/source/user_guide/solution.rst @@ -11,11 +11,20 @@ using :ref:`ref_solver_tui_commands`. Selecting solution methods ~~~~~~~~~~~~~~~~~~~~~~~~~~ -The ``solve.set.p_v_coupling`` TUI command selects which pressure-velocity coupling scheme to use. -Five schemes (Index-Model) are available: 20-SIMPLE, 21-SIMPLEC, 22-PISO, 24-Coupled, -and 25-Fractional Step. +The following example shows a comparison between the TUI command and the +Python code for selecting the pressure velocity coupling scheme and setting +the gradient options. Five solution methods (Index-Model) are available: +20-SIMPLE, 21-SIMPLEC, 22-PISO, 24-Coupled, and 25-Fractional Step. -The ``solve.set/gradient_scheme`` TUI sets the gradient options. +**TUI command** + +.. code:: scheme + + /solve/set/p-v-coupling 24 + /solve/set/gradient-scheme yes + /solve/set/gradient-scheme no yes + +**Python code** .. code:: python @@ -28,7 +37,16 @@ The ``solve.set/gradient_scheme`` TUI sets the gradient options. Selecting solution controls ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The ``solve.set.p_v_controls`` TUI sets pressure-velocity controls. +The following example shows a comparison between the TUI command and the +Python code for selecting the pressure velocity controls. + +**TUI command** + +.. code:: scheme + + /solve/set/p-v-controls 0.3 0.4 + +**Python code** .. code:: python @@ -36,7 +54,16 @@ The ``solve.set.p_v_controls`` TUI sets pressure-velocity controls. Creating report definitions ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The ``solve.report_definitions`` TUI enters the report definitions menu. +The following example shows a comparison between the TUI command and the +Python code for creating report definitions. + +**TUI command** + +.. code:: scheme + + /solve/report-definitions outlet-temp-avg surface-massavg field temperature surface-names outlet () quit + +**Python code** .. code:: python @@ -53,12 +80,17 @@ The ``solve.report_definitions`` TUI enters the report definitions menu. Initializing and solving ~~~~~~~~~~~~~~~~~~~~~~~~ -The ``solve.initialize`` TUI enters the flow initialization menu. +The following example shows a comparison between the TUI command and the +Python code for initializing and performing a specified number of iterations. -The ``solve.initialize.hyb_initialization`` TUI initializes using the hybrid -initialization method. +**TUI command** -The ``solve.iterate`` TUI performs a specified number of iterations. +.. code:: scheme + + /solve/initialize/hyb-initialization + /solve/iterate 100 + +**Python code** .. code:: python @@ -70,6 +102,8 @@ Using settings objects The following example shows how you apply solution settings using :ref:`ref_settings`. +**Python code** + .. code:: python session.solver.root.solution.initialization.hybrid_initialize() diff --git a/doc/source/user_guide/solver_settings.rst b/doc/source/user_guide/solver_settings.rst index 02c31da8806..faa2695843c 100644 --- a/doc/source/user_guide/solver_settings.rst +++ b/doc/source/user_guide/solver_settings.rst @@ -10,10 +10,17 @@ settings using :ref:`ref_solver_tui_commands`: Selecting steady or transient ----------------------------- -The ``define.models.steady`` TUI enables and disables the steady solution model. +The following example shows a comparison between the TUI commands and the +Python code for enabling and disabling the steady and unsteady solution model. -The ``define.models.unsteady.1st_order TUI`` selects the first-order implicit -formulation for a transient simulation. +**TUI command** + +.. code:: scheme + + /define/models/steady yes + /define/models/unsteady_1st_order yes + +**Python code** .. code:: python @@ -23,16 +30,21 @@ formulation for a transient simulation. session.solver.tui.define.models.steady('yes') session.solver.tui.define.models.unsteady_1st_order('yes') -Selecting pressure-based or density-based solver ------------------------------------------------- -The ``define.models.solver.density_based_explicit`` TUI enables and disables the -density-based explicit solver. +Selecting a pressure-based or density-based solver +-------------------------------------------------- +The following examples show comparisons between the TUI commands and the +Python code for enabling and disabling the pressure-based and density-based solver +models. + +**TUI command** + +.. code:: scheme -The ``define.models.solver.density_based-implicit`` TUI enables and disables the -density-based implicit solver. + /define/models/solver/density-based-explicit yes + /define/models/solver/density-based-implicit yes + /define/models/solver/pressure-based yes -The ``define.models.solver.pressure_based`` TUI enables and disables the -pressure-based solver. +**Python code** .. code:: python @@ -42,7 +54,16 @@ pressure-based solver. Defining gravitational acceleration ----------------------------------- -The ``define.operating_conditions.gravity`` TUI sets the gravitational acceleration. +The following example shows a comparison between the TUI command and the +Python code for settings the gravitational acceleration + +**TUI command** + +.. code:: scheme + + /define/operating-conditions/gravity yes 0 -9.81 0 + +**Python code** .. code:: python