当前位置: 首页>>代码示例>>Python>>正文


Python CoolProp.get_global_param_string方法代码示例

本文整理汇总了Python中CoolProp.CoolProp.get_global_param_string方法的典型用法代码示例。如果您正苦于以下问题:Python CoolProp.get_global_param_string方法的具体用法?Python CoolProp.get_global_param_string怎么用?Python CoolProp.get_global_param_string使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CoolProp.CoolProp的用法示例。


在下文中一共展示了CoolProp.get_global_param_string方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_global_param_string

# 需要导入模块: from CoolProp import CoolProp [as 别名]
# 或者: from CoolProp.CoolProp import get_global_param_string [as 别名]
    def get_global_param_string(self, param_name, split=False):
        """Get global parameter string from CoolProp.

        The split option was added for convenience and can be used to output
        comma separated values as a column vector in Calc. Thus, the function
        can be directly used as input for dropdown fields.
        """
        try:
            param_str = CoolProp.get_global_param_string(param_name)
            if split:
                return zip(param_str.split(','))
            else:
                return [[param_str]]
        except Exception as e:
            return [[str(e)]]
开发者ID:CoolProp,项目名称:CoolProp,代码行数:17,代码来源:coolprop.py

示例2: REFPROP

# 需要导入模块: from CoolProp import CoolProp [as 别名]
# 或者: from CoolProp.CoolProp import get_global_param_string [as 别名]
        RPdata = CP.PropsSI(key, 'T', T, 'Dmolar', rho, RPfluid) - CP.PropsSI(key, 'T', T, 'Dmolar', 1, RPfluid)
        CPdata = CP.PropsSI(key, 'T', T, 'Dmolar', rho, fluid) - CP.PropsSI(key, 'T', T, 'Dmolar', 1, fluid)
        plt.plot(rho/rhoc, np.abs(RPdata/CPdata-1)*100, lw = 0, label = key, marker = symbols[(i+len(normalkeys))%len(symbols)])

    ax.legend(loc='best', ncol = 2)

plt.xlabel(r'Reduced density [$\\rho/\\rho_c$]')
plt.ylabel(r'Relative deviation $(y_{{CP}}/y_{{RP}}-1)\\times 100$ [%]')

ax.set_yscale('log')
plt.title('Comparison between CoolProp and REFPROP({rpv:s}) along T = 1.01*Tc')
plt.savefig(fluid+'.png', dpi = 100)
plt.savefig(fluid+'.pdf')
plt.close('all')

"""

if not os.path.exists(plots_path):
    os.makedirs(plots_path)

with open(os.path.join(plots_path, 'matplotlibrc'), 'w') as fp:
        fp.write("backend : agg\n")

for fluid in CoolProp.__fluids__:
    print('fluid:', fluid)
    file_string = template.format(fluid = fluid, rpv = CP.get_global_param_string("REFPROP_version"))
    file_path = os.path.join(plots_path, fluid + '.py')
    print('Writing to', file_path)
    with open(file_path, 'w') as fp:
        fp.write(file_string)
    subprocess.check_call('python "' + fluid + '.py"', cwd = plots_path, stdout = sys.stdout, stderr = sys.stderr, shell = True)
开发者ID:DTU-TES,项目名称:CoolProp_mixing_rules,代码行数:33,代码来源:fluid_properties.REFPROPcomparison.py

示例3: check_global

# 需要导入模块: from CoolProp import CoolProp [as 别名]
# 或者: from CoolProp.CoolProp import get_global_param_string [as 别名]
def check_global(p):
    CP.get_global_param_string(p)
开发者ID:crteensy,项目名称:CoolProp,代码行数:4,代码来源:test_param_getters.py

示例4: __import__

# 需要导入模块: from CoolProp import CoolProp [as 别名]
# 或者: from CoolProp.CoolProp import get_global_param_string [as 别名]

# Check external optional modules
from tools.dependences import optional_modules  # noqa
for module, use in optional_modules:
    try:
        __import__(module)
        os.environ[module] = "True"
    except ImportError:
        print("%s could not be found, %s" % (module, use))
        os.environ[module] = ""
    else:
        # Check required version
        if module == "CoolProp":
            import CoolProp.CoolProp as CP
            version = CP.get_global_param_string("version")
            mayor, minor, rev = map(int, version.split("."))
            if mayor < 6:
                print("Find CoolProp %s but CoolProp 6 required" % version)
                os.environ[module] = ""


# Logging configuration
if args.debug:
    loglevel = "DEBUG"
else:
    loglevel = args.loglevel
loglevel = getattr(logging, loglevel.upper())

# Checking config folder
if not os.path.isdir(conf_dir):
开发者ID:ChEsolve,项目名称:pychemqt,代码行数:32,代码来源:pychemqt.py


注:本文中的CoolProp.CoolProp.get_global_param_string方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。