示例#1
0
    def __init__(self):
        CoefficientData.__init__(self)
        PureData.__init__(self)
        self.name = "TCO"
        self.description = "Citrus oil terpene - d-Limonene"
        self.reference = "Melinder2010"

        self.Tmin = -80.0 + 273.15
        self.Tmax = 100.0 + 273.15
        self.TminPsat =  self.Tmax
        self.Tbase = 0.0

        self.density.type = self.density.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.density.coeffs = IncompressibleFitter.shapeArray(np.array([1071.02,-0.778166]))

        self.specific_heat.type = self.specific_heat.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.specific_heat.coeffs = IncompressibleFitter.shapeArray(np.array([223.775,5.2159]))

        self.viscosity.type = self.viscosity.INCOMPRESSIBLE_EXPPOLYNOMIAL
        _,_,self.viscosity.coeffs = IncompressibleFitter.shapeArray(np.array([-3.47971,-0.0107031,1.14086e-06]))

        self.conductivity.type = self.conductivity.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.conductivity.coeffs = IncompressibleFitter.shapeArray(np.array([0000.174156,-1.85052e-04]))

        self.density.source           = self.density.SOURCE_COEFFS
        self.specific_heat.source     = self.specific_heat.SOURCE_COEFFS
        self.conductivity.source      = self.conductivity.SOURCE_COEFFS
        self.viscosity.source         = self.viscosity.SOURCE_COEFFS
示例#2
0
    def __init__(self):
        CoefficientData.__init__(self)
        PureData.__init__(self)
        self.name = "SAB"
        self.description = "Synthetic alkyl benzene - Marlotherm X"
        self.reference = "Melinder2010"

        self.Tmin = -80.0 + 273.15
        self.Tmax = 100.0 + 273.15
        self.TminPsat =  self.Tmax
        self.Tbase = 0.0

        self.density.type = self.density.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.density.coeffs = IncompressibleFitter.shapeArray(np.array([1102.34,-0.801667]))

        self.specific_heat.type = self.specific_heat.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.specific_heat.coeffs = IncompressibleFitter.shapeArray(np.array([1360.94,1.51667]))

        self.viscosity.type = self.viscosity.INCOMPRESSIBLE_EXPPOLYNOMIAL
        _,_,self.viscosity.coeffs = IncompressibleFitter.shapeArray(np.array([5.21288,-0.0665792,8.5066e-05]))

        self.conductivity.type = self.conductivity.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.conductivity.coeffs = IncompressibleFitter.shapeArray(np.array([0000.208374,-2.61667e-04]))

        self.density.source           = self.density.SOURCE_COEFFS
        self.specific_heat.source     = self.specific_heat.SOURCE_COEFFS
        self.conductivity.source      = self.conductivity.SOURCE_COEFFS
        self.viscosity.source         = self.viscosity.SOURCE_COEFFS
示例#3
0
    def __init__(self):
        CoefficientData.__init__(self)
        PureData.__init__(self)
        self.name = "HCB"
        self.description = "Hydrocarbon blend - Dynalene MV"
        self.reference = "Melinder2010"

        self.Tmin = -80.0 + 273.15
        self.Tmax = 100.0 + 273.15
        self.TminPsat =  self.Tmax
        self.Tbase = 0.0

        self.density.type = self.density.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.density.coeffs = IncompressibleFitter.shapeArray(np.array([1071.78,-0.772024]))

        self.specific_heat.type = self.specific_heat.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.specific_heat.coeffs = IncompressibleFitter.shapeArray(np.array([761.393,3.52976]))

        self.viscosity.type = self.viscosity.INCOMPRESSIBLE_EXPPOLYNOMIAL
        _,_,self.viscosity.coeffs = IncompressibleFitter.shapeArray(np.array([7.16819,-0.0863212,0.000130604]))

        self.conductivity.type = self.conductivity.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.conductivity.coeffs = IncompressibleFitter.shapeArray(np.array([0000.203186,-2.3869e-04]))

        self.density.source           = self.density.SOURCE_COEFFS
        self.specific_heat.source     = self.specific_heat.SOURCE_COEFFS
        self.conductivity.source      = self.conductivity.SOURCE_COEFFS
        self.viscosity.source         = self.viscosity.SOURCE_COEFFS
