diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ce4205ff3..13c6669fa 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 @@ -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 @@ -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 diff --git a/examples/00-systemcoupling/cht_pipe.py b/examples/00-systemcoupling/cht_pipe.py index a7c8286fb..769b3cdba 100644 --- a/examples/00-systemcoupling/cht_pipe.py +++ b/examples/00-systemcoupling/cht_pipe.py @@ -251,42 +251,49 @@ 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 +k_solid = 237 # Thermal conductivity of solid -def compute_thermo_numbers(rho, mu, cp, k_fluid, k_solid, velocity, L_c, n=0.4): - """Compute Reynolds, Nusselt, h, and Biot numbers.""" +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 reynolds_number(rho, mu, velocity, D_h): - """Reynolds number.""" - return (rho * velocity * D_h) / mu + return Nu, method - def nusselt_number(Re, Pr, n): - """Dittus–Boelter Nusselt number.""" - return 0.023 * (Re**0.8) * (Pr**n) - def biot_number(h, L_c, k_solid): - """Biot number.""" - return h * L_c / k_solid +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 - Pr = (cp * mu) / k_fluid - Re = reynolds_number(rho, mu, velocity, L_c) - Nu = nusselt_number(Re, Pr, n) - 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 + # Convective heat transfer coefficient + h = Nu * k_fluid / d_in + # Biot number + Bi = h * L_c / k_solid + + return Re, Pr, h, Bi, correlation -Re, Nu, h, Bi = 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) +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: diff --git a/pyproject.toml b/pyproject.toml index 8d631542c..a8742a574 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -71,10 +71,12 @@ 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", + # ... temporary to fix fluent runtime error: + "ansys-units==0.9.1", "ansys-mapdl-core==0.71.3", ] style = [