CoolProp模块不接受3个参数

2024-04-28 17:52:34 发布

您现在位置:Python中文网/ 问答频道 /正文

这是我的模块

def enthalpy_Q_P(q,p,f):
    h1=cp.PropsSI('H','Q',q,'P',p,f)
    return h1

但当我用这种方式称呼它的时候

def thermo_problem(p1,p2,t3):
    f= raw_input("Enter the Fluid:")
    import props
    import numpy as np    
    h1=props.enthalpy_Q_P(0,p1,f1)

它显示为错误

thermo_problem(75e3,3e6,623)

Enter the Fluid:water

Traceback (most recent call last):

  File "<ipython-input-84-6060bb46d899>", line 1, in <module>
    thermo_problem(75e3,3e6,623)

  File "<ipython-input-83-c72b065e1660>", line 8, in thermo_problem
    h1=props.enthalpy_Q_P(0,p1,f1) 

TypeError: enthalpy_Q_P() takes exactly 2 arguments (3 given)

Tags: theimportinputthermodefipythonpropsh1