From 993a601e720c8027af8d3c74843d9864699bf180 Mon Sep 17 00:00:00 2001 From: Mainak Kundu <94432368+mkundu1@users.noreply.github.com> Date: Tue, 12 Nov 2024 07:32:14 -0500 Subject: [PATCH] docs: Print Fluent version in examples (#3473) --- examples/00-fluent/DOE_ML.py | 8 ++++---- examples/00-fluent/ahmed_body_workflow.py | 4 ++-- examples/00-fluent/brake.py | 6 +++--- examples/00-fluent/conjugate_heat_transfer.py | 8 ++++---- examples/00-fluent/exhaust_system_settings_api.py | 10 ++-------- examples/00-fluent/external_compressible_flow.py | 3 ++- examples/00-fluent/lunar_lander_thermal.py | 5 +++-- examples/00-fluent/mixing_elbow_settings_api.py | 10 ++-------- examples/00-fluent/modeling_ablation.py | 3 ++- examples/00-fluent/modeling_cavitation.py | 5 ++--- examples/00-fluent/parametric_static_mixer_1.py | 3 ++- examples/00-fluent/radiation_headlamp.py | 3 ++- examples/00-fluent/tyler_sofrin_modes.py | 3 ++- 13 files changed, 32 insertions(+), 39 deletions(-) diff --git a/examples/00-fluent/DOE_ML.py b/examples/00-fluent/DOE_ML.py index ce4832176f2..a050093dbd5 100644 --- a/examples/00-fluent/DOE_ML.py +++ b/examples/00-fluent/DOE_ML.py @@ -60,16 +60,16 @@ # Fluent Solution Setup # ===================== -######################################## -# Launch Fluent session with solver mode -# ====================================== +################################################################# +# Launch Fluent session with solver mode and print Fluent version +# =============================================================== solver = pyfluent.launch_fluent( precision="double", processor_count=2, version="3d", ) -solver.health_check.status() +print(solver.get_fluent_version()) ############################################################################# diff --git a/examples/00-fluent/ahmed_body_workflow.py b/examples/00-fluent/ahmed_body_workflow.py index 7e96e4c914c..9885443dbe2 100644 --- a/examples/00-fluent/ahmed_body_workflow.py +++ b/examples/00-fluent/ahmed_body_workflow.py @@ -53,10 +53,10 @@ set_config(blocking=True, set_view_on_display="isometric") ####################################################################################### -# Launch Fluent session with meshing mode +# Launch Fluent session with meshing mode and print Fluent version # ===================================================================================== session = pyfluent.launch_fluent(mode="meshing", cleanup_on_exit=True) -session.health_check.status() +print(session.get_fluent_version()) ####################################################################################### # Meshing Workflow diff --git a/examples/00-fluent/brake.py b/examples/00-fluent/brake.py index 9c2a6bc2fba..7d9dd28295e 100644 --- a/examples/00-fluent/brake.py +++ b/examples/00-fluent/brake.py @@ -47,11 +47,11 @@ # ================================================================================== #################################################################################### -# Launch Fluent session with solver mode -# -------------------------------------- +# Launch Fluent session with solver mode and print Fluent version +# --------------------------------------------------------------- session = pyfluent.launch_fluent(precision="double", processor_count=2, version="3d") -session.health_check.status() +print(session.get_fluent_version()) #################################################################################### # Import mesh diff --git a/examples/00-fluent/conjugate_heat_transfer.py b/examples/00-fluent/conjugate_heat_transfer.py index 2b122b03c9d..1fa3db15ac7 100644 --- a/examples/00-fluent/conjugate_heat_transfer.py +++ b/examples/00-fluent/conjugate_heat_transfer.py @@ -56,9 +56,9 @@ # Fluent Solution Setup # ===================== -######################################### -# Launch Fluent session with meshing mode -# ======================================= +################################################################## +# Launch Fluent session with meshing mode and print Fluent version +# ================================================================ meshing = pyfluent.launch_fluent( product_version="24.2.0", @@ -67,7 +67,7 @@ precision="double", processor_count=4, ) -meshing.health_check.check_health() +print(meshing.get_fluent_version()) ############################################################################# # Start Watertight Geometry Meshing Workflow diff --git a/examples/00-fluent/exhaust_system_settings_api.py b/examples/00-fluent/exhaust_system_settings_api.py index ed015072ea9..bdf3f3462f9 100644 --- a/examples/00-fluent/exhaust_system_settings_api.py +++ b/examples/00-fluent/exhaust_system_settings_api.py @@ -56,13 +56,14 @@ # Launch Fluent # ~~~~~~~~~~~~~ # Launch Fluent as a service in meshing mode with double precision running on -# two processors. +# two processors and print Fluent version. meshing = pyfluent.launch_fluent( precision="double", processor_count=2, mode="meshing", ) +print(meshing.get_fluent_version()) ############################################################################### # Initialize workflow @@ -601,13 +602,6 @@ boundary_conditions.pressure_outlet["outlet-1"].turbulence.turbulent_intensity = 0.05 -############################################################################### -# Turn on residual plots -# ~~~~~~~~~~~~~~~~~~~~~~ -# Activate plotting of the solution residuals. - -solver.solution.monitor.residual.options.plot = True - ############################################################################### # Initialize flow field # ~~~~~~~~~~~~~~~~~~~~~ diff --git a/examples/00-fluent/external_compressible_flow.py b/examples/00-fluent/external_compressible_flow.py index 119524a8575..ef9df60c0df 100644 --- a/examples/00-fluent/external_compressible_flow.py +++ b/examples/00-fluent/external_compressible_flow.py @@ -57,13 +57,14 @@ # Launch Fluent # ~~~~~~~~~~~~~ # Launch Fluent as a service in meshing mode with double precision running on -# four processors. +# four processors and print Fluent version. meshing = pyfluent.launch_fluent( precision="double", processor_count=4, mode="meshing", ) +print(meshing.get_fluent_version()) ############################################################################### # Initialize workflow diff --git a/examples/00-fluent/lunar_lander_thermal.py b/examples/00-fluent/lunar_lander_thermal.py index 6952c8b0b68..b81bda164b4 100644 --- a/examples/00-fluent/lunar_lander_thermal.py +++ b/examples/00-fluent/lunar_lander_thermal.py @@ -235,8 +235,8 @@ def get_surf_mean_temp( # ------------ # We are now ready to launch Fluent and load the mesh. # -# Launch Fluent -# ~~~~~~~~~~~~~ +# Launch Fluent and print Fluent version +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ solver = pyfluent.launch_fluent( precision="double", @@ -245,6 +245,7 @@ def get_surf_mean_temp( cwd=pyfluent.EXAMPLES_PATH, product_version="24.2.0", ) +print(solver.get_fluent_version()) ############################################################################### # Load the mesh diff --git a/examples/00-fluent/mixing_elbow_settings_api.py b/examples/00-fluent/mixing_elbow_settings_api.py index b3fda9dd506..c439bea8fd9 100644 --- a/examples/00-fluent/mixing_elbow_settings_api.py +++ b/examples/00-fluent/mixing_elbow_settings_api.py @@ -37,13 +37,14 @@ # Launch Fluent # ~~~~~~~~~~~~~ # Launch Fluent as a service in solver mode with double precision running on -# two processors. +# two processors and print Fluent version. solver = pyfluent.launch_fluent( precision="double", processor_count=2, mode="solver", ) +print(solver.get_fluent_version()) ############################################################################### # Import mesh and perform mesh check @@ -122,13 +123,6 @@ "outlet" ].turbulence.turbulent_viscosity_ratio = 4 -############################################################################### -# Disable plotting of residuals during calculation -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# Disable plotting of residuals during the calculation. - -solver.solution.monitor.residual.options.plot = False - ############################################################################### # Initialize flow field # ~~~~~~~~~~~~~~~~~~~~~ diff --git a/examples/00-fluent/modeling_ablation.py b/examples/00-fluent/modeling_ablation.py index 00e954a0bb6..acc5bddeab0 100644 --- a/examples/00-fluent/modeling_ablation.py +++ b/examples/00-fluent/modeling_ablation.py @@ -82,7 +82,7 @@ set_config(blocking=True, set_view_on_display="isometric") #################################################################################### -# Launch Fluent session with solver mode +# Launch Fluent session with solver mode and print Fluent version # ================================================================================== solver = pyfluent.launch_fluent( @@ -91,6 +91,7 @@ precision="double", processor_count=4, ) +print(solver.get_fluent_version()) #################################################################################### # Import mesh diff --git a/examples/00-fluent/modeling_cavitation.py b/examples/00-fluent/modeling_cavitation.py index 07c9fce5642..e6e0cd4fe2e 100644 --- a/examples/00-fluent/modeling_cavitation.py +++ b/examples/00-fluent/modeling_cavitation.py @@ -49,7 +49,7 @@ ############################################################################### # Launch a Fluent session in the 2d solution mode with double precision running -# on four processors. +# on four processors and print Fluent version. solver = pyfluent.launch_fluent( precision="double", @@ -57,6 +57,7 @@ mode="solver", version="2d", ) +print(solver.get_fluent_version()) ############################################################################### # Read the mesh that was downloaded. @@ -239,8 +240,6 @@ # 1e-05 for x-velocity, y-velocity, k, omega, and vf-vapor. Enable the specified # initial pressure then initialize the solution with hybrid initialization. -solver.solution.monitor.residual.options.plot = True - resid_eqns = solver.solution.monitor.residual.equations resid_eqns["continuity"].absolute_criteria = 1e-5 diff --git a/examples/00-fluent/parametric_static_mixer_1.py b/examples/00-fluent/parametric_static_mixer_1.py index 6904bacf9f2..85e976f422c 100644 --- a/examples/00-fluent/parametric_static_mixer_1.py +++ b/examples/00-fluent/parametric_static_mixer_1.py @@ -21,11 +21,12 @@ ############################################################################ # Launch Fluent # ~~~~~~~~~~~~~ -# Launch Fluent in 3D and double precision. +# Launch Fluent in 3D and double precision and print Fluent version. solver_session = pyfluent.launch_fluent( precision="double", processor_count=2, mode="solver" ) +print(solver_session.get_fluent_version()) ############################################################################ # Download and read files diff --git a/examples/00-fluent/radiation_headlamp.py b/examples/00-fluent/radiation_headlamp.py index cf0dd545401..c84ed078e5c 100644 --- a/examples/00-fluent/radiation_headlamp.py +++ b/examples/00-fluent/radiation_headlamp.py @@ -57,13 +57,14 @@ # Launch Fluent # ~~~~~~~~~~~~~ # Launch Fluent as a service in meshing mode with single precision running on -# four processors. +# four processors and print Fluent version. meshing = pyfluent.launch_fluent( precision="single", processor_count=4, mode="meshing", ) +print(meshing.get_fluent_version()) ############################################################################### # Initialize workflow diff --git a/examples/00-fluent/tyler_sofrin_modes.py b/examples/00-fluent/tyler_sofrin_modes.py index 617c99f69dd..ad595daa4d3 100644 --- a/examples/00-fluent/tyler_sofrin_modes.py +++ b/examples/00-fluent/tyler_sofrin_modes.py @@ -120,11 +120,12 @@ ) ####################################################################################### -# Launch Fluent session +# Launch Fluent session and print Fluent version # ===================================================================================== session = pyfluent.launch_fluent( ui_mode="gui", processor_count=4, product_version="24.2.0" ) +print(session.get_fluent_version()) ####################################################################################### # Reading case and data file