回答此问题可获得 20 贡献值,回答如果被采纳可获得 50 分。
<p>今天,我尝试将流体属性计算应用于某个值矩阵。首先,以下是我试图使用的代码:</p>
<pre><code>import CoolProp
from CoolProp.CoolProp import PropsSI
import numpy as np
import matplotlib as mlp
###Values I know
#Limits of the sytem
p_ND = np.array([5, 7, 9, 10, 13, 20, 23, 32, 52])
p_HD = np.arange(0, 1000, 20)
#print(len(p_HD))
V_HD_max = 96
#assumptions for calculation
T_ND = 293.15
V_in = 240
#switching the array of p_ND to an array of possible entropys at inlet
s_ND_Air = np.array([PropsSI('S', 'T', T_ND, 'P', pi, 'Air') for pi in p_ND])
D_ND_Air = np.array([PropsSI('D', 'T', T_ND, 'P', pi, 'Air') for pi in p_ND])
#Array taht cotains possible mass-flows
m_dot = np.array([V_in * Di for Di in D_ND_Air])
#print(m_dot)
#print(s_ND_Air)
#creating matrices containing entropys and p_HD that can be caluclated with another
s_ND_Air_M, p_HD_M = np.meshgrid(s_ND_Air, p_HD)
#print(s_ND_Air_M)
#print(p_HD_M)
#array with every possible density at outlet
#Matrix contains densitys at this point, will be used to get to volume-flows at outlet
V_out = np.zeros(s_ND_Air_M.shape)
for i, p_i in enumerate(p_HD_M):
for i, s_i in enumerate(s_ND_Air_M):
V_out[i] = PropsSI('D', 'P', p_i, 'S', s_i, 'Air')
</code></pre>
<p>现在,我收到了错误消息:</p>
<pre><code>Traceback (most recent call last):
File directory(placeholder)
File "CoolProp\CoolProp.pyx", line 450, in CoolProp.CoolProp.PropsSI
ValueError: No outputs were able to be calculated
</code></pre>
<p>我真的不知道为什么PropsSI不能计算我想知道的值。从热力学角度讲,价值组合本身并不是一个问题。我想要实现的是,矩阵V_out包含p_HD和s_ND的每个可能值组合的密度。我也没有找到正确的标签来暗示coolprop是这个问题的主要主题,对不起。
提前谢谢你的帮助</p>