From 71daafa23202b07301c2405c0db79e57000f44c5 Mon Sep 17 00:00:00 2001 From: krishnatejas12 Date: Mon, 19 Jan 2026 13:31:22 -0500 Subject: [PATCH 01/14] Updated formulation for Biot number calculation --- examples/00-systemcoupling/cht_pipe.py | 62 +++++++++++++++++++------- 1 file changed, 46 insertions(+), 16 deletions(-) diff --git a/examples/00-systemcoupling/cht_pipe.py b/examples/00-systemcoupling/cht_pipe.py index a7c8286fb..452395c5f 100644 --- a/examples/00-systemcoupling/cht_pipe.py +++ b/examples/00-systemcoupling/cht_pipe.py @@ -1,4 +1,4 @@ -# Copyright (C) 2023 - 2026 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -251,42 +251,72 @@ mu_fluid = 0.001 # Dynamic viscosity of fluid cp_fluid = 4182 # Specific heat capacity of fluid k_fluid = 0.6 # Thermal conductivity of fluid -k_solid = 1.2 # Thermal conductivity of solid - - -def compute_thermo_numbers(rho, mu, cp, k_fluid, k_solid, velocity, L_c, n=0.4): +k_solid = 237 # Thermal conductivity of solid + + +def compute_thermo_numbers( + rho, + mu, + cp, + k_fluid, + k_solid, + velocity, + L_c, + n=0.4, + mu_wall=None, +): """Compute Reynolds, Nusselt, h, and Biot numbers.""" def reynolds_number(rho, mu, velocity, D_h): - """Reynolds number.""" return (rho * velocity * D_h) / mu - def nusselt_number(Re, Pr, n): - """Dittus–Boelter Nusselt number.""" - return 0.023 * (Re**0.8) * (Pr**n) + def nusselt_dittus_boelter(Re, Pr, n): + return 0.023 * Re**0.8 * Pr**n + + def hausen(Re, Pr, mu, mu_w): + return 3.66 + (0.068*(Re*Pr*d_in/l))/(1+0.04*(Re*Pr*d_in/l)**0.66) + # Forumlation used from Fundamentals of heat and mass transfer 8th editions. def biot_number(h, L_c, k_solid): - """Biot number.""" return h * L_c / k_solid + # --- Dimensionless numbers --- Pr = (cp * mu) / k_fluid Re = reynolds_number(rho, mu, velocity, L_c) - Nu = nusselt_number(Re, Pr, n) + + # Default wall viscosity assumption + if mu_wall is None: + mu_wall = mu + + # --- Correlation selection --- + if Re > 6000: + Nu = hausen(Re, Pr, mu, mu_wall) + correlation = "Hausen" + else: + Nu = nusselt_dittus_boelter(Re, Pr, n) + correlation = "Dittus–Boelter" + + # --- Heat transfer coefficient --- h = Nu * k_fluid / L_c Bi = biot_number(h, L_c, k_solid) - return Re, Nu, h, Bi + return Re, Nu, h, Bi, correlation - -Re, Nu, h, Bi = compute_thermo_numbers( - fluid_rho, mu_fluid, cp_fluid, k_fluid, k_solid, U, L_c +Re, Nu, h, Bi, corr = compute_thermo_numbers( + fluid_rho, + mu_fluid, + cp_fluid, + k_fluid, + k_solid, + U, + L_c, ) print("Reynolds Number =", Re) print("Nusselt Number =", Nu) print("Heat Transfer Coefficient =", h) print("Biot Number =", Bi) - +print("Correlation Used =", corr) # %% # Apply stabilization if Biot number exceeds 10. if Bi > 10: From 401f4d2953d462ac81dca7f4b2167ce445772a94 Mon Sep 17 00:00:00 2001 From: Ian Boyd <93142264+iboyd-ansys@users.noreply.github.com> Date: Wed, 21 Jan 2026 17:07:34 +0000 Subject: [PATCH 02/14] fix: add explicit units lib dependency (#585) Add explicit units lib dependency --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 8d631542c..aea4cc2a7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -75,6 +75,8 @@ doc = [ # pyansys dependencies for sphinx gallery examples "ansys-fluent-core==0.35.0", + # ... temporary to fix fluent runtime error: + "ansys-units==0.9.1", "ansys-mapdl-core==0.71.3", ] style = [ From 0bbe17c1a981bd3342667ca68d74bd79dfe51936 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 Jan 2026 17:53:40 +0000 Subject: [PATCH 03/14] build(deps): bump actions/download-artifact from 6.0.0 to 7.0.0 (#579) Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 6.0.0 to 7.0.0. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/018cc2cf5baa6db3ef3c5f8a56943fffe632ef53...37930b1c2abaa49bbe596cd826c3c89aef350131) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-version: 7.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ian Boyd <93142264+iboyd-ansys@users.noreply.github.com> --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ce4205ff3..7fb43d01e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -181,7 +181,7 @@ jobs: python-version: ${{ env.MAIN_PYTHON_VERSION }} - name: Download package - uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 + uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 with: name: ${{ env.PACKAGE_NAME }}-artifacts path: dist @@ -264,7 +264,7 @@ jobs: python-version: ${{ env.MAIN_PYTHON_VERSION }} - name: Download package - uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 + uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 with: name: ${{ env.PACKAGE_NAME }}-artifacts path: dist @@ -369,7 +369,7 @@ jobs: steps: - name: "Download the library artifacts from build-library step" - uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 + uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 with: name: ${{ env.PACKAGE_NAME }}-artifacts path: ${{ env.PACKAGE_NAME }}-artifacts From ac4e7abf98fb2030fba691df7b1978ed2ae0011f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 Jan 2026 17:54:04 +0000 Subject: [PATCH 04/14] build(deps): bump actions/upload-artifact from 5.0.0 to 6.0.0 (#580) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5.0.0 to 6.0.0. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/330a01c490aca151604b8cf639adc76d48f6c5d4...b7c566a772e6b6bfb58ed0dc250532a479d7789f) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: 6.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ian Boyd <93142264+iboyd-ansys@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7fb43d01e..13c6669fa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -326,7 +326,7 @@ jobs: # extra_mem_top: 30000000 - name: Upload HTML Documentation - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: name: documentation-html path: doc/_build/html From 0e65d0c7c9f9ff45bb12209558ad6e388dce0c7d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 Jan 2026 17:54:24 +0000 Subject: [PATCH 05/14] build(deps-dev): bump sphinxemoji from 0.3.1 to 0.3.2 (#581) Bumps [sphinxemoji](https://github.com/sphinx-contrib/emojicodes) from 0.3.1 to 0.3.2. - [Commits](https://github.com/sphinx-contrib/emojicodes/compare/v0.3.1...v0.3.2) --- updated-dependencies: - dependency-name: sphinxemoji dependency-version: 0.3.2 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ian Boyd <93142264+iboyd-ansys@users.noreply.github.com> --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index aea4cc2a7..a8742a574 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -71,7 +71,7 @@ doc = [ "sphinx-gallery==0.20.0", "sphinx-notfound-page==1.1.0", "sphinxcontrib-websupport==2.0.0", - "sphinxemoji==0.3.1", + "sphinxemoji==0.3.2", # pyansys dependencies for sphinx gallery examples "ansys-fluent-core==0.35.0", From 1b79b4d91ba241cee3e195568c682c2460357f4c Mon Sep 17 00:00:00 2001 From: Ian Boyd <93142264+iboyd-ansys@users.noreply.github.com> Date: Wed, 21 Jan 2026 17:07:34 +0000 Subject: [PATCH 06/14] fix: add explicit units lib dependency (#585) Add explicit units lib dependency --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 8d631542c..aea4cc2a7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -75,6 +75,8 @@ doc = [ # pyansys dependencies for sphinx gallery examples "ansys-fluent-core==0.35.0", + # ... temporary to fix fluent runtime error: + "ansys-units==0.9.1", "ansys-mapdl-core==0.71.3", ] style = [ From f99cc1d8a7ee65878cafc86cd45d6406b551d8d8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 Jan 2026 17:53:40 +0000 Subject: [PATCH 07/14] build(deps): bump actions/download-artifact from 6.0.0 to 7.0.0 (#579) Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 6.0.0 to 7.0.0. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/018cc2cf5baa6db3ef3c5f8a56943fffe632ef53...37930b1c2abaa49bbe596cd826c3c89aef350131) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-version: 7.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ian Boyd <93142264+iboyd-ansys@users.noreply.github.com> --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ce4205ff3..7fb43d01e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -181,7 +181,7 @@ jobs: python-version: ${{ env.MAIN_PYTHON_VERSION }} - name: Download package - uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 + uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 with: name: ${{ env.PACKAGE_NAME }}-artifacts path: dist @@ -264,7 +264,7 @@ jobs: python-version: ${{ env.MAIN_PYTHON_VERSION }} - name: Download package - uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 + uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 with: name: ${{ env.PACKAGE_NAME }}-artifacts path: dist @@ -369,7 +369,7 @@ jobs: steps: - name: "Download the library artifacts from build-library step" - uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 + uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 with: name: ${{ env.PACKAGE_NAME }}-artifacts path: ${{ env.PACKAGE_NAME }}-artifacts From 2c33c49f074892028979249ee70f883fb0ada513 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 Jan 2026 17:54:04 +0000 Subject: [PATCH 08/14] build(deps): bump actions/upload-artifact from 5.0.0 to 6.0.0 (#580) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5.0.0 to 6.0.0. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/330a01c490aca151604b8cf639adc76d48f6c5d4...b7c566a772e6b6bfb58ed0dc250532a479d7789f) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: 6.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ian Boyd <93142264+iboyd-ansys@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7fb43d01e..13c6669fa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -326,7 +326,7 @@ jobs: # extra_mem_top: 30000000 - name: Upload HTML Documentation - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: name: documentation-html path: doc/_build/html From 6f0f02d4e41b38f5d2b86ecd288cac46d9c52d42 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 Jan 2026 17:54:24 +0000 Subject: [PATCH 09/14] build(deps-dev): bump sphinxemoji from 0.3.1 to 0.3.2 (#581) Bumps [sphinxemoji](https://github.com/sphinx-contrib/emojicodes) from 0.3.1 to 0.3.2. - [Commits](https://github.com/sphinx-contrib/emojicodes/compare/v0.3.1...v0.3.2) --- updated-dependencies: - dependency-name: sphinxemoji dependency-version: 0.3.2 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Ian Boyd <93142264+iboyd-ansys@users.noreply.github.com> --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index aea4cc2a7..a8742a574 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -71,7 +71,7 @@ doc = [ "sphinx-gallery==0.20.0", "sphinx-notfound-page==1.1.0", "sphinxcontrib-websupport==2.0.0", - "sphinxemoji==0.3.1", + "sphinxemoji==0.3.2", # pyansys dependencies for sphinx gallery examples "ansys-fluent-core==0.35.0", From aa97e8b1643fe4db25ac2f9bbcb823bb7772e430 Mon Sep 17 00:00:00 2001 From: krishnatejas12 Date: Wed, 21 Jan 2026 14:57:28 -0500 Subject: [PATCH 10/14] addressed changes to be made after review --- examples/00-systemcoupling/cht_pipe.py | 43 ++++++++++++++------------ 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/examples/00-systemcoupling/cht_pipe.py b/examples/00-systemcoupling/cht_pipe.py index 452395c5f..b97185404 100644 --- a/examples/00-systemcoupling/cht_pipe.py +++ b/examples/00-systemcoupling/cht_pipe.py @@ -1,4 +1,4 @@ -# Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2023 - 2026 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -262,20 +262,25 @@ def compute_thermo_numbers( k_solid, velocity, L_c, - n=0.4, - mu_wall=None, ): """Compute Reynolds, Nusselt, h, and Biot numbers.""" def reynolds_number(rho, mu, velocity, D_h): return (rho * velocity * D_h) / mu - def nusselt_dittus_boelter(Re, Pr, n): - return 0.023 * Re**0.8 * Pr**n + def nusselt_dittus_boelter( + Re, + Pr, + ): + # Formulation from: # Bergman, T. L., Lavine, A. S., + # Incropera, F. P., & DeWitt, D. P. (2017). + # Fundamentals of heat and mass transfer (8th ed.). Wiley. + return 0.023 * Re**0.8 * Pr ** (1 / 3) - def hausen(Re, Pr, mu, mu_w): - return 3.66 + (0.068*(Re*Pr*d_in/l))/(1+0.04*(Re*Pr*d_in/l)**0.66) - # Forumlation used from Fundamentals of heat and mass transfer 8th editions. + def hausen(Re, Pr): + return 3.66 + (0.068 * (Re * Pr * d_in / l)) / ( + 1 + 0.04 * (Re * Pr * d_in / l) ** (2 / 3) + ) def biot_number(h, L_c, k_solid): return h * L_c / k_solid @@ -284,16 +289,12 @@ def biot_number(h, L_c, k_solid): Pr = (cp * mu) / k_fluid Re = reynolds_number(rho, mu, velocity, L_c) - # Default wall viscosity assumption - if mu_wall is None: - mu_wall = mu - # --- Correlation selection --- - if Re > 6000: - Nu = hausen(Re, Pr, mu, mu_wall) + if Re < 6000: + Nu = hausen(Re, Pr) correlation = "Hausen" else: - Nu = nusselt_dittus_boelter(Re, Pr, n) + Nu = nusselt_dittus_boelter(Re, Pr) correlation = "Dittus–Boelter" # --- Heat transfer coefficient --- @@ -302,6 +303,7 @@ def biot_number(h, L_c, k_solid): return Re, Nu, h, Bi, correlation + Re, Nu, h, Bi, corr = compute_thermo_numbers( fluid_rho, mu_fluid, @@ -312,11 +314,12 @@ def biot_number(h, L_c, k_solid): L_c, ) -print("Reynolds Number =", Re) -print("Nusselt Number =", Nu) -print("Heat Transfer Coefficient =", h) -print("Biot Number =", Bi) -print("Correlation Used =", corr) +print(f"Reynolds Number ={Re}") +print(f"Nusselt Number ={Nu}") +print(f"Heat Transfer Coefficient={h}") +print(f"Biot number= {Bi}") +print(f"Nusselt number correlation used= {corr}") + # %% # Apply stabilization if Biot number exceeds 10. if Bi > 10: From 21e6cc24ac2f12f0ad64c67298faf4524fd7cd9a Mon Sep 17 00:00:00 2001 From: krishnatejas12 Date: Mon, 19 Jan 2026 13:31:22 -0500 Subject: [PATCH 11/14] Updated formulation for Biot number calculation --- examples/00-systemcoupling/cht_pipe.py | 62 +++++++++++++++++++------- 1 file changed, 46 insertions(+), 16 deletions(-) diff --git a/examples/00-systemcoupling/cht_pipe.py b/examples/00-systemcoupling/cht_pipe.py index a7c8286fb..452395c5f 100644 --- a/examples/00-systemcoupling/cht_pipe.py +++ b/examples/00-systemcoupling/cht_pipe.py @@ -1,4 +1,4 @@ -# Copyright (C) 2023 - 2026 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -251,42 +251,72 @@ mu_fluid = 0.001 # Dynamic viscosity of fluid cp_fluid = 4182 # Specific heat capacity of fluid k_fluid = 0.6 # Thermal conductivity of fluid -k_solid = 1.2 # Thermal conductivity of solid - - -def compute_thermo_numbers(rho, mu, cp, k_fluid, k_solid, velocity, L_c, n=0.4): +k_solid = 237 # Thermal conductivity of solid + + +def compute_thermo_numbers( + rho, + mu, + cp, + k_fluid, + k_solid, + velocity, + L_c, + n=0.4, + mu_wall=None, +): """Compute Reynolds, Nusselt, h, and Biot numbers.""" def reynolds_number(rho, mu, velocity, D_h): - """Reynolds number.""" return (rho * velocity * D_h) / mu - def nusselt_number(Re, Pr, n): - """Dittus–Boelter Nusselt number.""" - return 0.023 * (Re**0.8) * (Pr**n) + def nusselt_dittus_boelter(Re, Pr, n): + return 0.023 * Re**0.8 * Pr**n + + def hausen(Re, Pr, mu, mu_w): + return 3.66 + (0.068*(Re*Pr*d_in/l))/(1+0.04*(Re*Pr*d_in/l)**0.66) + # Forumlation used from Fundamentals of heat and mass transfer 8th editions. def biot_number(h, L_c, k_solid): - """Biot number.""" return h * L_c / k_solid + # --- Dimensionless numbers --- Pr = (cp * mu) / k_fluid Re = reynolds_number(rho, mu, velocity, L_c) - Nu = nusselt_number(Re, Pr, n) + + # Default wall viscosity assumption + if mu_wall is None: + mu_wall = mu + + # --- Correlation selection --- + if Re > 6000: + Nu = hausen(Re, Pr, mu, mu_wall) + correlation = "Hausen" + else: + Nu = nusselt_dittus_boelter(Re, Pr, n) + correlation = "Dittus–Boelter" + + # --- Heat transfer coefficient --- h = Nu * k_fluid / L_c Bi = biot_number(h, L_c, k_solid) - return Re, Nu, h, Bi + return Re, Nu, h, Bi, correlation - -Re, Nu, h, Bi = compute_thermo_numbers( - fluid_rho, mu_fluid, cp_fluid, k_fluid, k_solid, U, L_c +Re, Nu, h, Bi, corr = compute_thermo_numbers( + fluid_rho, + mu_fluid, + cp_fluid, + k_fluid, + k_solid, + U, + L_c, ) print("Reynolds Number =", Re) print("Nusselt Number =", Nu) print("Heat Transfer Coefficient =", h) print("Biot Number =", Bi) - +print("Correlation Used =", corr) # %% # Apply stabilization if Biot number exceeds 10. if Bi > 10: From 271f62e157bb6ceff6b9dd3941299fbd378fc589 Mon Sep 17 00:00:00 2001 From: krishnatejas12 Date: Wed, 21 Jan 2026 14:57:28 -0500 Subject: [PATCH 12/14] addressed changes to be made after review --- examples/00-systemcoupling/cht_pipe.py | 43 ++++++++++++++------------ 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/examples/00-systemcoupling/cht_pipe.py b/examples/00-systemcoupling/cht_pipe.py index 452395c5f..b97185404 100644 --- a/examples/00-systemcoupling/cht_pipe.py +++ b/examples/00-systemcoupling/cht_pipe.py @@ -1,4 +1,4 @@ -# Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2023 - 2026 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # @@ -262,20 +262,25 @@ def compute_thermo_numbers( k_solid, velocity, L_c, - n=0.4, - mu_wall=None, ): """Compute Reynolds, Nusselt, h, and Biot numbers.""" def reynolds_number(rho, mu, velocity, D_h): return (rho * velocity * D_h) / mu - def nusselt_dittus_boelter(Re, Pr, n): - return 0.023 * Re**0.8 * Pr**n + def nusselt_dittus_boelter( + Re, + Pr, + ): + # Formulation from: # Bergman, T. L., Lavine, A. S., + # Incropera, F. P., & DeWitt, D. P. (2017). + # Fundamentals of heat and mass transfer (8th ed.). Wiley. + return 0.023 * Re**0.8 * Pr ** (1 / 3) - def hausen(Re, Pr, mu, mu_w): - return 3.66 + (0.068*(Re*Pr*d_in/l))/(1+0.04*(Re*Pr*d_in/l)**0.66) - # Forumlation used from Fundamentals of heat and mass transfer 8th editions. + def hausen(Re, Pr): + return 3.66 + (0.068 * (Re * Pr * d_in / l)) / ( + 1 + 0.04 * (Re * Pr * d_in / l) ** (2 / 3) + ) def biot_number(h, L_c, k_solid): return h * L_c / k_solid @@ -284,16 +289,12 @@ def biot_number(h, L_c, k_solid): Pr = (cp * mu) / k_fluid Re = reynolds_number(rho, mu, velocity, L_c) - # Default wall viscosity assumption - if mu_wall is None: - mu_wall = mu - # --- Correlation selection --- - if Re > 6000: - Nu = hausen(Re, Pr, mu, mu_wall) + if Re < 6000: + Nu = hausen(Re, Pr) correlation = "Hausen" else: - Nu = nusselt_dittus_boelter(Re, Pr, n) + Nu = nusselt_dittus_boelter(Re, Pr) correlation = "Dittus–Boelter" # --- Heat transfer coefficient --- @@ -302,6 +303,7 @@ def biot_number(h, L_c, k_solid): return Re, Nu, h, Bi, correlation + Re, Nu, h, Bi, corr = compute_thermo_numbers( fluid_rho, mu_fluid, @@ -312,11 +314,12 @@ def biot_number(h, L_c, k_solid): L_c, ) -print("Reynolds Number =", Re) -print("Nusselt Number =", Nu) -print("Heat Transfer Coefficient =", h) -print("Biot Number =", Bi) -print("Correlation Used =", corr) +print(f"Reynolds Number ={Re}") +print(f"Nusselt Number ={Nu}") +print(f"Heat Transfer Coefficient={h}") +print(f"Biot number= {Bi}") +print(f"Nusselt number correlation used= {corr}") + # %% # Apply stabilization if Biot number exceeds 10. if Bi > 10: From 101d083fb853a944b8e29163f673123d47b5c6da Mon Sep 17 00:00:00 2001 From: krishnatejas12 Date: Wed, 21 Jan 2026 16:34:26 -0500 Subject: [PATCH 13/14] fixed miscellaneous issues --- examples/00-systemcoupling/cht_pipe.py | 85 +++++++++----------------- 1 file changed, 28 insertions(+), 57 deletions(-) diff --git a/examples/00-systemcoupling/cht_pipe.py b/examples/00-systemcoupling/cht_pipe.py index b97185404..06e289a66 100644 --- a/examples/00-systemcoupling/cht_pipe.py +++ b/examples/00-systemcoupling/cht_pipe.py @@ -254,72 +254,43 @@ k_solid = 237 # Thermal conductivity of solid -def compute_thermo_numbers( - rho, - mu, - cp, - k_fluid, - k_solid, - velocity, - L_c, -): - """Compute Reynolds, Nusselt, h, and Biot numbers.""" - - def reynolds_number(rho, mu, velocity, D_h): - return (rho * velocity * D_h) / mu - - def nusselt_dittus_boelter( - Re, - Pr, - ): - # Formulation from: # Bergman, T. L., Lavine, A. S., - # Incropera, F. P., & DeWitt, D. P. (2017). - # Fundamentals of heat and mass transfer (8th ed.). Wiley. - return 0.023 * Re**0.8 * Pr ** (1 / 3) - - def hausen(Re, Pr): - return 3.66 + (0.068 * (Re * Pr * d_in / l)) / ( - 1 + 0.04 * (Re * Pr * d_in / l) ** (2 / 3) +def nusselt_number(Re, Pr, d_in, L): + # From: Bergman, T. L., Lavine, A. S., Incropera, F. P., & DeWitt, D. P. (2017). + # Fundamentals of Heat and Mass transfer (8th ed.). Wiley. + if Re >= 6000: + Nu = 0.023 * Re**0.8 * Pr**(1/3) + method = "Colburn" + else: + Nu = 3.66 + (0.068 * (Re * Pr * d_in / L)) / ( + 1 + 0.04 * (Re * Pr * d_in / L) ** (2 / 3) ) + method = "Hausen" - def biot_number(h, L_c, k_solid): - return h * L_c / k_solid - - # --- Dimensionless numbers --- - Pr = (cp * mu) / k_fluid - Re = reynolds_number(rho, mu, velocity, L_c) + return Nu, method - # --- Correlation selection --- - if Re < 6000: - Nu = hausen(Re, Pr) - correlation = "Hausen" - else: - Nu = nusselt_dittus_boelter(Re, Pr) - correlation = "Dittus–Boelter" +def compute_thermo_numbers(rho, mu, cp, k_fluid, k_solid, velocity, d_in, L, L_c): + Pr = cp * mu / k_fluid + Re = rho * velocity * d_in / mu - # --- Heat transfer coefficient --- - h = Nu * k_fluid / L_c - Bi = biot_number(h, L_c, k_solid) + #Nusselt number + Nu, correlation= nusselt_number(Re, Pr, d_in, L) - return Re, Nu, h, Bi, correlation + #Convective heat transfer coefficient + h= Nu * k_fluid / d_in + #Biot number + Bi= h * L_c / k_solid -Re, Nu, h, Bi, corr = compute_thermo_numbers( - fluid_rho, - mu_fluid, - cp_fluid, - k_fluid, - k_solid, - U, - L_c, -) + return Re, Pr, h, Bi, correlation -print(f"Reynolds Number ={Re}") -print(f"Nusselt Number ={Nu}") -print(f"Heat Transfer Coefficient={h}") -print(f"Biot number= {Bi}") -print(f"Nusselt number correlation used= {corr}") +Re, Nu, h, Bi, corr= compute_thermo_numbers(fluid_rho, mu_fluid, cp_fluid, k_fluid, k_solid, + U, d_in, l, L_c) +print(f"Reynolds number = {Re}") +print(f"Nusselt number = {Nu}") +print(f"Heat transfer coefficient h = {h} W/(m^2·K)") +print(f"Biot number = {Bi}") +print(f"Nusselt correlation used = {corr}") # %% # Apply stabilization if Biot number exceeds 10. if Bi > 10: From 540f7812d9bbeca1c7fb0624ab1789a718ae3b93 Mon Sep 17 00:00:00 2001 From: krishnatejas12 Date: Wed, 21 Jan 2026 16:39:22 -0500 Subject: [PATCH 14/14] fixed formatting issues --- examples/00-systemcoupling/cht_pipe.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/examples/00-systemcoupling/cht_pipe.py b/examples/00-systemcoupling/cht_pipe.py index 06e289a66..769b3cdba 100644 --- a/examples/00-systemcoupling/cht_pipe.py +++ b/examples/00-systemcoupling/cht_pipe.py @@ -258,7 +258,7 @@ def nusselt_number(Re, Pr, d_in, L): # From: Bergman, T. L., Lavine, A. S., Incropera, F. P., & DeWitt, D. P. (2017). # Fundamentals of Heat and Mass transfer (8th ed.). Wiley. if Re >= 6000: - Nu = 0.023 * Re**0.8 * Pr**(1/3) + Nu = 0.023 * Re**0.8 * Pr ** (1 / 3) method = "Colburn" else: Nu = 3.66 + (0.068 * (Re * Pr * d_in / L)) / ( @@ -268,23 +268,26 @@ def nusselt_number(Re, Pr, d_in, L): return Nu, method + def compute_thermo_numbers(rho, mu, cp, k_fluid, k_solid, velocity, d_in, L, L_c): Pr = cp * mu / k_fluid Re = rho * velocity * d_in / mu - #Nusselt number - Nu, correlation= nusselt_number(Re, Pr, d_in, L) + # Nusselt number + Nu, correlation = nusselt_number(Re, Pr, d_in, L) - #Convective heat transfer coefficient - h= Nu * k_fluid / d_in + # Convective heat transfer coefficient + h = Nu * k_fluid / d_in - #Biot number - Bi= h * L_c / k_solid + # Biot number + Bi = h * L_c / k_solid return Re, Pr, h, Bi, correlation -Re, Nu, h, Bi, corr= compute_thermo_numbers(fluid_rho, mu_fluid, cp_fluid, k_fluid, k_solid, - U, d_in, l, L_c) + +Re, Nu, h, Bi, corr = compute_thermo_numbers( + fluid_rho, mu_fluid, cp_fluid, k_fluid, k_solid, U, d_in, l, L_c +) print(f"Reynolds number = {Re}") print(f"Nusselt number = {Nu}")