传热 -- 化工原理实验Python代码


实验代码针对天津大学、重庆理工大学化工原理实验教材设计,若有其他需求,请自行编辑

无强化丝原始数据

最小压差 (Δp_min) = 0.77 kPa, 最大压差 (Δp_max) = 4.35 kPa

序号Δp (kPa)t_入 (°C)t_出 (°C)
10.7733.664.8
21.3732.765.0
31.9833.964.6
42.5835.764.8
53.1837.865.8
63.7740.565.8

用Mathmatica处理后数据

序号123456
Δp0.771.371.982.583.183.77
t_入33.632.733.935.737.840.5
t_出64.865.064.664.865.865.8
t_平49.248.8549.2550.2551.853.15
ρ1.094411.095641.094231.090731.085331.08067
λ0.02828760.02826030.02829150.02836950.02849030.0285955
μ0.000019580.000019560.000019580.000019630.000019710.00001977
Pr0.6956580.6957330.6956480.6954350.6951080.694824
Pr^0.40.8648850.8649220.864880.8647740.8646110.86447
V_t19.925726.563431.954736.53540.66244.369
V_修20.93927.96633.552238.256142.492846.1585
u_m18.514124.727429.666633.825937.571840.8131
W_c0.006365490.008511290.01019830.01159080.01281080.0138562
Q199.596276.289314.653338.979360.495352.315
α_i53.805575.013384.735389.469792.301487.9157
Nu_i38.041853.087559.901663.074664.794961.4892
Re_i2069627696.433153.437588.241387.744618.8
Nu/Pr^0.443.984861.378369.2672.937674.941171.1293
Δt_164.865.764.562.760.657.9
Δt_233.633.433.833.632.632.6
Δt_m47.504547.742747.508246.646945.162644.0456
K_o50.659869.775579.856387.618696.242596.4439

无强化丝双对数拟合

import numpy as np
import matplotlib.pyplot as plt

# 原始数据(这里没有用mathmatica处理的数据,用的手算的数据,因个人选取参数不同,结果有略微差异)
re = np.array([20700, 38100, 33078.9, 36800, 40525, 45200])
nu_pr = np.array([44.46, 61.9, 70.165, 74.57, 81.65, 102.99])

# 对数转换
log_nu_pr = np.log10(nu_pr)
log_re = np.log10(re)

# 执行线性拟合
fit = np.polyfit(log_re, log_nu_pr, 1)
fit_fn = np.poly1d(fit)

# 设置字体
plt.rcParams['font.family'] = 'SimHei'
plt.rcParams['axes.unicode_minus'] = False

# 绘制双对数图
plt.figure(figsize=(8, 6))
plt.scatter(log_re, log_nu_pr, color='blue', label='Data')
plt.plot(log_re, fit_fn(log_re), color='red', label='Fit')
plt.xlabel(r'$\log_{10}(Re)$')
plt.ylabel(r'$\log_{10}(\frac{Nu}{Pr^{0.4}})$')
plt.title('无强化丝双对数拟合')
plt.text(4.33,1.8, f'无强化丝拟合:y = {fit[0]:.2f}x + {fit[1]:.2f}', fontsize=12, color='red')
plt.legend()
plt.grid(True)
plt.show()

在这里插入图片描述

有强化丝原始数据

最小压差 (Δp_min) = 0.37 kPa, 最大压差 (Δp_max) = 2.35 kPa

序号Δp (kPa)t_入 (°C)t_出 (°C)
10.3833.371.6
20.732.574.8
31.0533.975.4
41.3636.175.4
51.7339.275.9
62.0943.276.5

用Mathmatica处理后数据

序号123456
Δp0.380.71.051.361.732.09
t_入33.332.533.936.139.243.2
t_出71.674.875.475.475.976.5
t_平52.4553.6554.6555.7557.5559.85
ρ1.08311.0791.07551.07181.06571.0581
λ0.028540.028630.028710.02880.028940.02912
μ0.000020.000020.000020.000020.000020.00002
Pr0.694970.694720.694510.694280.693910.69344
Pr^0.40.864540.864420.864310.86420.864010.86378
V_t14.07119.13423.47126.75930.26633.386
V_修14.9520.45825.05728.45932.04435.143
u_m13.21918.08922.15625.16328.33331.074
W_c0.00450.00610.00750.00850.00950.0103
Q173.128260.657312.231334.653349.888345.682
α_i43.77864.43875.77579.61480.63576.604
Nu_i30.67845.00752.78255.29255.7352.619
Re_i14508.16519720.19524019.39227113.55530225.64632731.759
Nu/Pr^0.435.484252.066361.068363.9864.50160.917
Δt_165.165.964.562.359.255.2
Δt_226.823.623.023.022.521.9
Δt_m43.15441.19240.24639.43937.93636.02
K_o48.37276.29693.542102.308111.203115.711

有强化丝双对数拟合

import numpy as np
import matplotlib.pyplot as plt

# 原始数据
re = np.array([14500, 20900, 23200, 27280.4, 29498.78, 32700])
nu_pr = np.array([33.31, 52.3, 61.0683, 65.96, 63, 60.87])

# 对数转换
log_re = np.log10(re)
log_nu_pr = np.log10(nu_pr)

# 执行线性拟合
fit = np.polyfit(log_re, log_nu_pr, 1)
fit_fn = np.poly1d(fit)

# 设置字体
plt.rcParams['font.family'] = 'SimHei'
plt.rcParams['axes.unicode_minus'] = False

# 绘制双对数图
plt.figure(figsize=(8, 6))
plt.scatter(log_re, log_nu_pr, color='blue', label='Data')
plt.plot(log_re, fit_fn(log_re), color='red', label='Fit')
plt.xlabel(r'$\log_{10}(Re)$')
plt.ylabel(r'$\log_{10}(\frac{Nu}{Pr^{0.4}})$')
plt.title('有强化丝双对数拟合')
plt.text(4.3,1.8, f'有强化丝拟合:y = {fit[0]:.2f}x + {fit[1]:.2f}', fontsize=12, color='red')

plt.legend()
plt.grid(True)
plt.show()

在这里插入图片描述

无强化丝vs.有强化丝

import numpy as np
import matplotlib.pyplot as plt

# 原始数据
re_no_enhancement = np.array([20700, 38100, 33078.9, 36800, 40525, 45200])
nu_pr_no_enhancement = np.array([44.46, 61.9, 70.165, 74.57, 81.65, 102.99])

re_enhancement = np.array([14500, 20900, 23200, 27280.4, 29498.78, 32700])
nu_pr_enhancement = np.array([33.31, 52.3, 61.0683, 65.96, 63, 60.87])

# 对数转换
log_re_no_enhancement = np.log10(re_no_enhancement)
log_nu_pr_no_enhancement = np.log10(nu_pr_no_enhancement)

log_re_enhancement = np.log10(re_enhancement)
log_nu_pr_enhancement = np.log10(nu_pr_enhancement)

# 执行线性拟合
fit_no_enhancement = np.polyfit(log_re_no_enhancement, log_nu_pr_no_enhancement, 1)
fit_fn_no_enhancement = np.poly1d(fit_no_enhancement)

fit_enhancement = np.polyfit(log_re_enhancement, log_nu_pr_enhancement, 1)
fit_fn_enhancement = np.poly1d(fit_enhancement)

# 设置字体
plt.rcParams['font.family'] = 'SimHei'
plt.rcParams['axes.unicode_minus'] = False

# 绘制双对数图
plt.figure(figsize=(8, 6))

# 无强化丝数据及拟合直线
plt.scatter(log_re_no_enhancement, log_nu_pr_no_enhancement, color='blue', label='无强化丝数据')
plt.plot(log_re_no_enhancement, fit_fn_no_enhancement(log_re_no_enhancement), color='red', label='无强化丝拟合线')

# 有强化丝数据及拟合直线
plt.scatter(log_re_enhancement, log_nu_pr_enhancement, color='green', label='有强化丝数据')
plt.plot(log_re_enhancement, fit_fn_enhancement(log_re_enhancement), color='orange', label='有强化丝拟合线')

plt.xlabel(r'$\log_{10}(Re)$')
plt.ylabel(r'$\log_{10}(\frac{Nu}{Pr^{0.4}})$')
plt.title('有强化丝vs.无强化丝')

# 添加拟合方程
plt.text(4.25, 1.80, f'无强化丝拟合方程: y = {fit_no_enhancement[0]:.2f}x + {fit_no_enhancement[1]:.2f}', fontsize=10, color='red')
plt.text(4.10, 1.70, f'有强化丝拟合方程: y = {fit_enhancement[0]:.2f}x + {fit_enhancement[1]:.2f}', fontsize=10, color='orange')

plt.legend()
plt.grid(True)
plt.show()

在这里插入图片描述

  • 10
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

向阳a非࿐

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值