Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
67 changes: 50 additions & 17 deletions examples/00-systemcoupling/cht_pipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,41 +251,74 @@
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,
):
"""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,
):
# 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 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)

# --- Correlation selection ---
if Re < 6000:
Nu = hausen(Re, Pr)
correlation = "Hausen"
else:
Nu = nusselt_dittus_boelter(Re, Pr)
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(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.
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down