Exemplo n.º 1
0
def _maintest(rp):
    #examples and test setup
    rp.SetErrorDebug.off() #turn on =>> for testing purpose

    if rp.test(): #if True; rptest =>>for testing purpose
        print('refprop installed correctely')

        print('test results')
        print(rp.testresult)

        print('fluidlib')
        rp.fluidlib()
        print('\n')

        prop = rp.setup('def', 'air',)
        print('setup air')
        print(prop, '\n')

        x = prop['x']

        print('critp(x)')
        print(rp.critp(x), '\n')

        print('setup water ammonia')
        print(rp.setup('def', 'water', 'ammonia',), '\n')

        #alternative setup input
        rp.setup('def', ['water', 'ammonia'],)

        x = [0.5, 0.3]
        prop = rp.normalize(x)
        x = prop['x']

        prop = rp.critp(x)
        prop = rp.therm(prop['tcrit'], prop['Dcrit'], x)
        print('therm')
        print(prop, '\n')

        p = prop['p']

        print('therm2')
        print(rp.therm2(prop['t'], prop['D'], x), '\n')

        print('therm0')
        print(rp.therm0(prop['t'], prop['D'], x), '\n')

        print('residual')
        print(rp.residual(prop['t'], prop['D'], x), '\n')

        print('entro')
        print(rp.entro(prop['t'], prop['D'], x), '\n')

        print('enthal')
        print(rp.enthal(prop['t'], prop['D'], x), '\n')

        print('ag')
        print(rp.ag(prop['t'], prop['D'], x), '\n')

        print('cvcp')
        print(rp.cvcp(prop['t'], prop['D'], x), '\n')

        print('dddp')
        print(rp.dddp(prop['t'], prop['D'], x), '\n')

        print('dddt')
        print(rp.dddt(prop['t'], prop['D'], x), '\n')

        print('dhd1')
        print(rp.dhd1(prop['t'], prop['D'], x), '\n')

        print('dpdd')
        print(rp.dpdd(prop['t'], prop['D'], x), '\n')

        print('dpdd2')
        print(rp.dpdd2(prop['t'], prop['D'], x), '\n')

        print('dpdt')
        print(rp.dpdt(prop['t'], prop['D'], x), '\n')

        D = prop['D']

        #function not supported in Windows
        if platform.system() == 'Linux':
            print('dcdt')
            print(rp.dcdt(prop['t'], x), '\n')

        #function not supported in Windows
        if platform.system() == 'Linux':
            print('dcdt2')
            print(rp.dcdt2(prop['t'], x), '\n')

        print('fgcty')
        print(rp.fgcty(prop['t'], D, x), '\n')

        print('gibbs')
        print(rp.gibbs(prop['t'], prop['D'], x), '\n')

        #~ print('fgcty2')
        #~ print(rp.fgcty2(prop['t'], prop['D'], x), '\n')

        prop = rp.therm3(prop['t'], prop['D'], x)
        print('therm3')
        print(prop, '\n')

        D = prop['D']

        print('virb')
        print(rp.virb(prop['t'], x), '\n')

        print('virc')
        print(rp.virc(prop['t'], x), '\n')

        #function not supported in Windows
        if platform.system() == 'Linux':
            print('vird')
            print(rp.vird(prop['t'], x), '\n')

        print('virba')
        print(rp.virba(prop['t'], x), '\n')

        print('virca')
        print(rp.virca(prop['t'], x), '\n')

        print('cvcpk')
        print(rp.cvcpk(1, prop['t'], D), '\n')

        print('dbdt')
        print(rp.dbdt(prop['t'], x), '\n')

        print('dpddk')
        print(rp.dpddk(1, prop['t'], D), '\n')

        print('dpdtk')
        print(rp.dpdtk(2, prop['t'], D), '\n')

        D = 55
        t = 373

        prop = rp.press(t, D, x)
        print('press')
        print(prop, '\n')

        p = prop['p']

        print('purefld(1)')
        prop = rp.purefld(1)
        print(prop, '\n')

        x = [1]

        resetup_test_prop_d = prop

        print('satt')
        prop = rp.satt(t, x)
        print(prop, '\n')

        print('satp')
        prop = rp.satp(prop['p'], x)
        print(prop, '\n')

        print('satd')
        print(rp.satd(prop['Dliq'], x), '\n')

        print('sath')
        print(rp.sath(47000, x, 0), '\n')

        print('sate')
        print(rp.sate(0.96047E-13, x), '\n')

        print('sats')
        print(rp.sats(50, x, 0), '\n')

        print('purefld(0)')
        print(rp.purefld(0), '\n')

        x = [0.5, 0.3]
        x = rp.normalize(x)['x']

        print('csatk')
        print(rp.csatk(1, t), '\n')

        print('dptsatk')
        print(rp.dptsatk(1, t), '\n')

        print('cv2pk')
        print(rp.cv2pk(2, t, D), '\n')

        print('tprho')
        print(rp.tprho(t, p, x, 2, 1, 58), '\n')

        print('flsh, tp')
        prop = rp.flsh('tp', t, p, x)
        print(prop, '\n')

        print('flsh, th')
        print(rp.flsh('tH', 305, prop['h'], x, 1), '\n')

        print('flsh, tD')
        print(rp.flsh('tD', t, 30, x), '\n')

        print('info()')
        print(rp.info(), '\n')

        print('info(2)')
        print(rp.info(2), '\n')

        #unsupported in Windows
        if platform.system() == 'Linux':
            print('rmix2')
            print(rp.rmix2(x), '\n')

        print('xmass')
        prop = rp.xmass(x)
        print(prop, '\n')

        print('xmole')
        print(rp.xmole(prop['xkg']), '\n')

        print('limitx')
        print(rp.limitx(x, 'eos', t, D, p), '\n')

        print('limitk')
        print(rp.limitk('eos', 1, t, D, p), '\n')

        print('limits')
        print(rp.limits(x), '\n')

        print('flsh, ts')
        prop = rp.flsh('ts', t, 40, x)
        print(prop, '\n')

        print('flsh, te')
        print(rp.flsh('te', t, prop['e'], x), '\n')

        print('flsh, pD')
        prop = rp.flsh('Pd', p, D, x)
        print(prop, '\n')

        print('flsh, ph')
        prop = rp.flsh('ph', p, prop['h'], x)
        print(prop, '\n')

        print('flsh, ps')
        prop = rp.flsh('ps', p, prop['s'], x)
        print(prop, '\n')

        print('flsh, pe')
        prop = rp.flsh('pE', p, prop['e'], x)
        print(prop, '\n')

        print('flsh, es')
        prop = rp.flsh('es', prop['e'], prop['s'], x)
        print(prop, '\n')

        print('flsh, hs')
        prop = rp.flsh('hs', 40000, 100, x)
        print(prop, '\n')

        print('flsh, es')
        print(rp.flsh('es', 175, 13, x), '\n')

        print('flsh, Dh')
        print(rp.flsh('DH', 20, 18000, x), '\n')

        print('flsh, Ds')
        prop = rp.flsh('Ds', 20, 50, x)
        print(prop, '\n')

        print('flsh, De')
        prop = rp.flsh('DE', 20, prop['e'], x)
        print(prop, '\n')

        print('flsh, tq')
        prop = rp.flsh('tq', t, prop['q'], x)
        print(prop, '\n')

        print('flsh, pq')
        print(rp.flsh('pq', 1200, prop['q'], x), '\n')

        prop = rp.flsh('tp', 350, 1200, x)
        print('flsh, tp')
        print(prop, '\n')
        s = prop['s']
        e = prop['e']
        h = prop['h']
        D = prop['D']
        t = prop['t']
        p = prop['p']
        Dmin = 40
        Dmax = 55

        print('flsh1, liq, ph')
        print(rp.flsh1('Ph', p, h, x, 1), '\n')

        print('getphase')
        print(rp.getphase(prop), '\n')

        print('flsh1, liq, pD')
        print(rp.flsh1('PD', p, D, x), '\n')

        print('flsh1, liq, ps')
        print(rp.flsh1('Ps', p, s, x), '\n')

        #unsupported in Windows
        if platform.system() == 'Linux':
            print('flsh1, liq, th')
            print(rp.flsh1('th', t, h, x, Dmin=Dmin, Dmax=Dmax), '\n')

        #unsupported in Windows
        if platform.system() == 'Linux':
            print('flsh1, liq, ts')
            print(rp.flsh1('ts', t, s, x, Dmin=Dmin, Dmax=Dmax), '\n')

        #unsupported in Windows
        if platform.system() == 'Linux':
            print('flsh1, liq, te')
            print(rp.flsh1('te', t, e, x, Dmin=Dmin, Dmax=Dmax), '\n')

        #unsupported in Windows
        if platform.system() == 'Linux':
            print('flsh1, liq, pe')
            print(rp.flsh1('Pe', p, e, x), '\n')

        #unsupported in Windows
        if platform.system() == 'Linux':
            print('flsh1, liq, hs')
            print(rp.flsh1('hs', h, s, x, Dmin=Dmin, Dmax=Dmax), '\n')

        #unsupported in Windows
        if platform.system() == 'Linux':
            print('flsh1, liq, Dh')
            print(rp.flsh1('Dh', D, h, x), '\n')

        #unsupported in Windows
        if platform.system() == 'Linux':
            print('flsh1, liq, Ds')
            print(rp.flsh1('Ds', D, s, x), '\n')

        #unsupported in Windows
        if platform.system() == 'Linux':
            print('flsh1, liq, De')
            print(rp.flsh1('De', D, e, x), '\n')

        prop = rp.flsh('tp', 400, 100, x)
        s = prop['s']
        e = prop['e']
        h = prop['h']
        D = prop['D']
        Dmin = 0.01
        Dmax = 0.05
        t = prop['t']
        p = prop['p']

        print('flsh1, vap, ph')
        print(rp.flsh1('Ph', p, h, x, 2), '\n')

        print('getphase')
        print(rp.getphase(prop), '\n')

        print('flsh1, vap, pD')
        print(rp.flsh1('PD', p, D, x, 2), '\n')

        print('flsh1, vap, ps')
        print(rp.flsh1('Ps', p, s, x, 2), '\n')

        #unsupported in Windows
        if platform.system() == 'Linux':
            print('flsh1, vap, th')
            print(rp.flsh1('th', t, h, x, Dmin=Dmin, Dmax=Dmax), '\n')

        #unsupported in Windows
        if platform.system() == 'Linux':
            print('flsh1, vap, ts')
            print(rp.flsh1('ts', t, s, x, Dmin=Dmin, Dmax=Dmax), '\n')

        #unsupported in Windows
        if platform.system() == 'Linux':
            print('flsh1, vap, te')
            print(rp.flsh1('te', t, e, x, Dmin=Dmin, Dmax=Dmax), '\n')

        #unsupported in Windows
        if platform.system() == 'Linux':
            print('flsh1, vap, pe')
            print(rp.flsh1('Pe', p, e, x, 2), '\n')

        #unsupported in Windows
        if platform.system() == 'Linux':
            print('flsh1, vap, hs')
            print(rp.flsh1('hs', h, s, x, Dmin=Dmin, Dmax=Dmax), '\n')

        #unsupported in Windows
        if platform.system() == 'Linux':
            print('flsh1, vap, Dh')
            print(rp.flsh1('Dh', D, h, x), '\n')

        #unsupported in Windows
        if platform.system() == 'Linux':
            print('flsh1, vap, Ds')
            print(rp.flsh1('Ds', D, s, x), '\n')

        #unsupported in Windows
        if platform.system() == 'Linux':
            print('flsh1, vap, De')
            print(rp.flsh1('De', D, e, x), '\n')

        print('cstar')
        print(rp.cstar(t, p, 8, x), '\n')

        print('fpv')
        print(rp.fpv(t, D, p, x), '\n')

        #function not supported in Windows
        if platform.system() == 'Linux':
            print('excess')
            print(rp.excess(t, p, x, kph=2), '\n')

        prop = rp.flsh('pq', 1200, 0.65, x)
        D = prop['D']
        Dliq = prop['Dliq']
        Dvap = prop['Dvap']
        xliq = prop['xliq']
        xvap = prop['xvap']
        e = prop['e']
        h = prop['h']
        s = prop['s']
        q = prop['q']
        p = prop['p']
        t = prop['t']

        #function not supported in Windows
        if platform.system() == 'Linux':
            print('tpfl2')
            print(rp.flsh2('tp', t, p, x), '\n')

        #function not supported in Windows
        if platform.system() == 'Linux':
            print('Dhfl2')
            print(rp.flsh2('Dh', D, h, x), '\n')

        #function not supported in Windows
        if platform.system() == 'Linux':
            print('Dsfl2')
            print(rp.flsh2('Ds', D, s, x), '\n')

        #function not supported in Windows
        if platform.system() == 'Linux':
            print('Defl2')
            print(rp.flsh2('De', D, e, x), '\n')

        #function not supported in Windows
        if platform.system() == 'Linux':
            print('thfl2')
            print(rp.flsh2('th', t, h, x, ksat=0), '\n')

        #function not supported in Windows
        if platform.system() == 'Linux':
            print('tsfl2')
            print(rp.flsh2('ts', t, s, x, ksat=0), '\n')

        #function not supported in Windows
        if platform.system() == 'Linux':
            print('tefl2')
            print(rp.flsh2('te', t, e, x, ksat=0), '\n')

        #function not supported in Windows
        if platform.system() == 'Linux':
            print('tDfl2')
            print(rp.flsh2('tD', t, D, x, ksat=0), '\n')

        #function not supported in Windows
        if platform.system() == 'Linux':
            print('pDfl2')
            print(rp.flsh2('pD', p, D, x, ksat=0), '\n')

        #function not supported in Windows
        if platform.system() == 'Linux':
            print('phfl2')
            print(rp.flsh2('ph', p, h, x, ksat=0), '\n')

        #function not supported in Windows
        if platform.system() == 'Linux':
            print('psfl2')
            print(rp.flsh2('ps', p, s, x, ksat=0), '\n')

        #function not supported in Windows
        if platform.system() == 'Linux':
            print('pefl2')
            print(rp.flsh2('pe', p, e, x, ksat=0), '\n')

        #function not supported in Windows
        if platform.system() == 'Linux':
            print('tqfl2')
            print(rp.flsh2('tq', t, q, x, ksat=0), '\n')

        #function not supported in Windows
        if platform.system() == 'Linux':
            print('pqfl2')
            print(rp.flsh2('pq', p, q, x, ksat=0), '\n')

        #function not supported in Windows
        #~ if platform.system() == 'Linux':
            #~ print('Dqfl2')
            #~ print(rp.flsh2('Dq', D, q, x), '\n')

        prop = rp.flsh('tp', 340, 100, x)
        t = prop['t']
        Dliq = prop['Dliq']
        Dvap = prop['Dvap']
        xliq = prop['xliq']
        xvap = prop['xvap']

        print('qmass')
        prop = rp.qmass(prop['q'], xliq, xvap)
        print(prop, '\n')

        print('qmole')
        print(rp.qmole(prop['qkg'], prop['xlkg'], prop['xvkg']), '\n')

        print('wmol')
        print(rp.wmol(x), '\n')

        prop = rp.flsh('tp', 340, 100, x)

        print('dielec')
        print(rp.dielec(prop['t'], prop['D'], x), '\n')

        print('surten')
        print(rp.surten (t, Dliq, Dvap, xliq, xvap), '\n')

        print('surft')
        print(rp.surft(240, x), '\n')

        rp.setup('def', 'water')

        print('meltt')
        print(rp.meltt(273.15, [1]), '\n')

        print('meltp')
        print(rp.meltp(100, [1]), '\n')

        print('sublt')
        print(rp.sublt(273.15, [1]), '\n')

        print('sublp')
        print(rp.sublp(0.1, [1]), '\n')

        rp.setup('def', 'butane', 'ethane', 'propane', 'methane',)
        x = [0.5, 0.15, 0.3, 0.05]
        rp.setref('nbp')
        prop = rp.flsh('tp', 260, 150, x)
        D = prop['D']
        print('trnprp, setref NBP')
        print(rp.trnprp(260, D, x), '\n')

        print('B12')
        print(rp.b12(260, x), '\n')

        print('chempot')
        print(rp.chempot(260, D, x), '\n')

        print('fugcof')
        print(rp.fugcof(260, D, x), '\n')

        ##function not supported in Windows
        #if platform.system() == 'Linux':
            #print('phiderv')
            #print(rp.phiderv(2, 1, 260, D, x), '\n')

        #function not supported in Windows
        if platform.system() == 'Linux':
            print('getmod')
            print(rp.getmod(1, 'EOS'), '\n')

        rp.setmod('tcx', 'ecs', ['tc2', 'tc1', 'tc2', 'tc2'])
        rp.setup('def', 'butane', 'ethane', 'propane', 'methane',)
        x = [0.5, 0.15, 0.3, 0.05]
        rp.setref('nbp')
        prop = rp.flsh('tp', 260, 200, x)
        print('trnprp, setref NBP, setmod [tcx, ecs, tc2, tc1, tc2, tc2]')
        print(rp.trnprp(260, prop['D'], x), '\n')

        #function not supported in Windows
        if platform.system() == 'Linux':
            print('getmod')
            print(rp.getmod(3, 'tcx'), '\n')

        rp.setref('oth', 1, [1], 0, 0, 273, 100)
        print('setref = OTH')
        prop = rp.flsh('tp', 260, 200, x)
        print(prop, '\n')

        resetup_test_prop_a = prop

        rp.setref('???', 1, [1], 0, 0, 373, 100)
        print('setref = ???')
        prop = rp.flsh('tp', 260, 200, x)
        print(prop, '\n')

        resetup_test_prop_b = prop

        print('name')
        print(rp.name(1), '\n')

        rp.setup('def', 'butane', 'ethane', 'propane', 'methane',)
        x = [0.5, 0.15, 0.3, 0.05]
        print('getktv')
        prop = rp.getktv(1, 3)
        print(prop, '\n')

        print('setktv')
        prop = rp.setktv(1, 3, 'lin', prop['fij'], prop['hfmix'],)
        print(prop, '\n')

        resetup_test_prop_c = prop

        print('reset setktv')
        print(rp.setktv(1, 2, 'rst'), '\n')

        print('getfij')
        print(rp.getfij('LIN'), '\n')

        print('resetup_test_prop, setref, setmod')
        print(resetup_test_prop_a, '\n')

        print('resetup')
        print(rp.resetup(resetup_test_prop_a), '\n')

        print('resetup_test_prop, setref(???), setmod')
        print(resetup_test_prop_b, '\n')

        print('resetup')
        print(rp.resetup(resetup_test_prop_b), '\n')

        print('resetup_test_prop, setktv')
        print(resetup_test_prop_c, '\n')

        print('resetup')
        print(rp.resetup(resetup_test_prop_c), '\n')

        print('resetup_test_prop, purefld')
        print(resetup_test_prop_d, '\n')

        print('resetup')
        print(rp.resetup(resetup_test_prop_d), '\n')

        #normalize([0.2, 0.2, 0.1, 0.1])
        print('normalize')
        print(rp.normalize([0.2, 0.2, 0.1, 0.1]), '\n')

        #setup_details
        print('setup_details')
        print(rp.setup_details({'hfld': ['BUTANE', 'ETHANE', 'PROPANE', 'METHANE'],
                                    'D': 0.21683907260570098,
                                    'Dvap': 0.09664613429889905, 'hfmix': 'HMX.BNC',
                                    'setmod': {'hcomp': ['TC2', 'TC1', 'TC2', 'TC2'],
                                                  'htype': 'TCX', 'hmix': 'ECS'},
                                    'cp': -9999980.0,
                                    'xliq': [Decimal('0.7125650648765283717349528049'),
                                                Decimal('0.04065955068790887177072495080'),
                                                Decimal('0.2449672538076863186375885862'),
                                                Decimal('0.001808130627876437856733658079')],
                                    'xvap': [Decimal('0.2304027911956556081031262882'),
                                                Decimal('0.2886769748808782463382744488'),
                                                Decimal('0.3697982730402927396744896960'),
                                                Decimal('0.1111219608831734058841095670')],
                                    'x': [0.5, 0.15, 0.3, 0.05], 'e': -13828.39837781548,
                                    'h': -12906.055381248256, 'nc': 4,
                                    'Dliq': 11.150114864150222, 'cv': -9999980.0,
                                    'q': 0.4408579356823604, 'p': 200.0,
                                    's': -44.047682476988044, 't': 260.0, 'w': -9999980.0,
                                    'kph': 1, 'setref': {'p0': 100, 'ixflag': 1, 'h0': 0,
                                                                's0': 0, 't0': 273,
                                                                'hrf': ['OTH', '???']},
                                    'hrf': 'DEF'}), '\n')

        #gerg04
        print('gerg04 = 1')
        rp.gerg04(1)
        print(rp.setup('def', 'butane', 'ethane', 'propane'), '\n')

        #reset gerg04
        print('gerg04 = 0')
        rp.gerg04(0)
        print(rp.setup('def', 'butane', 'ethane', 'propane'), '\n')

        #preos
        print('preos = 2')
        print(rp.preos(2), '\n')

        print('preos = -1')
        print(rp.preos(-1), '\n')

        print('preos = 0')
        print(rp.preos(0), '\n')

        print('preos = -1')
        print(rp.preos(-1), '\n')

        #setaga
        print('setaga')
        print(rp.setaga(), '\n')

        #unsetaga
        print('unsetaga')
        print(rp.unsetaga(), '\n')

        #setup_settings
        print('setup_setting')
        print(rp.setup_setting(), '\n')
Exemplo n.º 2
0
def _maintest(rp):
    #examples and test setup
    rp.SetErrorDebug.off()  #turn on =>> for testing purpose

    if rp.test():  #if True; rptest =>>for testing purpose
        print u'refprop installed correctely'

        print u'test results'
        print rp.testresult

        print u'fluidlib'
        rp.fluidlib()
        print u'\n'

        prop = rp.setup(
            u'def',
            u'air',
        )
        print u'setup air'
        print prop, u'\n'

        x = prop[u'x']

        print u'critp(x)'
        print rp.critp(x), u'\n'

        print u'setup water ammonia'
        print rp.setup(
            u'def',
            u'water',
            u'ammonia',
        ), u'\n'

        #alternative setup input
        rp.setup(
            u'def',
            [u'water', u'ammonia'],
        )

        x = [0.5, 0.3]
        prop = rp.normalize(x)
        x = prop[u'x']

        prop = rp.critp(x)
        prop = rp.therm(prop[u'tcrit'], prop[u'Dcrit'], x)
        print u'therm'
        print prop, u'\n'

        p = prop[u'p']

        print u'therm2'
        print rp.therm2(prop[u't'], prop[u'D'], x), u'\n'

        print u'therm0'
        print rp.therm0(prop[u't'], prop[u'D'], x), u'\n'

        print u'residual'
        print rp.residual(prop[u't'], prop[u'D'], x), u'\n'

        print u'entro'
        print rp.entro(prop[u't'], prop[u'D'], x), u'\n'

        print u'enthal'
        print rp.enthal(prop[u't'], prop[u'D'], x), u'\n'

        print u'ag'
        print rp.ag(prop[u't'], prop[u'D'], x), u'\n'

        print u'cvcp'
        print rp.cvcp(prop[u't'], prop[u'D'], x), u'\n'

        print u'dddp'
        print rp.dddp(prop[u't'], prop[u'D'], x), u'\n'

        print u'dddt'
        print rp.dddt(prop[u't'], prop[u'D'], x), u'\n'

        print u'dhd1'
        print rp.dhd1(prop[u't'], prop[u'D'], x), u'\n'

        print u'dpdd'
        print rp.dpdd(prop[u't'], prop[u'D'], x), u'\n'

        print u'dpdd2'
        print rp.dpdd2(prop[u't'], prop[u'D'], x), u'\n'

        print u'dpdt'
        print rp.dpdt(prop[u't'], prop[u'D'], x), u'\n'

        D = prop[u'D']

        #function not supported in Windows
        if platform.system() == u'Linux':
            print u'dcdt'
            print rp.dcdt(prop[u't'], x), u'\n'

        #function not supported in Windows
        if platform.system() == u'Linux':
            print u'dcdt2'
            print rp.dcdt2(prop[u't'], x), u'\n'

        print u'fgcty'
        print rp.fgcty(prop[u't'], D, x), u'\n'

        print u'gibbs'
        print rp.gibbs(prop[u't'], prop[u'D'], x), u'\n'

        #~ print('fgcty2')
        #~ print(rp.fgcty2(prop['t'], prop['D'], x), '\n')

        prop = rp.therm3(prop[u't'], prop[u'D'], x)
        print u'therm3'
        print prop, u'\n'

        D = prop[u'D']

        print u'virb'
        print rp.virb(prop[u't'], x), u'\n'

        print u'virc'
        print rp.virc(prop[u't'], x), u'\n'

        #function not supported in Windows
        if platform.system() == u'Linux':
            print u'vird'
            print rp.vird(prop[u't'], x), u'\n'

        print u'virba'
        print rp.virba(prop[u't'], x), u'\n'

        print u'virca'
        print rp.virca(prop[u't'], x), u'\n'

        print u'cvcpk'
        print rp.cvcpk(1, prop[u't'], D), u'\n'

        print u'dbdt'
        print rp.dbdt(prop[u't'], x), u'\n'

        print u'dpddk'
        print rp.dpddk(1, prop[u't'], D), u'\n'

        print u'dpdtk'
        print rp.dpdtk(2, prop[u't'], D), u'\n'

        D = 55
        t = 373

        prop = rp.press(t, D, x)
        print u'press'
        print prop, u'\n'

        p = prop[u'p']

        print u'purefld(1)'
        prop = rp.purefld(1)
        print prop, u'\n'

        x = [1]

        resetup_test_prop_d = prop

        print u'satt'
        prop = rp.satt(t, x)
        print prop, u'\n'

        print u'satp'
        prop = rp.satp(prop[u'p'], x)
        print prop, u'\n'

        print u'satd'
        print rp.satd(prop[u'Dliq'], x), u'\n'

        print u'sath'
        print rp.sath(47000, x, 0), u'\n'

        print u'sate'
        print rp.sate(0.96047E-13, x), u'\n'

        print u'sats'
        print rp.sats(50, x, 0), u'\n'

        print u'purefld(0)'
        print rp.purefld(0), u'\n'

        x = [0.5, 0.3]
        x = rp.normalize(x)[u'x']

        print u'csatk'
        print rp.csatk(1, t), u'\n'

        print u'dptsatk'
        print rp.dptsatk(1, t), u'\n'

        print u'cv2pk'
        print rp.cv2pk(2, t, D), u'\n'

        print u'tprho'
        print rp.tprho(t, p, x, 2, 1, 58), u'\n'

        print u'flsh, tp'
        prop = rp.flsh(u'tp', t, p, x)
        print prop, u'\n'

        print u'flsh, th'
        print rp.flsh(u'tH', 305, prop[u'h'], x, 1), u'\n'

        print u'flsh, tD'
        print rp.flsh(u'tD', t, 30, x), u'\n'

        print u'info()'
        print rp.info(), u'\n'

        print u'info(2)'
        print rp.info(2), u'\n'

        #unsupported in Windows
        if platform.system() == u'Linux':
            print u'rmix2'
            print rp.rmix2(x), u'\n'

        print u'xmass'
        prop = rp.xmass(x)
        print prop, u'\n'

        print u'xmole'
        print rp.xmole(prop[u'xkg']), u'\n'

        print u'limitx'
        print rp.limitx(x, u'eos', t, D, p), u'\n'

        print u'limitk'
        print rp.limitk(u'eos', 1, t, D, p), u'\n'

        print u'limits'
        print rp.limits(x), u'\n'

        print u'flsh, ts'
        prop = rp.flsh(u'ts', t, 40, x)
        print prop, u'\n'

        print u'flsh, te'
        print rp.flsh(u'te', t, prop[u'e'], x), u'\n'

        print u'flsh, pD'
        prop = rp.flsh(u'Pd', p, D, x)
        print prop, u'\n'

        print u'flsh, ph'
        prop = rp.flsh(u'ph', p, prop[u'h'], x)
        print prop, u'\n'

        print u'flsh, ps'
        prop = rp.flsh(u'ps', p, prop[u's'], x)
        print prop, u'\n'

        print u'flsh, pe'
        prop = rp.flsh(u'pE', p, prop[u'e'], x)
        print prop, u'\n'

        print u'flsh, es'
        prop = rp.flsh(u'es', prop[u'e'], prop[u's'], x)
        print prop, u'\n'

        print u'flsh, hs'
        prop = rp.flsh(u'hs', 40000, 100, x)
        print prop, u'\n'

        print u'flsh, es'
        print rp.flsh(u'es', 175, 13, x), u'\n'

        print u'flsh, Dh'
        print rp.flsh(u'DH', 20, 18000, x), u'\n'

        print u'flsh, Ds'
        prop = rp.flsh(u'Ds', 20, 50, x)
        print prop, u'\n'

        print u'flsh, De'
        prop = rp.flsh(u'DE', 20, prop[u'e'], x)
        print prop, u'\n'

        print u'flsh, tq'
        prop = rp.flsh(u'tq', t, prop[u'q'], x)
        print prop, u'\n'

        print u'flsh, pq'
        print rp.flsh(u'pq', 1200, prop[u'q'], x), u'\n'

        prop = rp.flsh(u'tp', 350, 1200, x)
        print u'flsh, tp'
        print prop, u'\n'
        s = prop[u's']
        e = prop[u'e']
        h = prop[u'h']
        D = prop[u'D']
        t = prop[u't']
        p = prop[u'p']
        Dmin = 40
        Dmax = 55

        print u'flsh1, liq, ph'
        print rp.flsh1(u'Ph', p, h, x, 1), u'\n'

        print u'getphase'
        print rp.getphase(prop), u'\n'

        print u'flsh1, liq, pD'
        print rp.flsh1(u'PD', p, D, x), u'\n'

        print u'flsh1, liq, ps'
        print rp.flsh1(u'Ps', p, s, x), u'\n'

        #unsupported in Windows
        if platform.system() == u'Linux':
            print u'flsh1, liq, th'
            print rp.flsh1(u'th', t, h, x, Dmin=Dmin, Dmax=Dmax), u'\n'

        #unsupported in Windows
        if platform.system() == u'Linux':
            print u'flsh1, liq, ts'
            print rp.flsh1(u'ts', t, s, x, Dmin=Dmin, Dmax=Dmax), u'\n'

        #unsupported in Windows
        if platform.system() == u'Linux':
            print u'flsh1, liq, te'
            print rp.flsh1(u'te', t, e, x, Dmin=Dmin, Dmax=Dmax), u'\n'

        #unsupported in Windows
        if platform.system() == u'Linux':
            print u'flsh1, liq, pe'
            print rp.flsh1(u'Pe', p, e, x), u'\n'

        #unsupported in Windows
        if platform.system() == u'Linux':
            print u'flsh1, liq, hs'
            print rp.flsh1(u'hs', h, s, x, Dmin=Dmin, Dmax=Dmax), u'\n'

        #unsupported in Windows
        if platform.system() == u'Linux':
            print u'flsh1, liq, Dh'
            print rp.flsh1(u'Dh', D, h, x), u'\n'

        #unsupported in Windows
        if platform.system() == u'Linux':
            print u'flsh1, liq, Ds'
            print rp.flsh1(u'Ds', D, s, x), u'\n'

        #unsupported in Windows
        if platform.system() == u'Linux':
            print u'flsh1, liq, De'
            print rp.flsh1(u'De', D, e, x), u'\n'

        prop = rp.flsh(u'tp', 400, 100, x)
        s = prop[u's']
        e = prop[u'e']
        h = prop[u'h']
        D = prop[u'D']
        Dmin = 0.01
        Dmax = 0.05
        t = prop[u't']
        p = prop[u'p']

        print u'flsh1, vap, ph'
        print rp.flsh1(u'Ph', p, h, x, 2), u'\n'

        print u'getphase'
        print rp.getphase(prop), u'\n'

        print u'flsh1, vap, pD'
        print rp.flsh1(u'PD', p, D, x, 2), u'\n'

        print u'flsh1, vap, ps'
        print rp.flsh1(u'Ps', p, s, x, 2), u'\n'

        #unsupported in Windows
        if platform.system() == u'Linux':
            print u'flsh1, vap, th'
            print rp.flsh1(u'th', t, h, x, Dmin=Dmin, Dmax=Dmax), u'\n'

        #unsupported in Windows
        if platform.system() == u'Linux':
            print u'flsh1, vap, ts'
            print rp.flsh1(u'ts', t, s, x, Dmin=Dmin, Dmax=Dmax), u'\n'

        #unsupported in Windows
        if platform.system() == u'Linux':
            print u'flsh1, vap, te'
            print rp.flsh1(u'te', t, e, x, Dmin=Dmin, Dmax=Dmax), u'\n'

        #unsupported in Windows
        if platform.system() == u'Linux':
            print u'flsh1, vap, pe'
            print rp.flsh1(u'Pe', p, e, x, 2), u'\n'

        #unsupported in Windows
        if platform.system() == u'Linux':
            print u'flsh1, vap, hs'
            print rp.flsh1(u'hs', h, s, x, Dmin=Dmin, Dmax=Dmax), u'\n'

        #unsupported in Windows
        if platform.system() == u'Linux':
            print u'flsh1, vap, Dh'
            print rp.flsh1(u'Dh', D, h, x), u'\n'

        #unsupported in Windows
        if platform.system() == u'Linux':
            print u'flsh1, vap, Ds'
            print rp.flsh1(u'Ds', D, s, x), u'\n'

        #unsupported in Windows
        if platform.system() == u'Linux':
            print u'flsh1, vap, De'
            print rp.flsh1(u'De', D, e, x), u'\n'

        print u'cstar'
        print rp.cstar(t, p, 8, x), u'\n'

        print u'fpv'
        print rp.fpv(t, D, p, x), u'\n'

        #function not supported in Windows
        if platform.system() == u'Linux':
            print u'excess'
            print rp.excess(t, p, x, kph=2), u'\n'

        prop = rp.flsh(u'pq', 1200, 0.65, x)
        D = prop[u'D']
        Dliq = prop[u'Dliq']
        Dvap = prop[u'Dvap']
        xliq = prop[u'xliq']
        xvap = prop[u'xvap']
        e = prop[u'e']
        h = prop[u'h']
        s = prop[u's']
        q = prop[u'q']
        p = prop[u'p']
        t = prop[u't']

        #function not supported in Windows
        if platform.system() == u'Linux':
            print u'tpfl2'
            print rp.flsh2(u'tp', t, p, x), u'\n'

        #function not supported in Windows
        if platform.system() == u'Linux':
            print u'Dhfl2'
            print rp.flsh2(u'Dh', D, h, x), u'\n'

        #function not supported in Windows
        if platform.system() == u'Linux':
            print u'Dsfl2'
            print rp.flsh2(u'Ds', D, s, x), u'\n'

        #function not supported in Windows
        if platform.system() == u'Linux':
            print u'Defl2'
            print rp.flsh2(u'De', D, e, x), u'\n'

        #function not supported in Windows
        if platform.system() == u'Linux':
            print u'thfl2'
            print rp.flsh2(u'th', t, h, x, ksat=0), u'\n'

        #function not supported in Windows
        if platform.system() == u'Linux':
            print u'tsfl2'
            print rp.flsh2(u'ts', t, s, x, ksat=0), u'\n'

        #function not supported in Windows
        if platform.system() == u'Linux':
            print u'tefl2'
            print rp.flsh2(u'te', t, e, x, ksat=0), u'\n'

        #function not supported in Windows
        if platform.system() == u'Linux':
            print u'tDfl2'
            print rp.flsh2(u'tD', t, D, x, ksat=0), u'\n'

        #function not supported in Windows
        if platform.system() == u'Linux':
            print u'pDfl2'
            print rp.flsh2(u'pD', p, D, x, ksat=0), u'\n'

        #function not supported in Windows
        if platform.system() == u'Linux':
            print u'phfl2'
            print rp.flsh2(u'ph', p, h, x, ksat=0), u'\n'

        #function not supported in Windows
        if platform.system() == u'Linux':
            print u'psfl2'
            print rp.flsh2(u'ps', p, s, x, ksat=0), u'\n'

        #function not supported in Windows
        if platform.system() == u'Linux':
            print u'pefl2'
            print rp.flsh2(u'pe', p, e, x, ksat=0), u'\n'

        #function not supported in Windows
        if platform.system() == u'Linux':
            print u'tqfl2'
            print rp.flsh2(u'tq', t, q, x, ksat=0), u'\n'

        #function not supported in Windows
        if platform.system() == u'Linux':
            print u'pqfl2'
            print rp.flsh2(u'pq', p, q, x, ksat=0), u'\n'

        #function not supported in Windows
        #~ if platform.system() == 'Linux':
        #~ print('Dqfl2')
        #~ print(rp.flsh2('Dq', D, q, x), '\n')

        prop = rp.flsh(u'tp', 340, 100, x)
        t = prop[u't']
        Dliq = prop[u'Dliq']
        Dvap = prop[u'Dvap']
        xliq = prop[u'xliq']
        xvap = prop[u'xvap']

        print u'qmass'
        prop = rp.qmass(prop[u'q'], xliq, xvap)
        print prop, u'\n'

        print u'qmole'
        print rp.qmole(prop[u'qkg'], prop[u'xlkg'], prop[u'xvkg']), u'\n'

        print u'wmol'
        print rp.wmol(x), u'\n'

        prop = rp.flsh(u'tp', 340, 100, x)

        print u'dielec'
        print rp.dielec(prop[u't'], prop[u'D'], x), u'\n'

        print u'surten'
        print rp.surten(t, Dliq, Dvap, xliq, xvap), u'\n'

        print u'surft'
        print rp.surft(240, x), u'\n'

        rp.setup(u'def', u'water')

        print u'meltt'
        print rp.meltt(273.15, [1]), u'\n'

        print u'meltp'
        print rp.meltp(100, [1]), u'\n'

        print u'sublt'
        print rp.sublt(273.15, [1]), u'\n'

        print u'sublp'
        print rp.sublp(0.1, [1]), u'\n'

        rp.setup(
            u'def',
            u'butane',
            u'ethane',
            u'propane',
            u'methane',
        )
        x = [0.5, 0.15, 0.3, 0.05]
        rp.setref(u'nbp')
        prop = rp.flsh(u'tp', 260, 150, x)
        D = prop[u'D']
        print u'trnprp, setref NBP'
        print rp.trnprp(260, D, x), u'\n'

        print u'B12'
        print rp.b12(260, x), u'\n'

        print u'chempot'
        print rp.chempot(260, D, x), u'\n'

        print u'fugcof'
        print rp.fugcof(260, D, x), u'\n'

        ##function not supported in Windows
        #if platform.system() == 'Linux':
        #print('phiderv')
        #print(rp.phiderv(2, 1, 260, D, x), '\n')

        #function not supported in Windows
        if platform.system() == u'Linux':
            print u'getmod'
            print rp.getmod(1, u'EOS'), u'\n'

        rp.setmod(u'tcx', u'ecs', [u'tc2', u'tc1', u'tc2', u'tc2'])
        rp.setup(
            u'def',
            u'butane',
            u'ethane',
            u'propane',
            u'methane',
        )
        x = [0.5, 0.15, 0.3, 0.05]
        rp.setref(u'nbp')
        prop = rp.flsh(u'tp', 260, 200, x)
        print u'trnprp, setref NBP, setmod [tcx, ecs, tc2, tc1, tc2, tc2]'
        print rp.trnprp(260, prop[u'D'], x), u'\n'

        #function not supported in Windows
        if platform.system() == u'Linux':
            print u'getmod'
            print rp.getmod(3, u'tcx'), u'\n'

        rp.setref(u'oth', 1, [1], 0, 0, 273, 100)
        print u'setref = OTH'
        prop = rp.flsh(u'tp', 260, 200, x)
        print prop, u'\n'

        resetup_test_prop_a = prop

        rp.setref(u'???', 1, [1], 0, 0, 373, 100)
        print u'setref = ???'
        prop = rp.flsh(u'tp', 260, 200, x)
        print prop, u'\n'

        resetup_test_prop_b = prop

        print u'name'
        print rp.name(1), u'\n'

        rp.setup(
            u'def',
            u'butane',
            u'ethane',
            u'propane',
            u'methane',
        )
        x = [0.5, 0.15, 0.3, 0.05]
        print u'getktv'
        prop = rp.getktv(1, 3)
        print prop, u'\n'

        print u'setktv'
        prop = rp.setktv(
            1,
            3,
            u'lin',
            prop[u'fij'],
            prop[u'hfmix'],
        )
        print prop, u'\n'

        resetup_test_prop_c = prop

        print u'reset setktv'
        print rp.setktv(1, 2, u'rst'), u'\n'

        print u'getfij'
        print rp.getfij(u'LIN'), u'\n'

        print u'resetup_test_prop, setref, setmod'
        print resetup_test_prop_a, u'\n'

        print u'resetup'
        print rp.resetup(resetup_test_prop_a), u'\n'

        print u'resetup_test_prop, setref(???), setmod'
        print resetup_test_prop_b, u'\n'

        print u'resetup'
        print rp.resetup(resetup_test_prop_b), u'\n'

        print u'resetup_test_prop, setktv'
        print resetup_test_prop_c, u'\n'

        print u'resetup'
        print rp.resetup(resetup_test_prop_c), u'\n'

        print u'resetup_test_prop, purefld'
        print resetup_test_prop_d, u'\n'

        print u'resetup'
        print rp.resetup(resetup_test_prop_d), u'\n'

        #normalize([0.2, 0.2, 0.1, 0.1])
        print u'normalize'
        print rp.normalize([0.2, 0.2, 0.1, 0.1]), u'\n'

        #setup_details
        print u'setup_details'
        print rp.setup_details({
            u'hfld': [u'BUTANE', u'ETHANE', u'PROPANE', u'METHANE'],
            u'D':
            0.21683907260570098,
            u'Dvap':
            0.09664613429889905,
            u'hfmix':
            u'HMX.BNC',
            u'setmod': {
                u'hcomp': [u'TC2', u'TC1', u'TC2', u'TC2'],
                u'htype': u'TCX',
                u'hmix': u'ECS'
            },
            u'cp':
            -9999980.0,
            u'xliq': [
                Decimal(u'0.7125650648765283717349528049'),
                Decimal(u'0.04065955068790887177072495080'),
                Decimal(u'0.2449672538076863186375885862'),
                Decimal(u'0.001808130627876437856733658079')
            ],
            u'xvap': [
                Decimal(u'0.2304027911956556081031262882'),
                Decimal(u'0.2886769748808782463382744488'),
                Decimal(u'0.3697982730402927396744896960'),
                Decimal(u'0.1111219608831734058841095670')
            ],
            u'x': [0.5, 0.15, 0.3, 0.05],
            u'e':
            -13828.39837781548,
            u'h':
            -12906.055381248256,
            u'nc':
            4,
            u'Dliq':
            11.150114864150222,
            u'cv':
            -9999980.0,
            u'q':
            0.4408579356823604,
            u'p':
            200.0,
            u's':
            -44.047682476988044,
            u't':
            260.0,
            u'w':
            -9999980.0,
            u'kph':
            1,
            u'setref': {
                u'p0': 100,
                u'ixflag': 1,
                u'h0': 0,
                u's0': 0,
                u't0': 273,
                u'hrf': [u'OTH', u'???']
            },
            u'hrf':
            u'DEF'
        }), u'\n'

        #gerg04
        print u'gerg04 = 1'
        rp.gerg04(1)
        print rp.setup(u'def', u'butane', u'ethane', u'propane'), u'\n'

        #reset gerg04
        print u'gerg04 = 0'
        rp.gerg04(0)
        print rp.setup(u'def', u'butane', u'ethane', u'propane'), u'\n'

        #preos
        print u'preos = 2'
        print rp.preos(2), u'\n'

        print u'preos = -1'
        print rp.preos(-1), u'\n'

        print u'preos = 0'
        print rp.preos(0), u'\n'

        print u'preos = -1'
        print rp.preos(-1), u'\n'

        #setaga
        print u'setaga'
        print rp.setaga(), u'\n'

        #unsetaga
        print u'unsetaga'
        print rp.unsetaga(), u'\n'

        #setup_settings
        print u'setup_setting'
        print rp.setup_setting(), u'\n'