示例#4
0
    def __init__(self):
        CoefficientData.__init__(self)
        PureData.__init__(self)
        self.name = "PMS2"
        self.description = "Polydimethylsiloxan 2 - Syltherm XLT"
        self.reference = "Melinder2010"

        self.Tmin = -80.0 + 273.15
        self.Tmax = 100.0 + 273.15
        self.TminPsat =  self.Tmax
        self.Tbase = 0.0

        self.density.type = self.density.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.density.coeffs = IncompressibleFitter.shapeArray(np.array([1155.94,-1.02576]))

        self.specific_heat.type = self.specific_heat.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.specific_heat.coeffs = IncompressibleFitter.shapeArray(np.array([1153.55,2.10788]))

        self.viscosity.type = self.viscosity.INCOMPRESSIBLE_EXPPOLYNOMIAL
        _,_,self.viscosity.coeffs = IncompressibleFitter.shapeArray(np.array([5.66926,-0.065582,8.09988e-05]))

        self.conductivity.type = self.conductivity.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.conductivity.coeffs = IncompressibleFitter.shapeArray(np.array([0000.172305,-2.11212e-04]))

        self.density.source           = self.density.SOURCE_COEFFS
        self.specific_heat.source     = self.specific_heat.SOURCE_COEFFS
        self.conductivity.source      = self.conductivity.SOURCE_COEFFS
        self.viscosity.source         = self.viscosity.SOURCE_COEFFS
示例#5
0
    def __init__(self):
        CoefficientData.__init__(self)
        PureData.__init__(self)
        self.name = "PMS1"
        self.description = "Polydimethylsiloxan 1 - Baysilone KT3"
        self.reference = "Melinder2010"

        self.Tmin = -80.0 + 273.15
        self.Tmax = 100.0 + 273.15
        self.TminPsat =  self.Tmax
        self.Tbase = 0.0

        self.density.type = self.density.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.density.coeffs = IncompressibleFitter.shapeArray(np.array([1172.35,-0.9025]))

        self.specific_heat.type = self.specific_heat.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.specific_heat.coeffs = IncompressibleFitter.shapeArray(np.array([1223.69,1.48417]))

        self.viscosity.type = self.viscosity.INCOMPRESSIBLE_EXPPOLYNOMIAL
        _,_,self.viscosity.coeffs = IncompressibleFitter.shapeArray(np.array([6.36183,-0.0636352,7.51428e-05]))

        self.conductivity.type = self.conductivity.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.conductivity.coeffs = IncompressibleFitter.shapeArray(np.array([0000.207526,-2.84167e-04]))

        self.density.source           = self.density.SOURCE_COEFFS
        self.specific_heat.source     = self.specific_heat.SOURCE_COEFFS
        self.conductivity.source      = self.conductivity.SOURCE_COEFFS
        self.viscosity.source         = self.viscosity.SOURCE_COEFFS
示例#6
0
    def __init__(self):
        CoefficientData.__init__(self)
        PureData.__init__(self)
        self.name = "DEB"
        self.description = "Diethylbenzene mixture - Dowtherm J"
        self.reference = "Melinder2010"

        self.Tmin = -80.0 + 273.15
        self.Tmax = 100.0 + 273.15
        self.TminPsat =  self.Tmax
        self.Tbase = 0.0

        self.density.type = self.density.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.density.coeffs = IncompressibleFitter.shapeArray(np.array([1076.5,-0.731182]))

        self.specific_heat.type = self.specific_heat.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.specific_heat.coeffs = IncompressibleFitter.shapeArray(np.array([999.729,2.87576]))

        self.viscosity.type = self.viscosity.INCOMPRESSIBLE_EXPPOLYNOMIAL
        _,_,self.viscosity.coeffs = IncompressibleFitter.shapeArray(np.array([3.5503,-0.0566396,7.03331e-05]))

        self.conductivity.type = self.conductivity.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.conductivity.coeffs = IncompressibleFitter.shapeArray(np.array([0000.189132,-2.06364e-04]))

        self.density.source           = self.density.SOURCE_COEFFS
        self.specific_heat.source     = self.specific_heat.SOURCE_COEFFS
        self.conductivity.source      = self.conductivity.SOURCE_COEFFS
        self.viscosity.source         = self.viscosity.SOURCE_COEFFS
