Skip to content

Help defining new mixture using python wrappers #685

Answered by ianhbell
mina19 asked this question in Q&A
Discussion options

You must be logged in to vote

Some info here: https://refprop-docs.readthedocs.io/en/latest/DLL/high_level.html#f/_/REFPROPdll . There are also copious examples within the issues in this repository you should check out.

A snippet for your mixture to calculate the normal boiling point temperature of the saturated liquid state:

import os
os.environ['RPPREFIX'] = os.getenv('HOME')+'/REFPROP10'

root = os.getenv('RPPREFIX')
import ctREFPROP.ctREFPROP as ct
RP = ct.REFPROPFunctionLibrary(root)
RP.SETPATHdll(root)

p = 101325
z = [0.98, 0.015, 0.005]
q = 0
r = RP.REFPROPdll('ETHANE;METHANE;PROPANE','PQ','T',RP.MOLAR_BASE_SI,0,0,p,q, z)
print('TNBP:', r.Output[0], r.hUnits)

yielding

TNBP: 174.91159925978994 K

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@mina19
Comment options

Answer selected by mina19
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants