Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 0.4.1 instead.
Reason given by maintainers: Old Version - Bugs

REFPROP connector

REFPROP connector is a tools developed by the SERG research group of the University of Florence for launching REFPROP calculation and retrieving results from python.

In order to use the code you must have both REFPROP and the REFPROP wrappers for Python installed and properly working.

The scope of this library is to make the usage of the refprop wrappers simpler.

The beta version can be downloaded using PIP:

pip install REFPROP_connector

Once the installation has been completed the user can import the tool and initialize the connector itself.

from REFPROPConnector import ThermodynamicPoint

tp = ThermodynamicPoint(["air"], [1.])

An important aspects to keep in mind for the initialization:

  • A file-dialog could appear the first time that the connector is imported asking the user to select the REFPROP installation folder (usually it's "C:\Program Files (x86)\REFPROP"). Once the executable path has been selected, the program will keep it in memory in order to avoid a new appearance of the file-dialog. The stored executable can be modified calling the following function:
from REFPROPConnector import retreive_RP_exec

retreive_RP_exec()

Each ThermodynamicPoint class instance represent a thermodynamic state, hence you had to provide at least two indipendent state variables in order to calculate the others.

from REFPROPConnector import ThermodynamicPoint

tp = ThermodynamicPoint(["water"], [1.])

tp.set_variable("P", 0.101325)     # P in MPa (ambient pressure)
tp.set_variable("Q", 0.5)          # vapour quality for multiphase condition

T_sat = tp.get_variable("T")       # saturation temperature in celsius (100 °C)

AbstractThermodynamicPoint is a class that can be overwritten in order to perform some calculation once both independent state variable have been set. It can be useful for example for the evaluation of the reynolds number for a fluid flowing in a pipe.

from REFPROPConnector import AbstractThermodynamicPoint, RefPropHandler
import numpy as np


class TubeSection(AbstractThermodynamicPoint):

    def __init__(self, diam, flow_rate):
        
        self.diam = diam
        self.area = np.pi * np.power(diam / 2, 2)
        self.flow_rate = flow_rate
        self.Re = 0.
        
        refprop = RefPropHandler(["air"], [1])

        super().__init__(refprop)

    def other_calculation(self):
        
        mu = self.get_variable("mu") / (10 ** 6)  # conversion uPa*s -> Pa*s
        self.Re = self.flow_rate * self.diam / (self.area * mu)

if __name__ == "__main__":

    section = TubeSection(0.5, 1)
    
    """
    
        The following line will return 0. as the function "other_calculation" 
        is called only when 2 independent state variable is provided 
        
    """
    print(section.get_variable("Re"))   
    
    section.set_variable("P", 0.5)
    section.set_variable("T", 20)
    
    """
    
        The following line will return the actual Reynolds number
        
    """
    print(section.get_variable("Re"))

Variable that can be calculated can be listed using list_properties method from both ThermodynamicPoint and AbstractThermodynamicPoint (the name is not case-sensitive). Finally, user can also select the unit system to be used in the calculation, a list of possible unit system can be revived calling the method list_unit_systems() (current unit_system will be highlighted):

from REFPROPConnector import ThermodynamicPoint

tp = ThermodynamicPoint(["water"], [1.], unit_system="MASS BASE SI")
tp.list_properties()
tp.list_unit_systems()

Defaul unit system is SI with C

For other information please contact: pietro.ungar@unifi.it

-------------------------- !!! THIS IS A BETA VERSION !!! --------------------------

please report any bug or problems in the installation to pietro.ungar@unifi.it
for further information visit: https://tinyurl.com/SERG-3ETool

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

REFPROP_connector-0.1.3.tar.gz (5.3 MB view details)

Uploaded Source

File details

Details for the file REFPROP_connector-0.1.3.tar.gz.

File metadata

  • Download URL: REFPROP_connector-0.1.3.tar.gz
  • Upload date:
  • Size: 5.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for REFPROP_connector-0.1.3.tar.gz
Algorithm Hash digest
SHA256 849a07864ea1b1923c452c47b0c2c6744781835120857ba8804e4aebec661edb
MD5 4cd8806e3338bf6d2948e6080552d990
BLAKE2b-256 a5416cd2cab43b1e79fb7690bf2857bc8b13667fecf2f377dd965c3f01137e40

See more details on using hashes here.

Release history Release notifications | RSS feed

0.4.1

1 file

0.3.14

1 file

0.3.13

1 file

0.3.12

1 file

0.3.11

1 file

0.3.10

1 file

0.3.9

1 file

0.3.8

1 file

0.3.7

1 file

0.3.6

1 file

0.3.4

1 file

0.3.3

1 file

0.3.2

1 file

0.3.1

1 file

0.3.0

1 file

0.2.1

1 file

0.2.0

1 file

0.1.5

1 file

0.1.4

1 file

This release

0.1.3 This release

1 file

0.1.2

1 file

0.1.1

1 file

0.1.0

1 file

0.0.9

1 file

0.0.8

1 file

0.0.7

1 file

0.0.6

1 file

0.0.5

1 file

0.0.4

1 file

0.0.3

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page