示例#7
0
    def __init__(self):
        CoefficientData.__init__(self)
        PureData.__init__(self)
        self.name = "HCM"
        self.description = "Hydrocarbon mixture - Gilotherm D12"
        self.reference = "Melinder2010"

        self.Tmin = -80.0 + 273.15
        self.Tmax = 100.0 + 273.15
        self.TminPsat =  self.Tmax
        self.Tbase = 0.0

        self.density.type = self.density.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.density.coeffs = IncompressibleFitter.shapeArray(np.array([971.725,-0.718788]))

        self.specific_heat.type = self.specific_heat.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.specific_heat.coeffs = IncompressibleFitter.shapeArray(np.array([844.023,4.31212]))

        self.viscosity.type = self.viscosity.INCOMPRESSIBLE_EXPPOLYNOMIAL
        _,_,self.viscosity.coeffs = IncompressibleFitter.shapeArray(np.array([18.3237,-0.14706,0.000209096]))

        self.conductivity.type = self.conductivity.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.conductivity.coeffs = IncompressibleFitter.shapeArray(np.array([0000.153716,-1.51212e-04]))

        self.density.source           = self.density.SOURCE_COEFFS
        self.specific_heat.source     = self.specific_heat.SOURCE_COEFFS
        self.conductivity.source      = self.conductivity.SOURCE_COEFFS
        self.viscosity.source         = self.viscosity.SOURCE_COEFFS