Exemplo n.º 3
0
 def _rpfunc():
     return refprop.dbdt(t, x)
Exemplo n.º 4
0
 def _rpfunc():
     return refprop.dbdt(t, x)
Exemplo n.º 5
0
    def fill(self, fase, T, rho, x):
        if sum(x) != 1:
            x = [round(xi, 10) for xi in x]
        mol = refprop.wmol(x)
        thermo = refprop.therm2(T, rho, x)
        thermo3 = refprop.therm3(T, rho, x)

        fase._bool = True
        fase.M = unidades.Dimensionless(mol["wmix"])
        fase.rho = unidades.Density(rho*fase.M)
        fase.v = unidades.SpecificVolume(1./fase.rho)
        fase.Z = unidades.Dimensionless(thermo["Z"])

        fase.u = unidades.Enthalpy(thermo["e"]/fase.M, "Jg")
        fase.h = unidades.Enthalpy(thermo["h"]/fase.M, "Jg")
        fase.s = unidades.SpecificHeat(thermo["s"]/fase.M, "JgK")
        fase.a = unidades.Enthalpy(thermo["A"]/fase.M, "Jg")
        fase.g = unidades.Enthalpy(thermo["G"]/fase.M, "Jg")

        fase.cv = unidades.SpecificHeat(thermo["cv"]/fase.M, "JgK")
        fase.cp = unidades.SpecificHeat(thermo["cp"]/fase.M, "JgK")
        fase.cp_cv = unidades.Dimensionless(fase.cp/fase.cv)
        fase.gamma = fase.cp_cv
        fase.w = unidades.Speed(thermo["w"])

        fase.rhoM = unidades.MolarDensity(fase.rho/self.M)
        fase.hM = unidades.MolarEnthalpy(fase.h*self.M)
        fase.sM = unidades.MolarSpecificHeat(fase.s*self.M)
        fase.uM = unidades.MolarEnthalpy(fase.u*self.M)
        fase.aM = unidades.MolarEnthalpy(fase.a*self.M)
        fase.gM = unidades.MolarEnthalpy(fase.g*self.M)
        fase.cvM = unidades.MolarSpecificHeat(fase.cv*self.M)
        fase.cpM = unidades.MolarSpecificHeat(fase.cp*self.M)

        residual = refprop.residual(T, rho, x)
        fase.pr = unidades.Pressure(residual["pr"], "kPa")
        fase.ur = unidades.Enthalpy(residual["er"]/fase.M, "Jg")
        fase.hr = unidades.Enthalpy(residual["hr"]/fase.M, "Jg")
        fase.sr = unidades.SpecificHeat(residual["sr"]/fase.M, "JgK")
        fase.ar = unidades.Enthalpy(residual["Ar"]/fase.M, "Jg")
        fase.gr = unidades.Enthalpy(residual["Gr"]/fase.M, "Jg")
        fase.cvr = unidades.SpecificHeat(residual["cvr"]/fase.M, "JgK")
        fase.cpr = unidades.SpecificHeat(residual["cpr"]/fase.M, "JgK")

        fase.alfav = unidades.InvTemperature(thermo["beta"])
        fase.kappa = unidades.InvPressure(thermo["xkappa"], "kPa")
        fase.kappas = unidades.InvPressure(thermo3["betas"], "kPa")
        fase.alfap = unidades.Density(fase.alfav/self.P/fase.kappa)
        fase.deltat = unidades.EnthalpyPressure(
            thermo3["thrott"]/fase.M, "kJkgkPa")
        fase.joule = unidades.TemperaturePressure(thermo["hjt"], "KkPa")
        fase.betas = unidades.TemperaturePressure(
            self.derivative("T", "P", "s", fase))
        fase.betap = unidades.Density(
            -1/self.P*self.derivative("P", "v", "T", fase))

        fase.Kt = unidades.Pressure(thermo3["xkkt"], "kPa")
        fase.Ks = unidades.Pressure(thermo3["bs"], "kPa")
        fase.kt = unidades.Dimensionless(thermo3["xkt"])
        fase.ks = unidades.Dimensionless(thermo3["xisenk"])

        dh = refprop.dhd1(T, rho, x)
        fase.dhdT_rho = unidades.SpecificHeat(dh["dhdt_D"]/fase.M, "kJkgK")
        fase.dhdT_P = unidades.SpecificHeat(dh["dhdt_p"]/fase.M, "kJkgK")
        fase.dhdP_T = unidades.EnthalpyPressure(dh["dhdp_t"]/fase.M, "kJkgkPa")
        # dhdtp_D : fix in library
        fase.dhdP_rho = unidades.EnthalpyPressure(
            dh["dhdtp_D"]/fase.M, "kJkgkPa")
        fase.dhdrho_T = unidades.EnthalpyDensity(
            dh["dhdD_t"]/fase.M**2, "kJkgkgm3")
        fase.dhdrho_P = unidades.EnthalpyDensity(
            dh["dhdD_p"]/fase.M**2, "kJkgkgm3")

        fase.dpdT_rho = unidades.PressureTemperature(thermo["dpdt"], "kPaK")
        fase.dpdrho_T = unidades.PressureDensity(
            thermo["dpdD"]/fase.M, "kPakgm3")
        # TODO: Add unit for derivative d^2p/dD^2 [kPa-L^2/mol^2]
        # MPa·m⁶/kg²
        fase.d2pdrho2 = unidades.Dimensionless(thermo["d2pdD2"]/fase.M**2/1000)
        fase.drhodP_T = unidades.DensityPressure(
            thermo["dDdp"]*fase.M, "kgm3kPa")
        fase.drhodT_P = unidades.DensityTemperature(thermo["dDdt"]*fase.M)
        fase.Gruneisen = unidades.Dimensionless(fase.v/fase.cv*fase.dpdT_rho)

        fase.Z_rho = unidades.SpecificVolume((fase.Z-1)/fase.rho)
        fase.IntP = unidades.Pressure(thermo3["pint"], "kPa")
        fase.hInput = unidades.Enthalpy(thermo3["spht"]/fase.M, "kJkg")
        fase.invT = unidades.InvTemperature(-1/self.T)

        fpv = refprop.fpv(T, rho, self.P.kPa, x)["Fpv"]
        fase.fpv = unidades.Dimensionless(fpv)

        chempot = refprop.chempot(T, rho, x)["u"]
        fase.chempot = [unidades.Enthalpy(c/fase.M) for c in chempot]
        fi = refprop.fugcof(T, rho, x)["f"]
        fase.fi = [unidades.Dimensionless(f) for f in fi]
        f = refprop.fgcty(T, rho, x)["f"]
        fase.f = [unidades.Pressure(f_i, "kPa") for f_i in f]

        b = refprop.virb(T, x)["b"]
        fase.virialB = unidades.SpecificVolume(b/self.M)
        c = refprop.virc(T, x)["c"]
        fase.virialC = unidades.SpecificVolume_square(c/self.M**2)
        # viriald don't supported for windows
        d = refprop.vird(T, x)["d"]
        fase.virialD = unidades.Dimensionless(d/self.M**3)
        ba = refprop.virba(T, x)["ba"]
        fase.virialBa = unidades.SpecificVolume(ba/self.M)
        ca = refprop.virca(T, x)["ca"]
        fase.virialCa = unidades.SpecificVolume_square(ca/self.M**2)
        dcdt = refprop.dcdt(T, x)["dct"]
        fase.dCdt = unidades.Dimensionless(dcdt/self.M**2)
        dcdt2 = refprop.dcdt2(T, x)["dct2"]
        fase.dCdt2 = unidades.Dimensionless(dcdt2/self.M**2)
        dbdt = refprop.dbdt(T, x)["dbt"]
        fase.dBdt = unidades.Dimensionless(dbdt/self.M)

        b12 = refprop.b12(T, x)["b"]
        fase.b12 = unidades.SpecificVolume(b12*fase.M)
        try:
            cstar = refprop.cstar(T, self.P.kPa, 0, x)["cs"]
            fase.cstar = unidades.Dimensionless(cstar)
        except refprop.RefpropdllError:
            fase.cstar = unidades.Dimensionless(None)

        fase.fraccion = [unidades.Dimensionless(xi) for xi in x]
        xg = refprop.xmass(x)["xkg"]
        fase.fraccion_masica = [unidades.Dimensionless(xi) for xi in xg]

        transport = refprop.trnprp(T, rho, x)
        fase.mu = unidades.Viscosity(transport["eta"], "muPas")
        fase.nu = unidades.Diffusivity(fase.mu/fase.rho)
        fase.k = unidades.ThermalConductivity(transport["tcx"])
        fase.alfa = unidades.Diffusivity(fase.k/fase.rho/fase.cp)
        fase.Prandt = unidades.Dimensionless(fase.mu*fase.cp/fase.k)

        dielec = refprop.dielec(T, rho, x)
        fase.epsilon = unidades.Dimensionless(dielec["de"])
