Source code for pygaps.utilities.coolprop_utilities
"""Utilities for interacting with the CoolProp backend."""frompygapsimportloggertry:importCoolPropasCPlogger.debug(f"CoolProp version is '{CP.__version__}'")exceptImportError:CP=None#: The backend which CoolProp uses, normally either HEOS or REFPROP.COOLPROP_BACKEND='HEOS'defthermodynamic_backend():globalCOOLPROP_BACKENDreturnCOOLPROP_BACKEND
[docs]defbackend_use_refprop():"""Switch the equation of state used to REFPROP. User should have REFPROP installed."""globalCOOLPROP_BACKENDCOOLPROP_BACKEND='REFPROP'logger.info("Switched to CoolProp REFPROP backend.")
[docs]defbackend_use_coolprop():"""Switch the equation of state used to HEOS (CoolProp)."""globalCOOLPROP_BACKENDCOOLPROP_BACKEND='HEOS'logger.info("Switched to CoolProp HEOS backend.")