示例#8
0
    def __init__(self):
        CoefficientData.__init__(self)
        PureData.__init__(self)
        self.name = "HFE"
        self.description = "Hydrofluoroether - HFE-7100 3M Novec"
        self.reference = "Melinder2010"

        self.Tmin = -80.0 + 273.15
        self.Tmax = 100.0 + 273.15
        self.TminPsat =  self.Tmax
        self.Tbase = 0.0

        self.density.type = self.density.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.density.coeffs = IncompressibleFitter.shapeArray(np.array([1822.37,-0.918485]))

        self.specific_heat.type = self.specific_heat.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.specific_heat.coeffs = IncompressibleFitter.shapeArray(np.array([871.834,0.858788]))

        self.viscosity.type = self.viscosity.INCOMPRESSIBLE_EXPPOLYNOMIAL
        _,_,self.viscosity.coeffs = IncompressibleFitter.shapeArray(np.array([-4.22878,-0.0114765,7.39823e-06]))

        self.conductivity.type = self.conductivity.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.conductivity.coeffs = IncompressibleFitter.shapeArray(np.array([9.92958e-01,-8.33333e-05]))

        self.density.source           = self.density.SOURCE_COEFFS
        self.specific_heat.source     = self.specific_heat.SOURCE_COEFFS
        self.conductivity.source      = self.conductivity.SOURCE_COEFFS
        self.viscosity.source         = self.viscosity.SOURCE_COEFFS
    def __init__(self):
        CoefficientData.__init__(self) 
        PureData.__init__(self) 
        self.name = "HFE"
        self.description = "Hydrofluoroether - HFE-7100 3M Novec"
        self.reference = "Melinder-BOOK-2010"

        self.Tmin = -80.0 + 273.15
        self.Tmax = 100.0 + 273.15
        self.TminPsat =  self.Tmax

        self.density.type = self.density.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.density.coeffs = IncompressibleFitter.shapeArray(np.array([1822.37,-0.918485]))

        self.specific_heat.type = self.specific_heat.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.specific_heat.coeffs = IncompressibleFitter.shapeArray(np.array([871.834,0.858788]))

        self.viscosity.type = self.viscosity.INCOMPRESSIBLE_EXPPOLYNOMIAL
        _,_,self.viscosity.coeffs = IncompressibleFitter.shapeArray(np.array([-4.22878,-0.0114765,7.39823e-06]))

        self.conductivity.type = self.conductivity.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.conductivity.coeffs = IncompressibleFitter.shapeArray(np.array([9.92958e-05,-8.33333e-08]))
        
        self.density.source           = self.density.SOURCE_COEFFS
        self.specific_heat.source     = self.specific_heat.SOURCE_COEFFS
        self.conductivity.source      = self.conductivity.SOURCE_COEFFS
        self.viscosity.source         = self.viscosity.SOURCE_COEFFS
    def __init__(self):
        CoefficientData.__init__(self) 
        PureData.__init__(self) 
        self.name = "HCM"
        self.description = "Hydrocarbon mixture (synthetic) - Therminol D12 (Gilotherm D12) Solutia"
        self.reference = "Melinder-BOOK-2010"

        self.Tmin = -80.0 + 273.15
        self.Tmax = 100.0 + 273.15
        self.TminPsat =  self.Tmax

        self.density.type = self.density.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.density.coeffs = IncompressibleFitter.shapeArray(np.array([971.725,-0.718788]))

        self.specific_heat.type = self.specific_heat.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.specific_heat.coeffs = IncompressibleFitter.shapeArray(np.array([844.023,4.31212]))

        self.viscosity.type = self.viscosity.INCOMPRESSIBLE_EXPPOLYNOMIAL
        _,_,self.viscosity.coeffs = IncompressibleFitter.shapeArray(np.array([18.3237,-0.14706,0.000209096]))

        self.conductivity.type = self.conductivity.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.conductivity.coeffs = IncompressibleFitter.shapeArray(np.array([0.000153716,-1.51212e-07]))
        
        self.density.source           = self.density.SOURCE_COEFFS
        self.specific_heat.source     = self.specific_heat.SOURCE_COEFFS
        self.conductivity.source      = self.conductivity.SOURCE_COEFFS
        self.viscosity.source         = self.viscosity.SOURCE_COEFFS
    def __init__(self):
        CoefficientData.__init__(self)
        PureData.__init__(self) 
        self.name = "DEB"
        self.description = "Diethylbenzene mixture - Dowtherm J Dow Chemical Co."
        self.reference = "Melinder-BOOK-2010"

        self.Tmin = -80.0 + 273.15
        self.Tmax = 100.0 + 273.15
        self.TminPsat =  self.Tmax

        self.density.type = self.density.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.density.coeffs = IncompressibleFitter.shapeArray(np.array([1076.5,-0.731182]))

        self.specific_heat.type = self.specific_heat.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.specific_heat.coeffs = IncompressibleFitter.shapeArray(np.array([999.729,2.87576]))

        self.viscosity.type = self.viscosity.INCOMPRESSIBLE_EXPPOLYNOMIAL
        _,_,self.viscosity.coeffs = IncompressibleFitter.shapeArray(np.array([3.5503,-0.0566396,7.03331e-05]))

        self.conductivity.type = self.conductivity.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.conductivity.coeffs = IncompressibleFitter.shapeArray(np.array([0.000189132,-2.06364e-07]))
        
        self.density.source           = self.density.SOURCE_COEFFS
        self.specific_heat.source     = self.specific_heat.SOURCE_COEFFS
        self.conductivity.source      = self.conductivity.SOURCE_COEFFS
        self.viscosity.source         = self.viscosity.SOURCE_COEFFS
    def __init__(self):
        CoefficientData.__init__(self) 
        PureData.__init__(self) 
        self.name = "HCB"
        self.description = "Hydrocarbon blend - Dynalene MV"
        self.reference = "Melinder-BOOK-2010"

        self.Tmin = -80.0 + 273.15
        self.Tmax = 100.0 + 273.15
        self.TminPsat =  self.Tmax

        self.density.type = self.density.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.density.coeffs = IncompressibleFitter.shapeArray(np.array([1071.78,-0.772024]))

        self.specific_heat.type = self.specific_heat.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.specific_heat.coeffs = IncompressibleFitter.shapeArray(np.array([761.393,3.52976]))

        self.viscosity.type = self.viscosity.INCOMPRESSIBLE_EXPPOLYNOMIAL
        _,_,self.viscosity.coeffs = IncompressibleFitter.shapeArray(np.array([7.16819,-0.0863212,0.000130604]))

        self.conductivity.type = self.conductivity.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.conductivity.coeffs = IncompressibleFitter.shapeArray(np.array([0.000203186,-2.3869e-07]))
        
        self.density.source           = self.density.SOURCE_COEFFS
        self.specific_heat.source     = self.specific_heat.SOURCE_COEFFS
        self.conductivity.source      = self.conductivity.SOURCE_COEFFS
        self.viscosity.source         = self.viscosity.SOURCE_COEFFS
    def __init__(self):
        CoefficientData.__init__(self) 
        PureData.__init__(self) 
        self.name = "TCO"
        self.description = "Terpene from citrus oils - d-Limonene"
        self.reference = "Melinder-BOOK-2010"

        self.Tmin = -80.0 + 273.15
        self.Tmax = 100.0 + 273.15
        self.TminPsat =  self.Tmax

        self.density.type = self.density.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.density.coeffs = IncompressibleFitter.shapeArray(np.array([1071.02,-0.778166]))

        self.specific_heat.type = self.specific_heat.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.specific_heat.coeffs = IncompressibleFitter.shapeArray(np.array([223.775,5.2159]))

        self.viscosity.type = self.viscosity.INCOMPRESSIBLE_EXPPOLYNOMIAL
        _,_,self.viscosity.coeffs = IncompressibleFitter.shapeArray(np.array([-3.47971,-0.0107031,1.14086e-06]))

        self.conductivity.type = self.conductivity.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.conductivity.coeffs = IncompressibleFitter.shapeArray(np.array([0.000174156,-1.85052e-07]))
        
        self.density.source           = self.density.SOURCE_COEFFS
        self.specific_heat.source     = self.specific_heat.SOURCE_COEFFS
        self.conductivity.source      = self.conductivity.SOURCE_COEFFS
        self.viscosity.source         = self.viscosity.SOURCE_COEFFS
    def __init__(self):
        CoefficientData.__init__(self) 
        PureData.__init__(self) 
        self.name = "SAB"
        self.description = "Synthetic alkyl benzene - Marlotherm X"
        self.reference = "Melinder-BOOK-2010"

        self.Tmin = -80.0 + 273.15
        self.Tmax = 100.0 + 273.15
        self.TminPsat =  self.Tmax

        self.density.type = self.density.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.density.coeffs = IncompressibleFitter.shapeArray(np.array([1102.34,-0.801667]))

        self.specific_heat.type = self.specific_heat.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.specific_heat.coeffs = IncompressibleFitter.shapeArray(np.array([1360.94,1.51667]))

        self.viscosity.type = self.viscosity.INCOMPRESSIBLE_EXPPOLYNOMIAL
        _,_,self.viscosity.coeffs = IncompressibleFitter.shapeArray(np.array([5.21288,-0.0665792,8.5066e-05]))

        self.conductivity.type = self.conductivity.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.conductivity.coeffs = IncompressibleFitter.shapeArray(np.array([0.000208374,-2.61667e-07]))
        
        self.density.source           = self.density.SOURCE_COEFFS
        self.specific_heat.source     = self.specific_heat.SOURCE_COEFFS
        self.conductivity.source      = self.conductivity.SOURCE_COEFFS
        self.viscosity.source         = self.viscosity.SOURCE_COEFFS
    def __init__(self):
        CoefficientData.__init__(self) 
        PureData.__init__(self) 
        self.name = "PMS2"
        self.description = "Polydimethylsiloxan 2. - Syltherm XLT Dow Corning Co."
        self.reference = "Melinder-BOOK-2010"

        self.Tmin = -80.0 + 273.15
        self.Tmax = 100.0 + 273.15
        self.TminPsat =  self.Tmax

        self.density.type = self.density.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.density.coeffs = IncompressibleFitter.shapeArray(np.array([1155.94,-1.02576]))

        self.specific_heat.type = self.specific_heat.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.specific_heat.coeffs = IncompressibleFitter.shapeArray(np.array([1153.55,2.10788]))

        self.viscosity.type = self.viscosity.INCOMPRESSIBLE_EXPPOLYNOMIAL
        _,_,self.viscosity.coeffs = IncompressibleFitter.shapeArray(np.array([5.66926,-0.065582,8.09988e-05]))

        self.conductivity.type = self.conductivity.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.conductivity.coeffs = IncompressibleFitter.shapeArray(np.array([0.000172305,-2.11212e-07]))
        
        self.density.source           = self.density.SOURCE_COEFFS
        self.specific_heat.source     = self.specific_heat.SOURCE_COEFFS
        self.conductivity.source      = self.conductivity.SOURCE_COEFFS
        self.viscosity.source         = self.viscosity.SOURCE_COEFFS
    def __init__(self):
        CoefficientData.__init__(self) 
        PureData.__init__(self) 
        self.name = "PMS1"
        self.description = "Polydimethylsiloxan 1. - Baysilone KT3"
        self.reference = "Melinder-BOOK-2010"

        self.Tmin = -80.0 + 273.15
        self.Tmax = 100.0 + 273.15
        self.TminPsat =  self.Tmax

        self.density.type = self.density.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.density.coeffs = IncompressibleFitter.shapeArray(np.array([1172.35,-0.9025]))

        self.specific_heat.type = self.specific_heat.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.specific_heat.coeffs = IncompressibleFitter.shapeArray(np.array([1223.69,1.48417]))

        self.viscosity.type = self.viscosity.INCOMPRESSIBLE_EXPPOLYNOMIAL
        _,_,self.viscosity.coeffs = IncompressibleFitter.shapeArray(np.array([6.36183,-0.0636352,7.51428e-05]))

        self.conductivity.type = self.conductivity.INCOMPRESSIBLE_POLYNOMIAL
        _,_,self.conductivity.coeffs = IncompressibleFitter.shapeArray(np.array([0.000207526,-2.84167e-07]))
        
        self.density.source           = self.density.SOURCE_COEFFS
        self.specific_heat.source     = self.specific_heat.SOURCE_COEFFS
        self.conductivity.source      = self.conductivity.SOURCE_COEFFS
        self.viscosity.source         = self.viscosity.SOURCE_COEFFS
