Skip to content

Commit

Permalink
docs: Print Fluent version in examples (#3473)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkundu1 authored Nov 12, 2024
1 parent dc8b347 commit 993a601
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 39 deletions.
8 changes: 4 additions & 4 deletions examples/00-fluent/DOE_ML.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())


#############################################################################
Expand Down
4 changes: 2 additions & 2 deletions examples/00-fluent/ahmed_body_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions examples/00-fluent/brake.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions examples/00-fluent/conjugate_heat_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -67,7 +67,7 @@
precision="double",
processor_count=4,
)
meshing.health_check.check_health()
print(meshing.get_fluent_version())

#############################################################################
# Start Watertight Geometry Meshing Workflow
Expand Down
10 changes: 2 additions & 8 deletions examples/00-fluent/exhaust_system_settings_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
# ~~~~~~~~~~~~~~~~~~~~~
Expand Down
3 changes: 2 additions & 1 deletion examples/00-fluent/external_compressible_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions examples/00-fluent/lunar_lander_thermal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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
Expand Down
10 changes: 2 additions & 8 deletions examples/00-fluent/mixing_elbow_settings_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
# ~~~~~~~~~~~~~~~~~~~~~
Expand Down
3 changes: 2 additions & 1 deletion examples/00-fluent/modeling_ablation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -91,6 +91,7 @@
precision="double",
processor_count=4,
)
print(solver.get_fluent_version())

####################################################################################
# Import mesh
Expand Down
5 changes: 2 additions & 3 deletions examples/00-fluent/modeling_cavitation.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,15 @@

###############################################################################
# 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",
processor_count=4,
mode="solver",
version="2d",
)
print(solver.get_fluent_version())

###############################################################################
# Read the mesh that was downloaded.
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion examples/00-fluent/parametric_static_mixer_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion examples/00-fluent/radiation_headlamp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion examples/00-fluent/tyler_sofrin_modes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 993a601

Please sign in to comment.