Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
which the data exists for.
Called on initialization only. See the source code for the variables at
which the coefficients are stored. The coefficients can safely be
altered once the class is initialized. This method can be called again
to reset the parameters.
'''
methods, methods_P = [], []
Tmins, Tmaxs = [], []
if has_CoolProp and self.CASRN in coolprop_dict:
methods.append(COOLPROP); methods_P.append(COOLPROP)
self.CP_f = coolprop_fluids[self.CASRN]
Tmins.append(self.CP_f.Tmin); Tmaxs.append(self.CP_f.Tc)
if self.CASRN in _VDISaturationDict:
methods.append(VDI_TABULAR)
Ts, props = VDI_tabular_data(self.CASRN, 'Mu (l)')
self.VDI_Tmin = Ts[0]
self.VDI_Tmax = Ts[-1]
self.tabular_data[VDI_TABULAR] = (Ts, props)
Tmins.append(self.VDI_Tmin); Tmaxs.append(self.VDI_Tmax)
if self.CASRN in Dutt_Prasad.index:
methods.append(DUTT_PRASAD)
_, A, B, C, self.DUTT_PRASAD_Tmin, self.DUTT_PRASAD_Tmax = _Dutt_Prasad_values[Dutt_Prasad.index.get_loc(self.CASRN)].tolist()
self.DUTT_PRASAD_coeffs = [A, B, C]
Tmins.append(self.DUTT_PRASAD_Tmin); Tmaxs.append(self.DUTT_PRASAD_Tmax)
if self.CASRN in VN3_data.index:
methods.append(VISWANATH_NATARAJAN_3)
_, _, A, B, C, self.VISWANATH_NATARAJAN_3_Tmin, self.VISWANATH_NATARAJAN_3_Tmax = _VN3_data_values[VN3_data.index.get_loc(self.CASRN)].tolist()
self.VISWANATH_NATARAJAN_3_coeffs = [A, B, C]
Tmins.append(self.VISWANATH_NATARAJAN_3_Tmin); Tmaxs.append(self.VISWANATH_NATARAJAN_3_Tmax)
if self.CASRN in VN2_data.index:
methods.append(VISWANATH_NATARAJAN_2)
r'''Method which picks out coefficients for the specified chemical
from the various dictionaries and DataFrames storing it. All data is
stored as attributes. This method also sets :obj:`Tmin`, :obj:`Tmax`,
:obj:`all_methods` and obj:`all_methods_P` as a set of methods for
which the data exists for.
Called on initialization only. See the source code for the variables at
which the coefficients are stored. The coefficients can safely be
altered once the class is initialized. This method can be called again
to reset the parameters.
'''
methods, methods_P = [], []
Tmins, Tmaxs = [], []
if self.CASRN in _VDISaturationDict:
methods.append(VDI_TABULAR)
Ts, props = VDI_tabular_data(self.CASRN, 'Mu (g)')
self.VDI_Tmin = Ts[0]
self.VDI_Tmax = Ts[-1]
self.tabular_data[VDI_TABULAR] = (Ts, props)
Tmins.append(self.VDI_Tmin); Tmaxs.append(self.VDI_Tmax)
if has_CoolProp and self.CASRN in coolprop_dict:
methods.append(COOLPROP); methods_P.append(COOLPROP)
self.CP_f = coolprop_fluids[self.CASRN]
Tmins.append(self.CP_f.Tmin); Tmaxs.append(self.CP_f.Tmax)
if self.CASRN in Perrys2_312.index:
methods.append(DIPPR_PERRY_8E)
_, C1, C2, C3, C4, self.Perrys2_312_Tmin, self.Perrys2_312_Tmax = _Perrys2_312_values[Perrys2_312.index.get_loc(self.CASRN)].tolist()
self.Perrys2_312_coeffs = [C1, C2, C3, C4]
Tmins.append(self.Perrys2_312_Tmin); Tmaxs.append(self.Perrys2_312_Tmax)
if self.CASRN in VDI_PPDS_8.index:
methods.append(VDI_PPDS)
self.VDI_PPDS_coeffs = _VDI_PPDS_8_values[VDI_PPDS_8.index.get_loc(self.CASRN)].tolist()[1:]
methods.append(CRCSTD)
self.CRCSTD_T = 298.15
self.CRCSTD_constant = float(CRC_standard_data.at[self.CASRN, 'Cpl'])
# Saturation functions
if self.CASRN in zabransky_dict_sat_s:
methods.append(ZABRANSKY_SPLINE_SAT)
self.Zabransky_spline_sat = zabransky_dict_sat_s[self.CASRN]
if self.CASRN in zabransky_dict_sat_p:
methods.append(ZABRANSKY_QUASIPOLYNOMIAL_SAT)
self.Zabransky_quasipolynomial_sat = zabransky_dict_sat_p[self.CASRN]
if self.CASRN in _VDISaturationDict:
# NOTE: VDI data is for the saturation curve, i.e. at increasing
# pressure; it is normally substantially higher than the ideal gas
# value
methods.append(VDI_TABULAR)
Ts, props = VDI_tabular_data(self.CASRN, 'Cp (l)')
self.VDI_Tmin = Ts[0]
self.VDI_Tmax = Ts[-1]
self.tabular_data[VDI_TABULAR] = (Ts, props)
Tmins.append(self.VDI_Tmin); Tmaxs.append(self.VDI_Tmax)
if self.Tc and self.omega:
methods.extend([ROWLINSON_POLING, ROWLINSON_BONDI])
if has_CoolProp and self.CASRN in coolprop_dict:
methods.append(COOLPROP)
self.CP_f = coolprop_fluids[self.CASRN]
Tmins.append(self.CP_f.Tt); Tmaxs.append(self.CP_f.Tc)
if self.MW and self.similarity_variable:
methods.append(DADGOSTAR_SHAW)
self.all_methods = set(methods)
if Tmins and Tmaxs:
# TODO: More Tmin, Tmax ranges
self.Tmin, self.Tmax = min(Tmins), max(Tmaxs)
_, sigma0, n0, sigma1, n1, sigma2, n2, Tc, self.STREFPROP_Tmin, self.STREFPROP_Tmax = _Mulero_Cachadina_data_values[Mulero_Cachadina_data.index.get_loc(self.CASRN)].tolist()
self.STREFPROP_coeffs = [sigma0, n0, sigma1, n1, sigma2, n2, Tc]
Tmins.append(self.STREFPROP_Tmin); Tmaxs.append(self.STREFPROP_Tmax)
if self.CASRN in Somayajulu_data_2.index:
methods.append(SOMAYAJULU2)
_, self.SOMAYAJULU2_Tt, self.SOMAYAJULU2_Tc, A, B, C = _Somayajulu_data_2_values[Somayajulu_data_2.index.get_loc(self.CASRN)].tolist()
self.SOMAYAJULU2_coeffs = [A, B, C]
Tmins.append(self.SOMAYAJULU2_Tt); Tmaxs.append(self.SOMAYAJULU2_Tc)
if self.CASRN in Somayajulu_data.index:
methods.append(SOMAYAJULU)
_, self.SOMAYAJULU_Tt, self.SOMAYAJULU_Tc, A, B, C = _Somayajulu_data_values[Somayajulu_data.index.get_loc(self.CASRN)].tolist()
self.SOMAYAJULU_coeffs = [A, B, C]
Tmins.append(self.SOMAYAJULU_Tt); Tmaxs.append(self.SOMAYAJULU_Tc)
if self.CASRN in _VDISaturationDict:
methods.append(VDI_TABULAR)
Ts, props = VDI_tabular_data(self.CASRN, 'sigma')
self.VDI_Tmin = Ts[0]
self.VDI_Tmax = Ts[-1]
self.tabular_data[VDI_TABULAR] = (Ts, props)
Tmins.append(self.VDI_Tmin); Tmaxs.append(self.VDI_Tmax)
if self.CASRN in Jasper_Lange_data.index:
methods.append(JASPER)
_, a, b, self.JASPER_Tmin, self.JASPER_Tmax= _Jasper_Lange_data_values[Jasper_Lange_data.index.get_loc(self.CASRN)].tolist()
self.JASPER_coeffs = [a, b]
Tmins.append(self.JASPER_Tmin); Tmaxs.append(self.JASPER_Tmax)
if all((self.Tc, self.Vc, self.omega)):
methods.append(MIQUEU)
Tmins.append(0.0); Tmaxs.append(self.Tc)
if all((self.Tb, self.Tc, self.Pc)):
methods.append(BROCK_BIRD)
methods.append(SASTRI_RAO)
Tmins.append(0.0); Tmaxs.append(self.Tc)
r'''Method which picks out coefficients for the specified chemical
from the various dictionaries and DataFrames storing it. All data is
stored as attributes. This method also sets :obj:`Tmin`, :obj:`Tmax`,
:obj:`all_methods` and obj:`all_methods_P` as a set of methods for
which the data exists for.
Called on initialization only. See the source code for the variables at
which the coefficients are stored. The coefficients can safely be
altered once the class is initialized. This method can be called again
to reset the parameters.
'''
methods, methods_P = [], []
Tmins, Tmaxs = [], []
if self.CASRN in _VDISaturationDict:
methods.append(VDI_TABULAR)
Ts, props = VDI_tabular_data(self.CASRN, 'K (l)')
self.VDI_Tmin = Ts[0]
self.VDI_Tmax = Ts[-1]
self.tabular_data[VDI_TABULAR] = (Ts, props)
Tmins.append(self.VDI_Tmin); Tmaxs.append(self.VDI_Tmax)
if has_CoolProp and self.CASRN in coolprop_dict:
methods.append(COOLPROP); methods_P.append(COOLPROP)
self.CP_f = coolprop_fluids[self.CASRN]
Tmins.append(self.CP_f.Tmin); Tmaxs.append(self.CP_f.Tc)
if self.MW:
methods.extend([BAHADORI_L, LAKSHMI_PRASAD])
# Tmin and Tmax are not extended by these simple models, who often
# give values of 0; BAHADORI_L even has 3 roots.
# LAKSHMI_PRASAD works down to 0 K, and has an upper limit of
# 50.0*(131.0*sqrt(M) + 2771.0)/(50.0*M**0.5 + 197.0)
# where it becomes 0.
if self.CASRN in Perrys2_315.index:
if self.CASRN in Perry_l_data.index:
methods.append(PERRYDIPPR)
_, C1, C2, C3, C4, self.DIPPR_Tmin, self.DIPPR_Tmax = _Perry_l_data_values[Perry_l_data.index.get_loc(self.CASRN)].tolist()
self.DIPPR_coeffs = [C1, C2, C3, C4]
Tmins.append(self.DIPPR_Tmin); Tmaxs.append(self.DIPPR_Tmax)
if self.CASRN in VDI_PPDS_2.index:
methods.append(VDI_PPDS)
_, MW, Tc, rhoc, A, B, C, D = _VDI_PPDS_2_values[VDI_PPDS_2.index.get_loc(self.CASRN)].tolist()
self.VDI_PPDS_coeffs = [A, B, C, D]
self.VDI_PPDS_MW = MW
self.VDI_PPDS_Tc = Tc
self.VDI_PPDS_rhoc = rhoc
Tmaxs.append(self.VDI_PPDS_Tc)
if self.CASRN in _VDISaturationDict:
methods.append(VDI_TABULAR)
Ts, props = VDI_tabular_data(self.CASRN, 'Volume (l)')
self.VDI_Tmin = Ts[0]
self.VDI_Tmax = Ts[-1]
self.tabular_data[VDI_TABULAR] = (Ts, props)
Tmins.append(self.VDI_Tmin); Tmaxs.append(self.VDI_Tmax)
if self.Tc and self.CASRN in COSTALD_data.index:
methods.append(HTCOSTALDFIT)
self.COSTALD_Vchar = float(COSTALD_data.at[self.CASRN, 'Vchar'])
self.COSTALD_omega_SRK = float(COSTALD_data.at[self.CASRN, 'omega_SRK'])
Tmins.append(0); Tmaxs.append(self.Tc)
if self.Tc and self.Pc and self.CASRN in COSTALD_data.index and not np.isnan(COSTALD_data.at[self.CASRN, 'Z_RA']):
methods.append(RACKETTFIT)
self.RACKETT_Z_RA = float(COSTALD_data.at[self.CASRN, 'Z_RA'])
Tmins.append(0); Tmaxs.append(self.Tc)
if self.CASRN in CRC_inorg_l_const_data.index:
methods.append(CRC_INORG_L_CONST)
self.CRC_INORG_L_CONST_Vm = float(CRC_inorg_l_const_data.at[self.CASRN, 'Vm'])
self.POLING_coefs = [a0, a1, a2, a3, a4]
Tmins.append(self.POLING_Tmin); Tmaxs.append(self.POLING_Tmax)
if self.CASRN in Poling_data.index and not np.isnan(Poling_data.at[self.CASRN, 'Cpg']):
methods.append(POLING_CONST)
self.POLING_T = 298.15
self.POLING_constant = float(Poling_data.at[self.CASRN, 'Cpg'])
if self.CASRN in CRC_standard_data.index and not np.isnan(CRC_standard_data.at[self.CASRN, 'Cpg']):
methods.append(CRCSTD)
self.CRCSTD_T = 298.15
self.CRCSTD_constant = float(CRC_standard_data.at[self.CASRN, 'Cpg'])
if self.CASRN in _VDISaturationDict:
# NOTE: VDI data is for the saturation curve, i.e. at increasing
# pressure; it is normally substantially higher than the ideal gas
# value
methods.append(VDI_TABULAR)
Ts, props = VDI_tabular_data(self.CASRN, 'Cp (g)')
self.VDI_Tmin = Ts[0]
self.VDI_Tmax = Ts[-1]
self.tabular_data[VDI_TABULAR] = (Ts, props)
Tmins.append(self.VDI_Tmin); Tmaxs.append(self.VDI_Tmax)
if has_CoolProp and self.CASRN in coolprop_dict:
methods.append(COOLPROP)
self.CP_f = coolprop_fluids[self.CASRN]
Tmins.append(self.CP_f.Tt); Tmaxs.append(self.CP_f.Tc)
if self.MW and self.similarity_variable:
methods.append(LASTOVKA_SHAW)
self.all_methods = set(methods)
if Tmins and Tmaxs:
self.Tmin, self.Tmax = min(Tmins), max(Tmaxs)
r'''Method which picks out coefficients for the specified chemical
from the various dictionaries and DataFrames storing it. All data is
stored as attributes. This method also sets :obj:`Tmin`, :obj:`Tmax`,
:obj:`all_methods` and obj:`all_methods_P` as a set of methods for
which the data exists for.
Called on initialization only. See the source code for the variables at
which the coefficients are stored. The coefficients can safely be
altered once the class is initialized. This method can be called again
to reset the parameters.
'''
methods, methods_P = [], []
Tmins, Tmaxs = [], []
if self.CASRN in _VDISaturationDict:
methods.append(VDI_TABULAR)
Ts, props = VDI_tabular_data(self.CASRN, 'K (g)')
self.VDI_Tmin = Ts[0]
self.VDI_Tmax = Ts[-1]
self.tabular_data[VDI_TABULAR] = (Ts, props)
Tmins.append(self.VDI_Tmin); Tmaxs.append(self.VDI_Tmax)
if has_CoolProp and self.CASRN in coolprop_dict:
methods.append(COOLPROP); methods_P.append(COOLPROP)
self.CP_f = coolprop_fluids[self.CASRN]
Tmins.append(self.CP_f.Tmin); Tmaxs.append(self.CP_f.Tc)
if self.CASRN in Perrys2_314.index:
methods.append(DIPPR_PERRY_8E)
_, C1, C2, C3, C4, self.Perrys2_314_Tmin, self.Perrys2_314_Tmax = _Perrys2_314_values[Perrys2_314.index.get_loc(self.CASRN)].tolist()
self.Perrys2_314_coeffs = [C1, C2, C3, C4]
Tmins.append(self.Perrys2_314_Tmin); Tmaxs.append(self.Perrys2_314_Tmax)
if self.CASRN in VDI_PPDS_10.index:
_, A, B, C, D, E = _VDI_PPDS_10_values[VDI_PPDS_10.index.get_loc(self.CASRN)].tolist()
self.VDI_PPDS_coeffs = [A, B, C, D, E]
methods.append(ANTOINE_POLING)
_, A, B, C, self.ANTOINE_POLING_Tmin, self.ANTOINE_POLING_Tmax = _AntoinePoling_values[AntoinePoling.index.get_loc(self.CASRN)].tolist()
self.ANTOINE_POLING_coefs = [A, B, C]
Tmins.append(self.ANTOINE_POLING_Tmin); Tmaxs.append(self.ANTOINE_POLING_Tmax)
if self.CASRN in Perrys2_8.index:
methods.append(DIPPR_PERRY_8E)
_, C1, C2, C3, C4, C5, self.Perrys2_8_Tmin, self.Perrys2_8_Tmax = _Perrys2_8_values[Perrys2_8.index.get_loc(self.CASRN)].tolist()
self.Perrys2_8_coeffs = [C1, C2, C3, C4, C5]
Tmins.append(self.Perrys2_8_Tmin); Tmaxs.append(self.Perrys2_8_Tmax)
if has_CoolProp and self.CASRN in coolprop_dict:
methods.append(COOLPROP)
self.CP_f = coolprop_fluids[self.CASRN]
Tmins.append(self.CP_f.Tmin); Tmaxs.append(self.CP_f.Tc)
if self.CASRN in _VDISaturationDict:
methods.append(VDI_TABULAR)
Ts, props = VDI_tabular_data(self.CASRN, 'P')
self.VDI_Tmin = Ts[0]
self.VDI_Tmax = Ts[-1]
self.tabular_data[VDI_TABULAR] = (Ts, props)
Tmins.append(self.VDI_Tmin); Tmaxs.append(self.VDI_Tmax)
if self.CASRN in VDI_PPDS_3.index:
_, Tm, Tc, Pc, A, B, C, D = _VDI_PPDS_3_values[VDI_PPDS_3.index.get_loc(self.CASRN)].tolist()
self.VDI_PPDS_coeffs = [A, B, C, D]
self.VDI_PPDS_Tc = Tc
self.VDI_PPDS_Tm = Tm
self.VDI_PPDS_Pc = Pc
methods.append(VDI_PPDS)
Tmins.append(self.VDI_PPDS_Tm); Tmaxs.append(self.VDI_PPDS_Tc)
if all((self.Tb, self.Tc, self.Pc)):
methods.append(BOILING_CRITICAL)
Tmins.append(0.01); Tmaxs.append(self.Tc)
if all((self.Tc, self.Pc, self.omega)):