示例#17
0
    def getFromFile(self, data):
        fullPath = self.getFile(data)
        # TODO: improve this case
        if not os.path.isfile(fullPath):
            arr = np.empty((1,1))
            arr[:] = np.NAN
            return arr
        r,c,res = IncompressibleFitter.shapeArray(np.loadtxt(fullPath,dtype=type('string')))
#        numbers = res.astype(np.float)
        numbers = np.zeros((r,c))
        for i in range(r):
            for j in range(c):
                nu = np.NAN
                try:
                    nu = np.float(res[i,j])
                    if i==0: nu *= 1e-2 # Percent to fraction
                    if j==0: nu += 273.15 # Celsius to Kelvin
                    if not self.allowNegativeData and nu<0:
                        nu = np.NAN # invalid entries
                except (ValueError, TypeError) as ve:
                    if False: print("Could not convert entry: {0}".format(ve))
                    if i==0: nu = 0.0 # Dummy for tables without concentration (TFreeze and Vol2Mass)
                    pass
                numbers[i,j] = nu
        if numbers[1,0]>numbers[-1,0]:
            numbers[1:,:] = numbers[1:,:][::-1,:]
        if numbers[0,1]>numbers[0,-1]:
            numbers[:,1:] = numbers[:,1:][:,::-1]
        return numbers