Exemplo n.º 6
0
    def fill(self, fase, T, rho, x):
        if sum(x) != 1:
            x = [round(xi, 10) for xi in x]
        mol = refprop.wmol(x)
        thermo = refprop.therm2(T, rho, x)
        thermo3 = refprop.therm3(T, rho, x)

        fase._bool = True
        fase.M = unidades.Dimensionless(mol["wmix"])
        fase.rho = unidades.Density(rho*fase.M)
        fase.v = unidades.SpecificVolume(1./fase.rho)
        fase.Z = unidades.Dimensionless(thermo["Z"])

        fase.u = unidades.Enthalpy(thermo["e"]/fase.M, "Jg")
        fase.h = unidades.Enthalpy(thermo["h"]/fase.M, "Jg")
        fase.s = unidades.SpecificHeat(thermo["s"]/fase.M, "JgK")
        fase.a = unidades.Enthalpy(thermo["A"]/fase.M, "Jg")
        fase.g = unidades.Enthalpy(thermo["G"]/fase.M, "Jg")

        fase.cv = unidades.SpecificHeat(thermo["cv"]/fase.M, "JgK")
        fase.cp = unidades.SpecificHeat(thermo["cp"]/fase.M, "JgK")
        fase.cp_cv = unidades.Dimensionless(fase.cp/fase.cv)
        fase.gamma = fase.cp_cv
        fase.w = unidades.Speed(thermo["w"])

        fase.rhoM = unidades.MolarDensity(fase.rho/self.M)
        fase.hM = unidades.MolarEnthalpy(fase.h*self.M)
        fase.sM = unidades.MolarSpecificHeat(fase.s*self.M)
        fase.uM = unidades.MolarEnthalpy(fase.u*self.M)
        fase.aM = unidades.MolarEnthalpy(fase.a*self.M)
        fase.gM = unidades.MolarEnthalpy(fase.g*self.M)
        fase.cvM = unidades.MolarSpecificHeat(fase.cv*self.M)
        fase.cpM = unidades.MolarSpecificHeat(fase.cp*self.M)

        residual = refprop.residual(T, rho, x)
        fase.pr = unidades.Pressure(residual["pr"], "kPa")
        fase.ur = unidades.Enthalpy(residual["er"]/fase.M, "Jg")
        fase.hr = unidades.Enthalpy(residual["hr"]/fase.M, "Jg")
        fase.sr = unidades.SpecificHeat(residual["sr"]/fase.M, "JgK")
        fase.ar = unidades.Enthalpy(residual["Ar"]/fase.M, "Jg")
        fase.gr = unidades.Enthalpy(residual["Gr"]/fase.M, "Jg")
        fase.cvr = unidades.SpecificHeat(residual["cvr"]/fase.M, "JgK")
        fase.cpr = unidades.SpecificHeat(residual["cpr"]/fase.M, "JgK")

        fase.alfav = unidades.InvTemperature(thermo["beta"])
        fase.kappa = unidades.InvPressure(thermo["xkappa"], "kPa")
        fase.kappas = unidades.InvPressure(thermo3["betas"], "kPa")
        fase.alfap = unidades.Density(fase.alfav/self.P/fase.kappa)
        fase.deltat = unidades.EnthalpyPressure(
            thermo3["thrott"]/fase.M, "kJkgkPa")
        fase.joule = unidades.TemperaturePressure(thermo["hjt"], "KkPa")
        fase.betas = unidades.TemperaturePressure(
            self.derivative("T", "P", "s", fase))
        fase.betap = unidades.Density(
            -1/self.P*self.derivative("P", "v", "T", fase))

        fase.Kt = unidades.Pressure(thermo3["xkkt"], "kPa")
        fase.Ks = unidades.Pressure(thermo3["bs"], "kPa")
        fase.kt = unidades.Dimensionless(thermo3["xkt"])
        fase.ks = unidades.Dimensionless(thermo3["xisenk"])

        dh = refprop.dhd1(T, rho, x)
        fase.dhdT_rho = unidades.SpecificHeat(dh["dhdt_D"]/fase.M, "kJkgK")
        fase.dhdT_P = unidades.SpecificHeat(dh["dhdt_p"]/fase.M, "kJkgK")
        fase.dhdP_T = unidades.EnthalpyPressure(dh["dhdp_t"]/fase.M, "kJkgkPa")
        # dhdtp_D : fix in library
        fase.dhdP_rho = unidades.EnthalpyPressure(
            dh["dhdtp_D"]/fase.M, "kJkgkPa")
        fase.dhdrho_T = unidades.EnthalpyDensity(
            dh["dhdD_t"]/fase.M**2, "kJkgkgm3")
        fase.dhdrho_P = unidades.EnthalpyDensity(
            dh["dhdD_p"]/fase.M**2, "kJkgkgm3")

        fase.dpdT_rho = unidades.PressureTemperature(thermo["dpdt"], "kPaK")
        fase.dpdrho_T = unidades.PressureDensity(
            thermo["dpdD"]/fase.M, "kPakgm3")
        # TODO: Add unit for derivative d^2p/dD^2 [kPa-L^2/mol^2]
        # MPa·m⁶/kg²
        fase.d2pdrho2 = unidades.Dimensionless(thermo["d2pdD2"]/fase.M**2/1000)
        fase.drhodP_T = unidades.DensityPressure(
            thermo["dDdp"]*fase.M, "kgm3kPa")
        fase.drhodT_P = unidades.DensityTemperature(thermo["dDdt"]*fase.M)
        fase.Gruneisen = unidades.Dimensionless(fase.v/fase.cv*fase.dpdT_rho)

        fase.Z_rho = unidades.SpecificVolume((fase.Z-1)/fase.rho)
        fase.IntP = unidades.Pressure(thermo3["pint"], "kPa")
        fase.hInput = unidades.Enthalpy(thermo3["spht"]/fase.M, "kJkg")
        fase.invT = unidades.InvTemperature(-1/self.T)

        fpv = refprop.fpv(T, rho, self.P.kPa, x)["Fpv"]
        fase.fpv = unidades.Dimensionless(fpv)

        chempot = refprop.chempot(T, rho, x)["u"]
        fase.chempot = [unidades.Enthalpy(c/fase.M) for c in chempot]
        fi = refprop.fugcof(T, rho, x)["f"]
        fase.fi = [unidades.Dimensionless(f) for f in fi]
        f = refprop.fgcty(T, rho, x)["f"]
        fase.f = [unidades.Pressure(f_i, "kPa") for f_i in f]

        b = refprop.virb(T, x)["b"]
        fase.virialB = unidades.SpecificVolume(b/self.M)
        c = refprop.virc(T, x)["c"]
        fase.virialC = unidades.SpecificVolume_square(c/self.M**2)

        # viriald don't supported for windows
        if sys.platform != "win32":
            d = refprop.vird(T, x)["d"]
            fase.virialD = unidades.Dimensionless(d/self.M**3)
        else:
            fase.virialD = unidades.Dimensionless(0)

        ba = refprop.virba(T, x)["ba"]
        fase.virialBa = unidades.SpecificVolume(ba/self.M)
        ca = refprop.virca(T, x)["ca"]
        fase.virialCa = unidades.SpecificVolume_square(ca/self.M**2)
        dcdt = refprop.dcdt(T, x)["dct"]
        fase.dCdt = unidades.Dimensionless(dcdt/self.M**2)
        dcdt2 = refprop.dcdt2(T, x)["dct2"]
        fase.dCdt2 = unidades.Dimensionless(dcdt2/self.M**2)
        dbdt = refprop.dbdt(T, x)["dbt"]
        fase.dBdt = unidades.Dimensionless(dbdt/self.M)

        b12 = refprop.b12(T, x)["b"]
        fase.b12 = unidades.SpecificVolume(b12*fase.M)
        try:
            cstar = refprop.cstar(T, self.P.kPa, 0, x)["cs"]
            fase.cstar = unidades.Dimensionless(cstar)
        except refprop.RefpropdllError:
            fase.cstar = unidades.Dimensionless(None)

        fase.fraccion = [unidades.Dimensionless(xi) for xi in x]
        xg = refprop.xmass(x)["xkg"]
        fase.fraccion_masica = [unidades.Dimensionless(xi) for xi in xg]

        transport = refprop.trnprp(T, rho, x)
        fase.mu = unidades.Viscosity(transport["eta"], "muPas")
        fase.nu = unidades.Diffusivity(fase.mu/fase.rho)
        fase.k = unidades.ThermalConductivity(transport["tcx"])
        fase.alfa = unidades.Diffusivity(fase.k/fase.rho/fase.cp)
        fase.Prandt = unidades.Dimensionless(fase.mu*fase.cp/fase.k)

        dielec = refprop.dielec(T, rho, x)
        fase.epsilon = unidades.Dimensionless(dielec["de"])
Exemplo n.º 7
0
def _maintest(rp):
    # examples and test setup
    rp.SetErrorDebug.off()  # turn on =>> for testing purpose

    if rp.test():  # if True; rptest =>>for testing purpose
        print u"refprop installed correctely"

        print u"test results"
        print rp.testresult

        print u"fluidlib"
        rp.fluidlib()
        print u"\n"

        prop = rp.setup(u"def", u"air")
        print u"setup air"
        print prop, u"\n"

        x = prop[u"x"]

        print u"critp(x)"
        print rp.critp(x), u"\n"

        print u"setup water ammonia"
        print rp.setup(u"def", u"water", u"ammonia"), u"\n"

        # alternative setup input
        rp.setup(u"def", [u"water", u"ammonia"])

        x = [0.5, 0.3]
        prop = rp.normalize(x)
        x = prop[u"x"]

        prop = rp.critp(x)
        prop = rp.therm(prop[u"tcrit"], prop[u"Dcrit"], x)
        print u"therm"
        print prop, u"\n"

        p = prop[u"p"]

        print u"therm2"
        print rp.therm2(prop[u"t"], prop[u"D"], x), u"\n"

        print u"therm0"
        print rp.therm0(prop[u"t"], prop[u"D"], x), u"\n"

        print u"residual"
        print rp.residual(prop[u"t"], prop[u"D"], x), u"\n"

        print u"entro"
        print rp.entro(prop[u"t"], prop[u"D"], x), u"\n"

        print u"enthal"
        print rp.enthal(prop[u"t"], prop[u"D"], x), u"\n"

        print u"ag"
        print rp.ag(prop[u"t"], prop[u"D"], x), u"\n"

        print u"cvcp"
        print rp.cvcp(prop[u"t"], prop[u"D"], x), u"\n"

        print u"dddp"
        print rp.dddp(prop[u"t"], prop[u"D"], x), u"\n"

        print u"dddt"
        print rp.dddt(prop[u"t"], prop[u"D"], x), u"\n"

        print u"dhd1"
        print rp.dhd1(prop[u"t"], prop[u"D"], x), u"\n"

        print u"dpdd"
        print rp.dpdd(prop[u"t"], prop[u"D"], x), u"\n"

        print u"dpdd2"
        print rp.dpdd2(prop[u"t"], prop[u"D"], x), u"\n"

        print u"dpdt"
        print rp.dpdt(prop[u"t"], prop[u"D"], x), u"\n"

        D = prop[u"D"]

        # function not supported in Windows
        if platform.system() == u"Linux":
            print u"dcdt"
            print rp.dcdt(prop[u"t"], x), u"\n"

        # function not supported in Windows
        if platform.system() == u"Linux":
            print u"dcdt2"
            print rp.dcdt2(prop[u"t"], x), u"\n"

        print u"fgcty"
        print rp.fgcty(prop[u"t"], D, x), u"\n"

        print u"gibbs"
        print rp.gibbs(prop[u"t"], prop[u"D"], x), u"\n"

        # ~ print('fgcty2')
        # ~ print(rp.fgcty2(prop['t'], prop['D'], x), '\n')

        prop = rp.therm3(prop[u"t"], prop[u"D"], x)
        print u"therm3"
        print prop, u"\n"

        D = prop[u"D"]

        print u"virb"
        print rp.virb(prop[u"t"], x), u"\n"

        print u"virc"
        print rp.virc(prop[u"t"], x), u"\n"

        # function not supported in Windows
        if platform.system() == u"Linux":
            print u"vird"
            print rp.vird(prop[u"t"], x), u"\n"

        print u"virba"
        print rp.virba(prop[u"t"], x), u"\n"

        print u"virca"
        print rp.virca(prop[u"t"], x), u"\n"

        print u"cvcpk"
        print rp.cvcpk(1, prop[u"t"], D), u"\n"

        print u"dbdt"
        print rp.dbdt(prop[u"t"], x), u"\n"

        print u"dpddk"
        print rp.dpddk(1, prop[u"t"], D), u"\n"

        print u"dpdtk"
        print rp.dpdtk(2, prop[u"t"], D), u"\n"

        D = 55
        t = 373

        prop = rp.press(t, D, x)
        print u"press"
        print prop, u"\n"

        p = prop[u"p"]

        print u"purefld(1)"
        prop = rp.purefld(1)
        print prop, u"\n"

        x = [1]

        resetup_test_prop_d = prop

        print u"satt"
        prop = rp.satt(t, x)
        print prop, u"\n"

        print u"satp"
        prop = rp.satp(prop[u"p"], x)
        print prop, u"\n"

        print u"satd"
        print rp.satd(prop[u"Dliq"], x), u"\n"

        print u"sath"
        print rp.sath(47000, x, 0), u"\n"

        print u"sate"
        print rp.sate(0.46047e-13, x), u"\n"

        print u"sats"
        print rp.sats(50, x, 0), u"\n"

        print u"purefld(0)"
        print rp.purefld(0), u"\n"

        x = [0.5, 0.3]
        x = rp.normalize(x)[u"x"]

        print u"csatk"
        print rp.csatk(1, t), u"\n"

        print u"dptsatk"
        print rp.dptsatk(1, t), u"\n"

        print u"cv2pk"
        print rp.cv2pk(2, t, D), u"\n"

        print u"tprho"
        print rp.tprho(t, p, x, 2, 1, 58), u"\n"

        print u"flsh, tp"
        prop = rp.flsh(u"tp", t, p, x)
        print prop, u"\n"

        print u"flsh, th"
        print rp.flsh(u"tH", 305, prop[u"h"], x, 1), u"\n"

        print u"flsh, tD"
        print rp.flsh(u"tD", t, 30, x), u"\n"

        print u"info()"
        print rp.info(), u"\n"

        print u"info(2)"
        print rp.info(2), u"\n"

        # unsupported in Windows
        if platform.system() == u"Linux":
            print u"rmix2"
            print rp.rmix2(x), u"\n"

        print u"xmass"
        prop = rp.xmass(x)
        print prop, u"\n"

        print u"xmole"
        print rp.xmole(prop[u"xkg"]), u"\n"

        print u"limitx"
        print rp.limitx(x, u"eos", t, D, p), u"\n"

        print u"limitk"
        print rp.limitk(u"eos", 1, t, D, p), u"\n"

        print u"limits"
        print rp.limits(x), u"\n"

        print u"flsh, ts"
        prop = rp.flsh(u"ts", t, 40, x)
        print prop, u"\n"

        print u"flsh, te"
        print rp.flsh(u"te", t, prop[u"e"], x), u"\n"

        print u"flsh, pD"
        prop = rp.flsh(u"Pd", p, D, x)
        print prop, u"\n"

        print u"flsh, ph"
        prop = rp.flsh(u"ph", p, prop[u"h"], x)
        print prop, u"\n"

        print u"flsh, ps"
        prop = rp.flsh(u"ps", p, prop[u"s"], x)
        print prop, u"\n"

        print u"flsh, pe"
        prop = rp.flsh(u"pE", p, prop[u"e"], x)
        print prop, u"\n"

        print u"flsh, es"
        prop = rp.flsh(u"es", prop[u"e"], prop[u"s"], x)
        print prop, u"\n"

        print u"flsh, hs"
        prop = rp.flsh(u"hs", 40000, 100, x)
        print prop, u"\n"

        print u"flsh, es"
        print rp.flsh(u"es", 175, 13, x), u"\n"

        print u"flsh, Dh"
        print rp.flsh(u"DH", 20, 18000, x), u"\n"

        print u"flsh, Ds"
        prop = rp.flsh(u"Ds", 20, 50, x)
        print prop, u"\n"

        print u"flsh, De"
        prop = rp.flsh(u"DE", 20, prop[u"e"], x)
        print prop, u"\n"

        print u"flsh, tq"
        prop = rp.flsh(u"tq", t, prop[u"q"], x)
        print prop, u"\n"

        print u"flsh, pq"
        print rp.flsh(u"pq", 1200, prop[u"q"], x), u"\n"

        prop = rp.flsh(u"tp", 350, 1200, x)
        print u"flsh, tp"
        print prop, u"\n"
        s = prop[u"s"]
        e = prop[u"e"]
        h = prop[u"h"]
        D = prop[u"D"]
        t = prop[u"t"]
        p = prop[u"p"]
        Dmin = 40
        Dmax = 55

        print u"flsh1, liq, ph"
        print rp.flsh1(u"Ph", p, h, x, 1), u"\n"

        print u"getphase"
        print rp.getphase(prop), u"\n"

        print u"flsh1, liq, pD"
        print rp.flsh1(u"PD", p, D, x), u"\n"

        print u"flsh1, liq, ps"
        print rp.flsh1(u"Ps", p, s, x), u"\n"

        # unsupported in Windows
        if platform.system() == u"Linux":
            print u"flsh1, liq, th"
            print rp.flsh1(u"th", t, h, x, Dmin=Dmin, Dmax=Dmax), u"\n"

        # unsupported in Windows
        if platform.system() == u"Linux":
            print u"flsh1, liq, ts"
            print rp.flsh1(u"ts", t, s, x, Dmin=Dmin, Dmax=Dmax), u"\n"

        # unsupported in Windows
        if platform.system() == u"Linux":
            print u"flsh1, liq, te"
            print rp.flsh1(u"te", t, e, x, Dmin=Dmin, Dmax=Dmax), u"\n"

        # unsupported in Windows
        if platform.system() == u"Linux":
            print u"flsh1, liq, pe"
            print rp.flsh1(u"Pe", p, e, x), u"\n"

        # unsupported in Windows
        if platform.system() == u"Linux":
            print u"flsh1, liq, hs"
            print rp.flsh1(u"hs", h, s, x, Dmin=Dmin, Dmax=Dmax), u"\n"

        # unsupported in Windows
        if platform.system() == u"Linux":
            print u"flsh1, liq, Dh"
            print rp.flsh1(u"Dh", D, h, x), u"\n"

        # unsupported in Windows
        if platform.system() == u"Linux":
            print u"flsh1, liq, Ds"
            print rp.flsh1(u"Ds", D, s, x), u"\n"

        # unsupported in Windows
        if platform.system() == u"Linux":
            print u"flsh1, liq, De"
            print rp.flsh1(u"De", D, e, x), u"\n"

        prop = rp.flsh(u"tp", 400, 100, x)
        s = prop[u"s"]
        e = prop[u"e"]
        h = prop[u"h"]
        D = prop[u"D"]
        Dmin = 0.01
        Dmax = 0.05
        t = prop[u"t"]
        p = prop[u"p"]

        print u"flsh1, vap, ph"
        print rp.flsh1(u"Ph", p, h, x, 2), u"\n"

        print u"getphase"
        print rp.getphase(prop), u"\n"

        print u"flsh1, vap, pD"
        print rp.flsh1(u"PD", p, D, x, 2), u"\n"

        print u"flsh1, vap, ps"
        print rp.flsh1(u"Ps", p, s, x, 2), u"\n"

        # unsupported in Windows
        if platform.system() == u"Linux":
            print u"flsh1, vap, th"
            print rp.flsh1(u"th", t, h, x, Dmin=Dmin, Dmax=Dmax), u"\n"

        # unsupported in Windows
        if platform.system() == u"Linux":
            print u"flsh1, vap, ts"
            print rp.flsh1(u"ts", t, s, x, Dmin=Dmin, Dmax=Dmax), u"\n"

        # unsupported in Windows
        if platform.system() == u"Linux":
            print u"flsh1, vap, te"
            print rp.flsh1(u"te", t, e, x, Dmin=Dmin, Dmax=Dmax), u"\n"

        # unsupported in Windows
        if platform.system() == u"Linux":
            print u"flsh1, vap, pe"
            print rp.flsh1(u"Pe", p, e, x, 2), u"\n"

        # unsupported in Windows
        if platform.system() == u"Linux":
            print u"flsh1, vap, hs"
            print rp.flsh1(u"hs", h, s, x, Dmin=Dmin, Dmax=Dmax), u"\n"

        # unsupported in Windows
        if platform.system() == u"Linux":
            print u"flsh1, vap, Dh"
            print rp.flsh1(u"Dh", D, h, x), u"\n"

        # unsupported in Windows
        if platform.system() == u"Linux":
            print u"flsh1, vap, Ds"
            print rp.flsh1(u"Ds", D, s, x), u"\n"

        # unsupported in Windows
        if platform.system() == u"Linux":
            print u"flsh1, vap, De"
            print rp.flsh1(u"De", D, e, x), u"\n"

        print u"cstar"
        print rp.cstar(t, p, 8, x), u"\n"

        print u"fpv"
        print rp.fpv(t, D, p, x), u"\n"

        # function not supported in Windows
        if platform.system() == u"Linux":
            print u"excess"
            print rp.excess(t, p, x, kph=2), u"\n"

        prop = rp.flsh(u"pq", 1200, 0.65, x)
        D = prop[u"D"]
        Dliq = prop[u"Dliq"]
        Dvap = prop[u"Dvap"]
        xliq = prop[u"xliq"]
        xvap = prop[u"xvap"]
        e = prop[u"e"]
        h = prop[u"h"]
        s = prop[u"s"]
        q = prop[u"q"]
        p = prop[u"p"]
        t = prop[u"t"]

        # function not supported in Windows
        if platform.system() == u"Linux":
            print u"tpfl2"
            print rp.flsh2(u"tp", t, p, x), u"\n"

        # function not supported in Windows
        if platform.system() == u"Linux":
            print u"Dhfl2"
            print rp.flsh2(u"Dh", D, h, x), u"\n"

        # function not supported in Windows
        if platform.system() == u"Linux":
            print u"Dsfl2"
            print rp.flsh2(u"Ds", D, s, x), u"\n"

        # function not supported in Windows
        if platform.system() == u"Linux":
            print u"Defl2"
            print rp.flsh2(u"De", D, e, x), u"\n"

        # function not supported in Windows
        if platform.system() == u"Linux":
            print u"thfl2"
            print rp.flsh2(u"th", t, h, x, ksat=0), u"\n"

        # function not supported in Windows
        if platform.system() == u"Linux":
            print u"tsfl2"
            print rp.flsh2(u"ts", t, s, x, ksat=0), u"\n"

        # function not supported in Windows
        if platform.system() == u"Linux":
            print u"tefl2"
            print rp.flsh2(u"te", t, e, x, ksat=0), u"\n"

        # function not supported in Windows
        if platform.system() == u"Linux":
            print u"tDfl2"
            print rp.flsh2(u"tD", t, D, x, ksat=0), u"\n"

        # function not supported in Windows
        if platform.system() == u"Linux":
            print u"pDfl2"
            print rp.flsh2(u"pD", p, D, x, ksat=0), u"\n"

        # function not supported in Windows
        if platform.system() == u"Linux":
            print u"phfl2"
            print rp.flsh2(u"ph", p, h, x, ksat=0), u"\n"

        # function not supported in Windows
        if platform.system() == u"Linux":
            print u"psfl2"
            print rp.flsh2(u"ps", p, s, x, ksat=0), u"\n"

        # function not supported in Windows
        if platform.system() == u"Linux":
            print u"pefl2"
            print rp.flsh2(u"pe", p, e, x, ksat=0), u"\n"

        # function not supported in Windows
        if platform.system() == u"Linux":
            print u"tqfl2"
            print rp.flsh2(u"tq", t, q, x, ksat=0), u"\n"

        # function not supported in Windows
        if platform.system() == u"Linux":
            print u"pqfl2"
            print rp.flsh2(u"pq", p, q, x, ksat=0), u"\n"

        # function not supported in Windows
        # ~ if platform.system() == 'Linux':
        # ~ print('Dqfl2')
        # ~ print(rp.flsh2('Dq', D, q, x), '\n')

        prop = rp.flsh(u"tp", 340, 100, x)
        t = prop[u"t"]
        Dliq = prop[u"Dliq"]
        Dvap = prop[u"Dvap"]
        xliq = prop[u"xliq"]
        xvap = prop[u"xvap"]

        print u"qmass"
        prop = rp.qmass(prop[u"q"], xliq, xvap)
        print prop, u"\n"

        print u"qmole"
        print rp.qmole(prop[u"qkg"], prop[u"xlkg"], prop[u"xvkg"]), u"\n"

        print u"wmol"
        print rp.wmol(x), u"\n"

        prop = rp.flsh(u"tp", 340, 100, x)

        print u"dielec"
        print rp.dielec(prop[u"t"], prop[u"D"], x), u"\n"

        print u"surten"
        print rp.surten(t, Dliq, Dvap, xliq, xvap), u"\n"

        print u"surft"
        print rp.surft(240, x), u"\n"

        rp.setup(u"def", u"water")

        print u"meltt"
        print rp.meltt(273.15, [1]), u"\n"

        print u"meltp"
        print rp.meltp(100, [1]), u"\n"

        print u"sublt"
        print rp.sublt(273.15, [1]), u"\n"

        print u"sublp"
        print rp.sublp(0.1, [1]), u"\n"

        rp.setup(u"def", u"butane", u"ethane", u"propane", u"methane")
        x = [0.5, 0.15, 0.3, 0.05]
        rp.setref(u"nbp")
        prop = rp.flsh(u"tp", 260, 150, x)
        D = prop[u"D"]
        print u"trnprp, setref"
        print rp.trnprp(260, D, x), u"\n"

        print u"B12"
        print rp.b12(260, x), u"\n"

        print u"chempot"
        print rp.chempot(260, D, x), u"\n"

        print u"fugcof"
        print rp.fugcof(260, D, x), u"\n"

        ###function not supported in Windows
        # if platform.system() == 'Linux': input values changed..............................
        # print('phiderv')
        # print(rp.phiderv(2, 1, 260, D, x), '\n')

        # function not supported in Windows
        if platform.system() == u"Linux":
            print u"getmod"
            print rp.getmod(1, u"EOS"), u"\n"

        rp.setmod(u"tcx", u"ecs", [u"tc2", u"tc1", u"tc2", u"tc2"])
        rp.setup(u"def", u"butane", u"ethane", u"propane", u"methane")
        x = [0.5, 0.15, 0.3, 0.05]
        prop = rp.flsh(u"tp", 260, 200, x)
        print u"trnprp, setref NBP, setmod [tcx, ecs, tc2, tc1, tc2, tc2]"
        print rp.trnprp(260, prop[u"D"], x), u"\n"

        # function not supported in Windows
        if platform.system() == u"Linux":
            print u"getmod"
            print rp.getmod(3, u"tcx"), u"\n"

        rp.setref(u"oth", 1, [1], 0, 0, 273, 100)
        print u"setref = OTH"
        prop = rp.flsh(u"tp", 260, 200, x)
        print prop, u"\n"

        resetup_test_prop_a = prop

        rp.setref(u"???", 1, [1], 0, 0, 373, 100)
        print u"setref = ???"
        prop = rp.flsh(u"tp", 260, 200, x)
        print prop, u"\n"

        resetup_test_prop_b = prop

        print u"name"
        print rp.name(1), u"\n"

        rp.setup(u"def", u"butane", u"ethane", u"propane", u"methane")
        x = [0.5, 0.15, 0.3, 0.05]
        print u"getktv"
        prop = rp.getktv(1, 3)
        print prop, u"\n"

        print u"setktv"
        prop = rp.setktv(1, 3, u"lin", prop[u"fij"], prop[u"hfmix"])
        print prop, u"\n"

        resetup_test_prop_c = prop

        print u"reset setktv"
        print rp.setktv(1, 2, u"rst"), u"\n"

        print u"getfij"
        print rp.getfij(u"LIN"), u"\n"

        print u"resetup_test_prop, setref, setmod"
        print resetup_test_prop_a, u"\n"

        print u"resetup"
        print rp.resetup(resetup_test_prop_a), u"\n"

        print u"resetup_test_prop, setref(???), setmod"
        print resetup_test_prop_b, u"\n"

        print u"resetup"
        print rp.resetup(resetup_test_prop_b), u"\n"

        print u"resetup_test_prop, setktv"
        print resetup_test_prop_c, u"\n"

        print u"resetup"
        print rp.resetup(resetup_test_prop_c), u"\n"

        print u"resetup_test_prop, purefld"
        print resetup_test_prop_d, u"\n"

        print u"resetup"
        print rp.resetup(resetup_test_prop_d), u"\n"

        # normalize([0.2, 0.2, 0.1, 0.1])
        print u"normalize"
        print rp.normalize([0.2, 0.2, 0.1, 0.1]), u"\n"

        # setup_details
        print u"setup_details"
        print rp.setup_details(
            {
                u"hfld": [u"BUTANE", u"ETHANE", u"PROPANE", u"METHANE"],
                u"D": 0.21683907260570098,
                u"Dvap": 0.09664613429889905,
                u"hfmix": u"HMX.BNC",
                u"setmod": {u"hcomp": [u"TC2", u"TC1", u"TC2", u"TC2"], u"htype": u"TCX", u"hmix": u"ECS"},
                u"cp": -9999980.0,
                u"xliq": [
                    Decimal(u"0.7125650648765283717349528049"),
                    Decimal(u"0.04065955068790887177072495080"),
                    Decimal(u"0.2449672538076863186375885862"),
                    Decimal(u"0.001808130627876437856733658079"),
                ],
                u"xvap": [
                    Decimal(u"0.2304027911956556081031262882"),
                    Decimal(u"0.2886769748808782463382744488"),
                    Decimal(u"0.3697982730402927396744896960"),
                    Decimal(u"0.1111219608831734058841095670"),
                ],
                u"x": [0.5, 0.15, 0.3, 0.05],
                u"e": -13828.39837781548,
                u"h": -12906.055381248256,
                u"nc": 4,
                u"Dliq": 11.150114864150222,
                u"cv": -9999980.0,
                u"q": 0.4408579356823604,
                u"p": 200.0,
                u"s": -44.047682476988044,
                u"t": 260.0,
                u"w": -9999980.0,
                u"kph": 1,
                u"setref": {u"p0": 100, u"ixflag": 1, u"h0": 0, u"s0": 0, u"t0": 273, u"hrf": [u"OTH", u"???"]},
                u"hrf": u"DEF",
            }
        ), u"\n"

        # gerg04
        print u"gerg04 = 1"
        rp.gerg04(1)
        print rp.setup(u"def", u"butane", u"ethane", u"propane"), u"\n"

        # reset gerg04
        print u"gerg04 = 0"
        rp.gerg04(0)
        print rp.setup(u"def", u"butane", u"ethane", u"propane"), u"\n"

        # preos
        print u"preos = 2"
        print rp.preos(2), u"\n"

        print u"preos = -1"
        print rp.preos(-1), u"\n"

        print u"preos = 0"
        print rp.preos(0), u"\n"

        print u"preos = -1"
        print rp.preos(-1), u"\n"

        # setaga
        print u"setaga"
        print rp.setaga(), u"\n"

        # unsetaga
        print u"unsetaga"
        print rp.unsetaga(), u"\n"

        # setup_settings
        print u"setup_setting"
        print rp.setup_setting(), u"\n"