Python代码热流系统进行建模分析
import math
import time
import numpy as np
import pandas as pd
from CoolProp.CoolProp import PropsSI
def fSWHP(P):
res = PropsSI("H", "P", P * 1e6, "Q", 0, "Water") / 1e3
return res
def fTPH(P, H):
res = PropsSI("T", "P", P * 1e6, "H", H * 1e3, "Water")
return res
def fTSATP(P):
res = PropsSI("T", "P", P * 1e6, "Q", 0, "Water")
return res
def fSFSV(P):
res = PropsSI("D", "P", P * 1e6, "Q", 0, "Water")
return res
def fSGSV(P):
res = PropsSI("D", "P", P * 1e6, "Q", 1, "Water")
return res
def fSIGMAA(TSAT):
res = PropsSI("I", "T", TSAT, "Q", 0, "Water")
return res
def fCPSF(P):
res = PropsSI("C", "P", P * 1e6, "Q", 0, "Water") / 1e3
return res
def fSHPT(P, TIN):
res = PropsSI("C", "T", TIN, "P", P * 1e6, "Water") / 1e3
return res
def fPRF(P):
res = PropsSI("PRANDTL", "P", P * 1e6, "Q", 0, "Water")
return res
def fSSHP(P):
res = PropsSI("H", "P", P * 1e6, "Q", 1, "Water") / 1000
return res
def fHFPT(P, TIN):
res = PropsSI("H", "T", TIN, "P", P * 1e6, "Water") / 1e3
return res
def fVISCL(P, N):
if N != 1:
return
res = PropsSI("V", "P", P * 1e6, "Q", 0, "Water") * 1e6
return res
def fVISSG(P, N):
pass
def fTHCONL(TSAT, N):
if N != 2:
return
res = PropsSI("L", "T", TSAT, "Q", 0, "Water")
return res
def fSVPH(P, H):
pass
def fVISCC(T, D):
pass
def fTHCOND(T, D):
pass
def fGetMULVG(P, TEMP):
res = PropsSI("V", "T", TEMP, "P", P * 1e6, "Water")
return res
def fGetKLNVG(P, TEMP):
res = PropsSI("L", "T", TEMP, "P", P * 1e6, "Water")
return res
# 画图
def plot(simulated, computed):
from matplotlib import pyplot as plt
import numpy as np
# 创建0-10的数据点画实线
x = np.linspace(-10, 10, 400)
y = x
plt.figure(figsize=(8, 6))
plt.axhline(0, color="black", linewidth=0.5)
plt.axvline(0, color="black", linewidth=0.5)
plt.plot(x, y, label="y=x", linestyle="-", color="red", linewidth=0.8)
# 对比散点,和1.0对比超过50%的离谱的值去掉
coeff = 0.5
p = abs(simulated / computed -
原文地址:https://blog.csdn.net/huanghm88/article/details/143822472
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!