示例#18
0
 def round(self, x):
     r,c,res = IncompressibleFitter.shapeArray(x)
     #digits = -1*np.floor(np.log10(res))+self.significantDigits-1
     for i in range(r):
         for j in range(c):
             if np.isfinite(res[i,j]):
                 res[i,j] = self.roundSingle(res[i,j])
     return res
示例#19
0
    def getFromFile(self, data):
        fullPath = self.getFile(data)
        content = np.loadtxt(fullPath,dtype=type('string'),delimiter=",",skiprows=3)
        r,c,res = IncompressibleFitter.shapeArray(content)
#        numbers = res.astype(np.float)
        numbers = np.zeros((r,c))
        for i in range(r):
            for j in range(c):
                nu = np.NAN
                try:
                    nu = np.float(res[i,j])
                    if i==0: nu *= 1e-2 # Percent to fraction
                    if not self.allowNegativeData and nu<0:
                        nu = np.NAN # invalid entries
                except (ValueError, TypeError) as ve:
                    if False: print("Could not convert entry: {0}".format(ve))
                    if i==0: nu = 0.0 # Dummy for tables without concentration (TFreeze and Vol2Mass)
                    pass
                numbers[i,j] = nu
        if numbers[1,0]>numbers[-1,0]: 
            numbers[1:,:] = numbers[1:,:][::-1,:]
        if numbers[0,1]>numbers[0,-1]: 
            numbers[:,1:] = numbers[:,1:][:,::-1]
        return numbers 
示例#20
0
 def getFromFile(self, data):
     fullPath = self.getFile(data)
     _,_,res = IncompressibleFitter.shapeArray(np.loadtxt(fullPath))
     return res
示例#21
0
    def fitFluid(self):
        
        if self.Tbase==None:
            self.Tbase = (self.Tmin + self.Tmax) / 2.0
        if self.xbase==None:
            self.xbase = (self.xmin + self.xmax) / 2.0
        
        std_coeffs = np.zeros((4,6))
        errList    = (ValueError, AttributeError, TypeError, RuntimeError)
        
        try:
            self.density.coeffs = np.copy(std_coeffs)
            self.density.type   = self.density.INCOMPRESSIBLE_POLYNOMIAL
            self.density.fitCoeffs(self.Tbase,self.xbase)
        except errList as ve:
            if self.density.DEBUG: print("{0}: Could not fit polynomial {1} coefficients: {2}".format(self.name,'density',ve))
            pass
        
        try:
            self.specific_heat.coeffs = np.copy(std_coeffs)
            self.specific_heat.type   = self.specific_heat.INCOMPRESSIBLE_POLYNOMIAL
            self.specific_heat.fitCoeffs(self.Tbase,self.xbase)          
        except errList as ve:
            if self.specific_heat.DEBUG: print("{0}: Could not fit polynomial {1} coefficients: {2}".format(self.name,'specific heat',ve))
            pass 
        
        try:
            self.conductivity.coeffs = np.copy(std_coeffs)
            self.conductivity.type   = self.conductivity.INCOMPRESSIBLE_POLYNOMIAL
            self.conductivity.fitCoeffs(self.Tbase,self.xbase)
        except errList as ve:
            if self.conductivity.DEBUG: print("{0}: Could not fit polynomial {1} coefficients: {2}".format(self.name,'conductivity',ve))
            pass
        
#        try:
#            self.viscosity.coeffs = np.copy(std_coeffs)
#            self.viscosity.type   = self.viscosity.INCOMPRESSIBLE_EXPPOLYNOMIAL
#            self.viscosity.fitCoeffs(self.Tbase,self.xbase)
#        except errList as ve:
#            if self.viscosity.DEBUG: print("{0}: Could not fit polynomial {1} coefficients: {2}".format(self.name,'viscosity',ve))
#            pass
        
        try:
            tried = False
            if len(self.viscosity.yData)==1:# and np.isfinite(fluidObject.viscosity.data).sum()<10:
                self.viscosity.coeffs = np.array([+7e+2, -6e+1, +1e+1])
                self.viscosity.type   = IncompressibleData.INCOMPRESSIBLE_EXPONENTIAL
                self.viscosity.fitCoeffs(self.Tbase,self.xbase)
                if self.viscosity.coeffs==None or IncompressibleFitter.allClose(self.viscosity.coeffs, np.array([+7e+2, -6e+1, +1e+1])): # Fit failed
                    tried = True
            if len(self.viscosity.yData)>1 or tried:
                self.viscosity.coeffs = np.copy(std_coeffs)#np.zeros(np.round(np.array(std_coeffs.shape) * 1.5))
                self.viscosity.type   = IncompressibleData.INCOMPRESSIBLE_EXPPOLYNOMIAL
                self.viscosity.fitCoeffs(self.Tbase,self.xbase)
        except errList as ve:
            if self.viscosity.DEBUG: print("{0}: Could not fit polynomial {1} coefficients: {2}".format(self.name,'viscosity',ve))
            pass
        
        
        # reset data for getArray and read special files
        if self.xid!=self.ifrac_pure and self.xid!=self.ifrac_undefined:
            allowNegativeData_org = self.allowNegativeData
            self.allowNegativeData = True
            
            try:
                x,_,z = self.getArray(dataID='TFreeze')
                self.T_freeze.yData = (x - 273.15) / 100.0
                self.T_freeze.xData = [0.0]
                if np.min(z)<150: z += 273.15 
                self.T_freeze.data = z.T
                try:
                    self.T_freeze.source = self.T_freeze.SOURCE_DATA
                    self.T_freeze.type   = self.T_freeze.INCOMPRESSIBLE_EXPONENTIAL
                    self.T_freeze.coeffs = np.array([+7e+6, +6e+4, +1e+1])
                    self.T_freeze.fitCoeffs(self.Tbase,self.xbase)
                    #if np.isfinite(self.T_freeze.data).sum()<10:
                    #    self.T_freeze.coeffs = np.array([+7e+6, +6e+4, +1e+1])
                    #    self.T_freeze.type   = self.T_freeze.INCOMPRESSIBLE_EXPONENTIAL
                    #else:   
                    #    self.T_freeze.coeffs = np.zeros(np.round(np.array(std_coeffs.shape) * 2))
                    #    self.T_freeze.type   = self.T_freeze.INCOMPRESSIBLE_EXPPOLYNOMIAL
                    #self.T_freeze.fitCoeffs(self.Tbase,self.xbase)
                except errList as ve:
                    if self.T_freeze.DEBUG: print("{0}: Could not fit {1} coefficients: {2}".format(self.name,"T_freeze",ve))
                    pass
            except errList as ve:
                if self.T_freeze.DEBUG: print("{0}: Could not load {1} data: {2}".format(self.name,"T_freeze",ve))
                pass

            # reset data for getArray again
            self.allowNegativeData = allowNegativeData_org
            try:
                x,_,z = self.getArray(dataID='Vol2Mass')            
                massData =    z[:,0]    /100.0
                volData  = (x - 273.15) /100.0
                
                if self.xid==self.ifrac_volume:
                    _,_,self.mass2input.data = IncompressibleFitter.shapeArray(volData,axs=1)
                    self.mass2input.xData = [0.0]
                    self.mass2input.yData = massData
                    try:
                        self.mass2input.coeffs = np.copy(std_coeffs)
                        self.mass2input.source = self.mass2input.SOURCE_DATA
                        self.mass2input.type   = self.mass2input.INCOMPRESSIBLE_POLYNOMIAL
                        self.mass2input.fitCoeffs(self.Tbase,self.xbase)
                    except errList as ve:
                        if self.mass2input.DEBUG: print("{0}: Could not fit {1} coefficients: {2}".format(self.name,"mass2input",ve))
                        pass
                elif self.xid==self.ifrac_mass:
                    _,_,self.volume2input.data = IncompressibleFitter.shapeArray(massData,axs=1)
                    self.volume2input.xData = [0.0]
                    self.volume2input.yData = volData
                    try:
                        self.volume2input.coeffs = np.copy(std_coeffs)
                        self.volume2input.source = self.volume2input.SOURCE_DATA
                        self.volume2input.type   = self.volume2input.INCOMPRESSIBLE_POLYNOMIAL
                        self.volume2input.fitCoeffs(self.Tbase,self.xbase)
                    except errList as ve:
                        if self.volume2input.DEBUG: print("{0}: Could not fit {1} coefficients: {2}".format(self.name,"volume2input",ve))
                        pass
                else:
                    raise ValueError("Unknown xid specified.")
            except errList as ve:
                if self.mass2input.DEBUG or self.volume2input.DEBUG: print("{0}: Could not load {1} data: {2}".format(self.name,"Vol2Mass",ve))
                pass