Add set_reference_state.py script

Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
This commit is contained in:
Ian Bell
2014-11-29 22:18:42 -05:00
parent 8e6b5a7f2b
commit d4f1e45d15

View File

@@ -0,0 +1,18 @@
import CoolProp
CPmod = CoolProp.CoolProp
def get_offset_NBP(name):
#CPmod.set_debug_level(10)
CPmod.set_reference_state(name,"RESET")
HEOS = CoolProp.AbstractState('HEOS', name)
HEOS.update(CoolProp.PQ_INPUTS, 101325, 0)
gas_constant = HEOS.gas_constant()/HEOS.molar_mass()
delta_a1 = HEOS.smass()/(gas_constant)
delta_a2 = -HEOS.hmass()/(gas_constant*HEOS.keyed_output(CoolProp.iT_reducing))
return delta_a1, delta_a2
if __name__=='__main__':
name = 'MM'
print get_offset_NBP(name)