Skip to content

Strange caching bug related to the EquateR function somehow #713

@ianhbell

Description

@ianhbell

See #710, if the first call to a totally unrelated mixture is made, the error code from the second call differs to when the call is not made

import os 
import ctREFPROP.ctREFPROP as ct 

build_paths = [f for f in os.scandir('RPbuilds') if f.is_dir()]

for f in build_paths:
    if 'f7741' not in f.path: continue
    
    sopath = f.path+'/librefprop.dylib'
    
    if os.path.exists(sopath):
        RP = ct.REFPROPFunctionLibrary(sopath)
        RP.SETPATHdll(f.path)
        res = RP.REFPROPdll("", "FLAGS", "SETREF", 0, 0, 2, 0, 0, [])
        
        r0 = RP.REFPROPdll("R410A.mix", "TD", "DLIQ",RP.MOLAR_SI,0,0,250,10, [])
        SI = RP.GETENUMdll(1, "SI").iEnum
        r = RP.REFPROPdll("hexane;butane|.6;.4 mass", "DE", "P", SI, 0, 0, 600, -120.0, [])
        print(f.path, r.Output[0], r.ierr, r.herr)

yielding

RPbuilds/1734381729_f77418786d9dcca3ebab1b385de41ee94f5efec3 174.8462616496163 -5 [DEFLSH warning -5] One or more inputs are out of range; Temperature above upper limit: T = 597.056 K, Tmax = 589.941 K; Pressure above upper limit: P = 174.846 MPa, Pmax = 149.709 MPa.

but if the R410A line is commented out, you get:

RPbuilds/1734381729_f77418786d9dcca3ebab1b385de41ee94f5efec3 -9999990.0 226 [DEFL2 error 226] 2-phase iteration did not converge.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions