INSTRUCTION
stringlengths
1
8.43k
RESPONSE
stringlengths
75
104k
r Calculates the equilibrium K - value assuming Raoult s law or an equation of state model or an activity coefficient model or a combined equation of state - activity model.
def K_value(P=None, Psat=None, phi_l=None, phi_g=None, gamma=None, Poynting=1): r'''Calculates the equilibrium K-value assuming Raoult's law, or an equation of state model, or an activity coefficient model, or a combined equation of state-activity model. The calculation procedure will use the most adva...
r Calculates the objective function of the Rachford - Rice flash equation. This function should be called by a solver seeking a solution to a flash calculation. The unknown variable is V_over_F for which a solution must be between 0 and 1.
def Rachford_Rice_flash_error(V_over_F, zs, Ks): r'''Calculates the objective function of the Rachford-Rice flash equation. This function should be called by a solver seeking a solution to a flash calculation. The unknown variable is `V_over_F`, for which a solution must be between 0 and 1. .. math...
r Solves the objective function of the Rachford - Rice flash equation. Uses the method proposed in [ 2 ] _ to obtain an initial guess.
def Rachford_Rice_solution(zs, Ks): r'''Solves the objective function of the Rachford-Rice flash equation. Uses the method proposed in [2]_ to obtain an initial guess. .. math:: \sum_i \frac{z_i(K_i-1)}{1 + \frac{V}{F}(K_i-1)} = 0 Parameters ---------- zs : list[float] Overall ...
r Solves the objective function of the Li - Johns - Ahmadi flash equation. Uses the method proposed in [ 1 ] _ to obtain an initial guess.
def Li_Johns_Ahmadi_solution(zs, Ks): r'''Solves the objective function of the Li-Johns-Ahmadi flash equation. Uses the method proposed in [1]_ to obtain an initial guess. .. math:: 0 = 1 + \left(\frac{K_{max}-K_{min}}{K_{min}-1}\right)x_1 + \sum_{i=2}^{n-1}\frac{K_i-K_{min}}{K_{min}-1}\lef...
r This function handles the solution of the inner loop of a flash calculation solving for liquid and gas mole fractions and vapor fraction based on specified overall mole fractions and K values. As K values are weak functions of composition this should be called repeatedly by an outer loop. Will automatically select an...
def flash_inner_loop(zs, Ks, AvailableMethods=False, Method=None): r'''This function handles the solution of the inner loop of a flash calculation, solving for liquid and gas mole fractions and vapor fraction based on specified overall mole fractions and K values. As K values are weak functions of compo...
r Calculates the activity coefficients of each species in a mixture using the Non - Random Two - Liquid ( NRTL ) method given their mole fractions dimensionless interaction parameters and nonrandomness constants. Those are normally correlated with temperature in some form and need to be calculated separately.
def NRTL(xs, taus, alphas): r'''Calculates the activity coefficients of each species in a mixture using the Non-Random Two-Liquid (NRTL) method, given their mole fractions, dimensionless interaction parameters, and nonrandomness constants. Those are normally correlated with temperature in some form, and...
r Calculates the activity coefficients of each species in a mixture using the Wilson method given their mole fractions and dimensionless interaction parameters. Those are normally correlated with temperature and need to be calculated separately.
def Wilson(xs, params): r'''Calculates the activity coefficients of each species in a mixture using the Wilson method, given their mole fractions, and dimensionless interaction parameters. Those are normally correlated with temperature, and need to be calculated separately. .. math:: \ln \g...
r Calculates the activity coefficients of each species in a mixture using the Universal quasi - chemical ( UNIQUAC ) equation given their mole fractions rs qs and dimensionless interaction parameters. The interaction parameters are normally correlated with temperature and need to be calculated separately.
def UNIQUAC(xs, rs, qs, taus): r'''Calculates the activity coefficients of each species in a mixture using the Universal quasi-chemical (UNIQUAC) equation, given their mole fractions, `rs`, `qs`, and dimensionless interaction parameters. The interaction parameters are normally correlated with temperatur...
>>> bubble_at_T ( [ 0. 5 0. 5 ] [ 1400 7000 ] ) 4200. 0 >>> bubble_at_T ( [ 0. 5 0. 5 ] [ 1400 7000 ] gammas = [ 1. 1. 75 ] ) 3395. 0 >>> bubble_at_T ( [ 0. 5 0. 5 ] [ 1400 7000 ] gammas = [ 1. 1. 75 ] fugacities = [. 995 0. 98 ] ) 3452. 440775305097
def bubble_at_T(zs, Psats, fugacities=None, gammas=None): ''' >>> bubble_at_T([0.5, 0.5], [1400, 7000]) 4200.0 >>> bubble_at_T([0.5, 0.5], [1400, 7000], gammas=[1.1, .75]) 3395.0 >>> bubble_at_T([0.5, 0.5], [1400, 7000], gammas=[1.1, .75], fugacities=[.995, 0.98]) 3452.440775305097 ''' ...
r Determines the phase of a one - species chemical system according to basic rules using whatever information is available. Considers only the phases liquid solid and gas ; does not consider two - phase scenarios as should occurs between phase boundaries.
def identify_phase(T, P, Tm=None, Tb=None, Tc=None, Psat=None): r'''Determines the phase of a one-species chemical system according to basic rules, using whatever information is available. Considers only the phases liquid, solid, and gas; does not consider two-phase scenarios, as should occurs between p...
>>> identify_phase_mixture ( T = 280 P = 5000. zs = [ 0. 5 0. 5 ] Psats = [ 1400 7000 ] ) ( l [ 0. 5 0. 5 ] None 0 ) >>> identify_phase_mixture ( T = 280 P = 3000. zs = [ 0. 5 0. 5 ] Psats = [ 1400 7000 ] ) ( two - phase [ 0. 7142857142857143 0. 2857142857142857 ] [ 0. 33333333333333337 0. 6666666666666666 ] 0. 5625000...
def identify_phase_mixture(T=None, P=None, zs=None, Tcs=None, Pcs=None, Psats=None, CASRNs=None, AvailableMethods=False, Method=None): # pragma: no cover ''' >>> identify_phase_mixture(T=280, P=5000., zs=[0.5, 0.5], Psats=[1400, 7000]) ('l', [0.5, 0.5],...
>>> Pbubble_mixture ( zs = [ 0. 5 0. 5 ] Psats = [ 1400 7000 ] ) 4200. 0
def Pbubble_mixture(T=None, zs=None, Psats=None, CASRNs=None, AvailableMethods=False, Method=None): # pragma: no cover ''' >>> Pbubble_mixture(zs=[0.5, 0.5], Psats=[1400, 7000]) 4200.0 ''' def list_methods(): methods = [] if none_and_length_check((Psats, zs)): ...
Calculates bubble point for a given pressure
def bubble_at_P(P, zs, vapor_pressure_eqns, fugacities=None, gammas=None): '''Calculates bubble point for a given pressure Parameters ---------- P : float Pressure, [Pa] zs : list[float] Overall mole fractions of all species, [-] vapor_pressure_eqns : list[functions] Tem...
>>> Pdew_mixture ( zs = [ 0. 5 0. 5 ] Psats = [ 1400 7000 ] ) 2333. 3333333333335
def Pdew_mixture(T=None, zs=None, Psats=None, CASRNs=None, AvailableMethods=False, Method=None): # pragma: no cover ''' >>> Pdew_mixture(zs=[0.5, 0.5], Psats=[1400, 7000]) 2333.3333333333335 ''' def list_methods(): methods = [] if none_and_length_check((Psats, zs)):...
r Interface for drawing a 2D image of the molecule. Requires an HTML5 browser and the libraries RDKit and IPython. An exception is raised if either of these libraries is absent.
def draw_2d(self, width=300, height=300, Hs=False): # pragma: no cover r'''Interface for drawing a 2D image of the molecule. Requires an HTML5 browser, and the libraries RDKit and IPython. An exception is raised if either of these libraries is absent. Parameters --------...
r Interface for drawing an interactive 3D view of the molecule. Requires an HTML5 browser and the libraries RDKit pymol3D and IPython. An exception is raised if all three of these libraries are not installed.
def draw_3d(self, width=300, height=500, style='stick', Hs=True): # pragma: no cover r'''Interface for drawing an interactive 3D view of the molecule. Requires an HTML5 browser, and the libraries RDKit, pymol3D, and IPython. An exception is raised if all three of these libraries are not ...
r Internal energy of the chemical at its current temperature and pressure in units of [ J/ mol ].
def Um(self): r'''Internal energy of the chemical at its current temperature and pressure, in units of [J/mol]. This property requires that :obj:`thermo.chemical.set_thermo` ran successfully to be accurate. It also depends on the molar volume of the chemical at its current ...
r Helmholtz energy of the chemical at its current temperature and pressure in units of [ J/ mol ].
def Am(self): r'''Helmholtz energy of the chemical at its current temperature and pressure, in units of [J/mol]. This property requires that :obj:`thermo.chemical.set_thermo` ran successfully to be accurate. It also depends on the molar volume of the chemical at its current ...
r Helmholtz energy of the chemical at its current temperature and pressure in units of [ J/ kg ].
def A(self): r'''Helmholtz energy of the chemical at its current temperature and pressure, in units of [J/kg]. This property requires that :obj:`thermo.chemical.set_thermo` ran successfully to be accurate. It also depends on the molar volume of the chemical at its current ...
r Charge of a chemical computed with RDKit from a chemical s SMILES. If RDKit is not available holds None.
def charge(self): r'''Charge of a chemical, computed with RDKit from a chemical's SMILES. If RDKit is not available, holds None. Examples -------- >>> Chemical('sodium ion').charge 1 ''' try: if not self.rdkitmol: return charge...
r RDKit object of the chemical without hydrogen. If RDKit is not available holds None.
def rdkitmol(self): r'''RDKit object of the chemical, without hydrogen. If RDKit is not available, holds None. For examples of what can be done with RDKit, see `their website <http://www.rdkit.org/docs/GettingStartedInPython.html>`_. ''' if self.__rdkitmol: r...
r RDKit object of the chemical with hydrogen. If RDKit is not available holds None.
def rdkitmol_Hs(self): r'''RDKit object of the chemical, with hydrogen. If RDKit is not available, holds None. For examples of what can be done with RDKit, see `their website <http://www.rdkit.org/docs/GettingStartedInPython.html>`_. ''' if self.__rdkitmol_Hs: ...
r Hill formula of a compound. For a description of the Hill system see: obj: thermo. elements. atoms_to_Hill.
def Hill(self): r'''Hill formula of a compound. For a description of the Hill system, see :obj:`thermo.elements.atoms_to_Hill`. Examples -------- >>> Chemical('furfuryl alcohol').Hill 'C5H6O2' ''' if self.__Hill: return self.__Hill els...
r Dictionary of atom: fractional occurence of the elements in a chemical. Useful when performing element balances. For mass - fraction occurences see: obj: mass_fractions.
def atom_fractions(self): r'''Dictionary of atom:fractional occurence of the elements in a chemical. Useful when performing element balances. For mass-fraction occurences, see :obj:`mass_fractions`. Examples -------- >>> Chemical('Ammonium aluminium sulfate').atom_fracti...
r Dictionary of atom: mass - weighted fractional occurence of elements. Useful when performing mass balances. For atom - fraction occurences see: obj: atom_fractions.
def mass_fractions(self): r'''Dictionary of atom:mass-weighted fractional occurence of elements. Useful when performing mass balances. For atom-fraction occurences, see :obj:`atom_fractions`. Examples -------- >>> Chemical('water').mass_fractions {'H': 0.11189834...
r Dictionary of legal status indicators for the chemical.
def legal_status(self): r'''Dictionary of legal status indicators for the chemical. Examples -------- >>> pprint(Chemical('benzene').legal_status) {'DSL': 'LISTED', 'EINECS': 'LISTED', 'NLP': 'UNLISTED', 'SPIN': 'LISTED', 'TSCA': 'LISTED'} ...
r Dictionary of economic status indicators for the chemical.
def economic_status(self): r'''Dictionary of economic status indicators for the chemical. Examples -------- >>> pprint(Chemical('benzene').economic_status) ["US public: {'Manufactured': 6165232.1, 'Imported': 463146.474, 'Exported': 271908.252}", u'1,000,000 - 10,000,00...
r Dictionary of UNIFAC subgroup: count groups for the original UNIFAC subgroups as determined by DDBST s online service <http:// www. ddbst. com/ unifacga. html > _.
def UNIFAC_groups(self): r'''Dictionary of UNIFAC subgroup: count groups for the original UNIFAC subgroups, as determined by `DDBST's online service <http://www.ddbst.com/unifacga.html>`_. Examples -------- >>> pprint(Chemical('Cumene').UNIFAC_groups) {1: 2, 9: 5, 13: 1}...
r Dictionary of Dortmund UNIFAC subgroup: count groups for the Dortmund UNIFAC subgroups as determined by DDBST s online service <http:// www. ddbst. com/ unifacga. html > _.
def UNIFAC_Dortmund_groups(self): r'''Dictionary of Dortmund UNIFAC subgroup: count groups for the Dortmund UNIFAC subgroups, as determined by `DDBST's online service <http://www.ddbst.com/unifacga.html>`_. Examples -------- >>> pprint(Chemical('Cumene').UNIFAC_Dortmund_groups) ...
r Dictionary of PSRK subgroup: count groups for the PSRK subgroups as determined by DDBST s online service <http:// www. ddbst. com/ unifacga. html > _.
def PSRK_groups(self): r'''Dictionary of PSRK subgroup: count groups for the PSRK subgroups, as determined by `DDBST's online service <http://www.ddbst.com/unifacga.html>`_. Examples -------- >>> pprint(Chemical('Cumene').PSRK_groups) {1: 2, 9: 5, 13: 1} ''' ...
r Enthalpy of vaporization of the chemical at its current temperature in units of [ J/ kg ].
def Hvap(self): r'''Enthalpy of vaporization of the chemical at its current temperature, in units of [J/kg]. This property uses the object-oriented interface :obj:`thermo.phase_change.EnthalpyVaporization`, but converts its results from molar to mass units. Examples ...
r Solid - phase heat capacity of the chemical at its current temperature in units of [ J/ kg/ K ]. For calculation of this property at other temperatures or specifying manually the method used to calculate it and more - see the object oriented interface: obj: thermo. heat_capacity. HeatCapacitySolid ; each Chemical ins...
def Cps(self): r'''Solid-phase heat capacity of the chemical at its current temperature, in units of [J/kg/K]. For calculation of this property at other temperatures, or specifying manually the method used to calculate it, and more - see the object oriented interface :obj:`thermo...
r Liquid - phase heat capacity of the chemical at its current temperature in units of [ J/ kg/ K ]. For calculation of this property at other temperatures or specifying manually the method used to calculate it and more - see the object oriented interface: obj: thermo. heat_capacity. HeatCapacityLiquid ; each Chemical i...
def Cpl(self): r'''Liquid-phase heat capacity of the chemical at its current temperature, in units of [J/kg/K]. For calculation of this property at other temperatures, or specifying manually the method used to calculate it, and more - see the object oriented interface :obj:`therm...
r Gas - phase heat capacity of the chemical at its current temperature in units of [ J/ kg/ K ]. For calculation of this property at other temperatures or specifying manually the method used to calculate it and more - see the object oriented interface: obj: thermo. heat_capacity. HeatCapacityGas ; each Chemical instanc...
def Cpg(self): r'''Gas-phase heat capacity of the chemical at its current temperature, in units of [J/kg/K]. For calculation of this property at other temperatures, or specifying manually the method used to calculate it, and more - see the object oriented interface :obj:`thermo.h...
r Gas - phase ideal - gas contant - volume heat capacity of the chemical at its current temperature in units of [ J/ mol/ K ]. Subtracts R from the ideal - gas heat capacity ; does not include pressure - compensation from an equation of state.
def Cvgm(self): r'''Gas-phase ideal-gas contant-volume heat capacity of the chemical at its current temperature, in units of [J/mol/K]. Subtracts R from the ideal-gas heat capacity; does not include pressure-compensation from an equation of state. Examples -------- ...
r Gas - phase ideal - gas contant - volume heat capacity of the chemical at its current temperature in units of [ J/ kg/ K ]. Subtracts R from the ideal - gas heat capacity ; does not include pressure - compensation from an equation of state.
def Cvg(self): r'''Gas-phase ideal-gas contant-volume heat capacity of the chemical at its current temperature, in units of [J/kg/K]. Subtracts R from the ideal-gas heat capacity; does not include pressure-compensation from an equation of state. Examples -------- ...
r Gas - phase ideal - gas isentropic exponent of the chemical at its current temperature [ dimensionless ]. Does not include pressure - compensation from an equation of state.
def isentropic_exponent(self): r'''Gas-phase ideal-gas isentropic exponent of the chemical at its current temperature, [dimensionless]. Does not include pressure-compensation from an equation of state. Examples -------- >>> Chemical('hydrogen').isentropic_exponent ...
r Solid - phase mass density of the chemical at its current temperature in units of [ kg/ m^3 ]. For calculation of this property at other temperatures or specifying manually the method used to calculate it and more - see the object oriented interface: obj: thermo. volume. VolumeSolid ; each Chemical instance creates o...
def rhos(self): r'''Solid-phase mass density of the chemical at its current temperature, in units of [kg/m^3]. For calculation of this property at other temperatures, or specifying manually the method used to calculate it, and more - see the object oriented interface :obj:`thermo...
r Liquid - phase mass density of the chemical at its current temperature and pressure in units of [ kg/ m^3 ]. For calculation of this property at other temperatures and pressures or specifying manually the method used to calculate it and more - see the object oriented interface: obj: thermo. volume. VolumeLiquid ; eac...
def rhol(self): r'''Liquid-phase mass density of the chemical at its current temperature and pressure, in units of [kg/m^3]. For calculation of this property at other temperatures and pressures, or specifying manually the method used to calculate it, and more - see the object oriented ...
r Gas - phase mass density of the chemical at its current temperature and pressure in units of [ kg/ m^3 ]. For calculation of this property at other temperatures or pressures or specifying manually the method used to calculate it and more - see the object oriented interface: obj: thermo. volume. VolumeGas ; each Chemi...
def rhog(self): r'''Gas-phase mass density of the chemical at its current temperature and pressure, in units of [kg/m^3]. For calculation of this property at other temperatures or pressures, or specifying manually the method used to calculate it, and more - see the object oriented interf...
r Compressibility factor of the chemical in the solid phase at the current temperature and pressure [ dimensionless ].
def Zs(self): r'''Compressibility factor of the chemical in the solid phase at the current temperature and pressure, [dimensionless]. Utilizes the object oriented interface and :obj:`thermo.volume.VolumeSolid` to perform the actual calculation of molar volume. Examples ...
r Compressibility factor of the chemical in the liquid phase at the current temperature and pressure [ dimensionless ].
def Zl(self): r'''Compressibility factor of the chemical in the liquid phase at the current temperature and pressure, [dimensionless]. Utilizes the object oriented interface and :obj:`thermo.volume.VolumeLiquid` to perform the actual calculation of molar volume. Example...
r Compressibility factor of the chemical in the gas phase at the current temperature and pressure [ dimensionless ].
def Zg(self): r'''Compressibility factor of the chemical in the gas phase at the current temperature and pressure, [dimensionless]. Utilizes the object oriented interface and :obj:`thermo.volume.VolumeGas` to perform the actual calculation of molar volume. Examples ...
r Specific gravity of the gas phase of the chemical [ dimensionless ]. The reference condition is air at 15. 6 °C ( 60 °F ) and 1 atm ( rho = 1. 223 kg/ m^3 ). The definition for gases uses the compressibility factor of the reference gas and the chemical both at the reference conditions not the conditions of the chemic...
def SGg(self): r'''Specific gravity of the gas phase of the chemical, [dimensionless]. The reference condition is air at 15.6 °C (60 °F) and 1 atm (rho=1.223 kg/m^3). The definition for gases uses the compressibility factor of the reference gas and the chemical both at the reference ...
r API gravity of the liquid phase of the chemical [ degrees ]. The reference condition is water at 15. 6 °C ( 60 °F ) and 1 atm ( rho = 999. 016 kg/ m^3 standardized ). Examples -------- >>> Chemical ( water ). API 9. 999752435378895
def API(self): r'''API gravity of the liquid phase of the chemical, [degrees]. The reference condition is water at 15.6 °C (60 °F) and 1 atm (rho=999.016 kg/m^3, standardized). Examples -------- >>> Chemical('water').API 9.999752435378895 '''...
r Second virial coefficient of the gas phase of the chemical at its current temperature and pressure in units of [ mol/ m^3 ].
def Bvirial(self): r'''Second virial coefficient of the gas phase of the chemical at its current temperature and pressure, in units of [mol/m^3]. This property uses the object-oriented interface :obj:`thermo.volume.VolumeGas`, converting its result with :obj:`thermo.utils.B_from...
r Isobaric ( constant - pressure ) expansion of the liquid phase of the chemical at its current temperature and pressure in units of [ 1/ K ].
def isobaric_expansion_l(self): r'''Isobaric (constant-pressure) expansion of the liquid phase of the chemical at its current temperature and pressure, in units of [1/K]. .. math:: \beta = \frac{1}{V}\left(\frac{\partial V}{\partial T} \right)_P Utilizes the temperature-der...
r Isobaric ( constant - pressure ) expansion of the gas phase of the chemical at its current temperature and pressure in units of [ 1/ K ].
def isobaric_expansion_g(self): r'''Isobaric (constant-pressure) expansion of the gas phase of the chemical at its current temperature and pressure, in units of [1/K]. .. math:: \beta = \frac{1}{V}\left(\frac{\partial V}{\partial T} \right)_P Utilizes the temperature-deriva...
r Joule Thomson coefficient of the chemical in the liquid phase at its current temperature and pressure in units of [ K/ Pa ].
def JTl(self): r'''Joule Thomson coefficient of the chemical in the liquid phase at its current temperature and pressure, in units of [K/Pa]. .. math:: \mu_{JT} = \left(\frac{\partial T}{\partial P}\right)_H = \frac{1}{C_p} \left[T \left(\frac{\partial V}{\partial T}\rig...
r Joule Thomson coefficient of the chemical in the gas phase at its current temperature and pressure in units of [ K/ Pa ].
def JTg(self): r'''Joule Thomson coefficient of the chemical in the gas phase at its current temperature and pressure, in units of [K/Pa]. .. math:: \mu_{JT} = \left(\frac{\partial T}{\partial P}\right)_H = \frac{1}{C_p} \left[T \left(\frac{\partial V}{\partial T}\right)...
r Kinematic viscosity of the liquid phase of the chemical at its current temperature and pressure in units of [ m^2/ s ].
def nul(self): r'''Kinematic viscosity of the liquid phase of the chemical at its current temperature and pressure, in units of [m^2/s]. .. math:: \nu = \frac{\mu}{\rho} Utilizes the temperature and pressure dependent object oriented interfaces :obj:`thermo.volume.V...
r Kinematic viscosity of the gas phase of the chemical at its current temperature and pressure in units of [ m^2/ s ].
def nug(self): r'''Kinematic viscosity of the gas phase of the chemical at its current temperature and pressure, in units of [m^2/s]. .. math:: \nu = \frac{\mu}{\rho} Utilizes the temperature and pressure dependent object oriented interfaces :obj:`thermo.volume.Volu...
r Thermal diffusivity of the liquid phase of the chemical at its current temperature and pressure in units of [ m^2/ s ].
def alphal(self): r'''Thermal diffusivity of the liquid phase of the chemical at its current temperature and pressure, in units of [m^2/s]. .. math:: \alpha = \frac{k}{\rho Cp} Utilizes the temperature and pressure dependent object oriented interfaces :obj:`thermo.v...
r Thermal diffusivity of the gas phase of the chemical at its current temperature and pressure in units of [ m^2/ s ].
def alphag(self): r'''Thermal diffusivity of the gas phase of the chemical at its current temperature and pressure, in units of [m^2/s]. .. math:: \alpha = \frac{k}{\rho Cp} Utilizes the temperature and pressure dependent object oriented interfaces :obj:`thermo.volu...
r Prandtl number of the liquid phase of the chemical at its current temperature and pressure [ dimensionless ].
def Prl(self): r'''Prandtl number of the liquid phase of the chemical at its current temperature and pressure, [dimensionless]. .. math:: Pr = \frac{C_p \mu}{k} Utilizes the temperature and pressure dependent object oriented interfaces :obj:`thermo.viscosity.Viscosi...
r Prandtl number of the gas phase of the chemical at its current temperature and pressure [ dimensionless ].
def Prg(self): r'''Prandtl number of the gas phase of the chemical at its current temperature and pressure, [dimensionless]. .. math:: Pr = \frac{C_p \mu}{k} Utilizes the temperature and pressure dependent object oriented interfaces :obj:`thermo.viscosity.ViscosityG...
r Solubility parameter of the chemical at its current temperature and pressure in units of [ Pa^0. 5 ].
def solubility_parameter(self): r'''Solubility parameter of the chemical at its current temperature and pressure, in units of [Pa^0.5]. .. math:: \delta = \sqrt{\frac{\Delta H_{vap} - RT}{V_m}} Calculated based on enthalpy of vaporization and molar volume. Normally ...
r Parachor of the chemical at its current temperature and pressure in units of [ N^0. 25 * m^2. 75/ mol ].
def Parachor(self): r'''Parachor of the chemical at its current temperature and pressure, in units of [N^0.25*m^2.75/mol]. .. math:: P = \frac{\sigma^{0.25} MW}{\rho_L - \rho_V} Calculated based on surface tension, density of the liquid and gas phase, and molecular ...
r Mass heat capacity of the chemical at its current phase and temperature in units of [ J/ kg/ K ].
def Cp(self): r'''Mass heat capacity of the chemical at its current phase and temperature, in units of [J/kg/K]. Utilizes the object oriented interfaces :obj:`thermo.heat_capacity.HeatCapacitySolid`, :obj:`thermo.heat_capacity.HeatCapacityLiquid`, and :obj:`thermo.heat_c...
r Molar heat capacity of the chemical at its current phase and temperature in units of [ J/ mol/ K ].
def Cpm(self): r'''Molar heat capacity of the chemical at its current phase and temperature, in units of [J/mol/K]. Utilizes the object oriented interfaces :obj:`thermo.heat_capacity.HeatCapacitySolid`, :obj:`thermo.heat_capacity.HeatCapacityLiquid`, and :obj:`thermo.hea...
r Molar volume of the chemical at its current phase and temperature and pressure in units of [ m^3/ mol ].
def Vm(self): r'''Molar volume of the chemical at its current phase and temperature and pressure, in units of [m^3/mol]. Utilizes the object oriented interfaces :obj:`thermo.volume.VolumeSolid`, :obj:`thermo.volume.VolumeLiquid`, and :obj:`thermo.volume.VolumeGas` to per...
r Mass density of the chemical at its current phase and temperature and pressure in units of [ kg/ m^3 ].
def rho(self): r'''Mass density of the chemical at its current phase and temperature and pressure, in units of [kg/m^3]. Utilizes the object oriented interfaces :obj:`thermo.volume.VolumeSolid`, :obj:`thermo.volume.VolumeLiquid`, and :obj:`thermo.volume.VolumeGas` to per...
r Compressibility factor of the chemical at its current phase and temperature and pressure [ dimensionless ].
def Z(self): r'''Compressibility factor of the chemical at its current phase and temperature and pressure, [dimensionless]. Examples -------- >>> Chemical('MTBE', T=900, P=1E-2).Z 0.9999999999079768 ''' Vm = self.Vm if Vm: return Z(sel...
r Specific gravity of the chemical [ dimensionless ]. For gas - phase conditions this is calculated at 15. 6 °C ( 60 °F ) and 1 atm for the chemical and the reference fluid air. For liquid and solid phase conditions this is calculated based on a reference fluid of water at 4°C at 1 atm but the with the liquid or solid ...
def SG(self): r'''Specific gravity of the chemical, [dimensionless]. For gas-phase conditions, this is calculated at 15.6 °C (60 °F) and 1 atm for the chemical and the reference fluid, air. For liquid and solid phase conditions, this is calculated based on a referenc...
r Isobaric ( constant - pressure ) expansion of the chemical at its current phase and temperature in units of [ 1/ K ].
def isobaric_expansion(self): r'''Isobaric (constant-pressure) expansion of the chemical at its current phase and temperature, in units of [1/K]. .. math:: \beta = \frac{1}{V}\left(\frac{\partial V}{\partial T} \right)_P Examples -------- Radical change in ...
r Joule Thomson coefficient of the chemical at its current phase and temperature in units of [ K/ Pa ].
def JT(self): r'''Joule Thomson coefficient of the chemical at its current phase and temperature, in units of [K/Pa]. .. math:: \mu_{JT} = \left(\frac{\partial T}{\partial P}\right)_H = \frac{1}{C_p} \left[T \left(\frac{\partial V}{\partial T}\right)_P - V\right] ...
r Viscosity of the chemical at its current phase temperature and pressure in units of [ Pa * s ].
def mu(self): r'''Viscosity of the chemical at its current phase, temperature, and pressure in units of [Pa*s]. Utilizes the object oriented interfaces :obj:`thermo.viscosity.ViscosityLiquid` and :obj:`thermo.viscosity.ViscosityGas` to perform the actual calculation of e...
r Thermal conductivity of the chemical at its current phase temperature and pressure in units of [ W/ m/ K ].
def k(self): r'''Thermal conductivity of the chemical at its current phase, temperature, and pressure in units of [W/m/K]. Utilizes the object oriented interfaces :obj:`thermo.thermal_conductivity.ThermalConductivityLiquid` and :obj:`thermo.thermal_conductivity.ThermalConductivi...
r Kinematic viscosity of the the chemical at its current temperature pressure and phase in units of [ m^2/ s ].
def nu(self): r'''Kinematic viscosity of the the chemical at its current temperature, pressure, and phase in units of [m^2/s]. .. math:: \nu = \frac{\mu}{\rho} Examples -------- >>> Chemical('argon').nu 1.3846930410865003e-05 ''' retu...
r Thermal diffusivity of the chemical at its current temperature pressure and phase in units of [ m^2/ s ].
def alpha(self): r'''Thermal diffusivity of the chemical at its current temperature, pressure, and phase in units of [m^2/s]. .. math:: \alpha = \frac{k}{\rho Cp} Examples -------- >>> Chemical('furfural').alpha 8.696537158635412e-08 ''' ...
r Prandtl number of the chemical at its current temperature pressure and phase ; [ dimensionless ].
def Pr(self): r'''Prandtl number of the chemical at its current temperature, pressure, and phase; [dimensionless]. .. math:: Pr = \frac{C_p \mu}{k} Examples -------- >>> Chemical('acetone').Pr 4.183039103542709 ''' return phase_select...
r Poynting correction factor [ dimensionless ] for use in phase equilibria methods based on activity coefficients or other reference states. Performs the shortcut calculation assuming molar volume is independent of pressure.
def Poynting(self): r'''Poynting correction factor [dimensionless] for use in phase equilibria methods based on activity coefficients or other reference states. Performs the shortcut calculation assuming molar volume is independent of pressure. .. math:: \text{Poy...
r Calculates the difference between ITS - 90 and ITS - 68 scales using a series of models listed in [ 1 ] _ [ 2 ] _ and [ 3 ] _.
def ITS90_68_difference(T): r'''Calculates the difference between ITS-90 and ITS-68 scales using a series of models listed in [1]_, [2]_, and [3]_. The temperature difference is given by the following equations: From 13.8 K to 73.15 K: .. math:: T_{90} - T_{68} = a_0 + \sum_{i=1}^{12} a_i...
r Converts the a temperature reading made in any of the scales ITS - 90 ITS - 68 ITS - 48 ITS - 76 or ITS - 27 to any of the other scales. Not all temperature ranges can be converted to other ranges ; for instance ITS - 76 is purely for low temperatures and 5 K on it has no conversion to ITS - 90 or any other scale. Bo...
def T_converter(T, current, desired): r'''Converts the a temperature reading made in any of the scales 'ITS-90', 'ITS-68','ITS-48', 'ITS-76', or 'ITS-27' to any of the other scales. Not all temperature ranges can be converted to other ranges; for instance, 'ITS-76' is purely for low temperatures, and 5 ...
r This function handles the retrieval of a chemical s Global Warming Potential relative to CO2. Lookup is based on CASRNs. Will automatically select a data source to use if no Method is provided ; returns None if the data is not available.
def GWP(CASRN, AvailableMethods=False, Method=None): r'''This function handles the retrieval of a chemical's Global Warming Potential, relative to CO2. Lookup is based on CASRNs. Will automatically select a data source to use if no Method is provided; returns None if the data is not available. Retu...
r This function handles the retrieval of a chemical s Ozone Depletion Potential relative to CFC - 11 ( trichlorofluoromethane ). Lookup is based on CASRNs. Will automatically select a data source to use if no Method is provided ; returns None if the data is not available.
def ODP(CASRN, AvailableMethods=False, Method=None): r'''This function handles the retrieval of a chemical's Ozone Depletion Potential, relative to CFC-11 (trichlorofluoromethane). Lookup is based on CASRNs. Will automatically select a data source to use if no Method is provided; returns None if the dat...
r This function handles the retrieval of a chemical s octanol - water partition coefficient. Lookup is based on CASRNs. Will automatically select a data source to use if no Method is provided ; returns None if the data is not available.
def logP(CASRN, AvailableMethods=False, Method=None): r'''This function handles the retrieval of a chemical's octanol-water partition coefficient. Lookup is based on CASRNs. Will automatically select a data source to use if no Method is provided; returns None if the data is not available. Parameter...
r Calculates vapor pressure of a chemical using the Antoine equation. Parameters A B and C are chemical - dependent. Parameters can be found in numerous sources ; however units of the coefficients used vary. Originally proposed by Antoine ( 1888 ) [ 2 ] _.
def Antoine(T, A, B, C, base=10.0): r'''Calculates vapor pressure of a chemical using the Antoine equation. Parameters `A`, `B`, and `C` are chemical-dependent. Parameters can be found in numerous sources; however units of the coefficients used vary. Originally proposed by Antoine (1888) [2]_. .. ...
r Calculates vapor pressure of a chemical using the TRC Extended Antoine equation. Parameters are chemical dependent and said to be from the Thermodynamics Research Center ( TRC ) at Texas A&M. Coefficients for various chemicals can be found in [ 1 ] _.
def TRC_Antoine_extended(T, Tc, to, A, B, C, n, E, F): r'''Calculates vapor pressure of a chemical using the TRC Extended Antoine equation. Parameters are chemical dependent, and said to be from the Thermodynamics Research Center (TRC) at Texas A&M. Coefficients for various chemicals can be found in [1...
r Calculates vapor pressure using the Wagner equation ( 3 6 form ).
def Wagner_original(T, Tc, Pc, a, b, c, d): r'''Calculates vapor pressure using the Wagner equation (3, 6 form). Requires critical temperature and pressure as well as four coefficients specific to each chemical. .. math:: \ln P^{sat}= \ln P_c + \frac{a\tau + b \tau^{1.5} + c\tau^3 + d\tau^6} ...
r Calculates vapor pressure of a fluid at arbitrary temperatures using a CSP relationship as in [ 1 ] _ ; requires a chemical s critical temperature and pressure as well as boiling point.
def boiling_critical_relation(T, Tb, Tc, Pc): r'''Calculates vapor pressure of a fluid at arbitrary temperatures using a CSP relationship as in [1]_; requires a chemical's critical temperature and pressure as well as boiling point. The vapor pressure is given by: .. math:: \ln P^{sat}_r = ...
r Calculates vapor pressure of a fluid at arbitrary temperatures using a CSP relationship by [ 1 ] _ ; requires a chemical s critical temperature and acentric factor.
def Lee_Kesler(T, Tc, Pc, omega): r'''Calculates vapor pressure of a fluid at arbitrary temperatures using a CSP relationship by [1]_; requires a chemical's critical temperature and acentric factor. The vapor pressure is given by: .. math:: \ln P^{sat}_r = f^{(0)} + \omega f^{(1)} ...
r Calculates vapor pressure of a fluid at arbitrary temperatures using a CSP relationship by [ 1 ] _ ; requires a chemical s critical temperature and acentric factor.
def Ambrose_Walton(T, Tc, Pc, omega): r'''Calculates vapor pressure of a fluid at arbitrary temperatures using a CSP relationship by [1]_; requires a chemical's critical temperature and acentric factor. The vapor pressure is given by: .. math:: \ln P_r=f^{(0)}+\omega f^{(1)}+\omega^2f^{(2)...
r Calculates vapor pressure of a fluid at arbitrary temperatures using a CSP relationship by [ 1 ] _. Requires a chemical s critical temperature pressure and acentric factor. Although developed for refrigerants this model should have some general predictive ability.
def Sanjari(T, Tc, Pc, omega): r'''Calculates vapor pressure of a fluid at arbitrary temperatures using a CSP relationship by [1]_. Requires a chemical's critical temperature, pressure, and acentric factor. Although developed for refrigerants, this model should have some general predictive ability. ...
r Calculates vapor pressure of a fluid at arbitrary temperatures using a CSP relationship by [ 1 ] _. Requires a chemical s critical temperature pressure and acentric factor. Claimed to have a higher accuracy than the Lee - Kesler CSP relationship.
def Edalat(T, Tc, Pc, omega): r'''Calculates vapor pressure of a fluid at arbitrary temperatures using a CSP relationship by [1]_. Requires a chemical's critical temperature, pressure, and acentric factor. Claimed to have a higher accuracy than the Lee-Kesler CSP relationship. The vapor pressure of...
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 and: obj: all_methods as a set of methods for which the data exists for.
def load_all_methods(self): 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`, and :obj:`all_methods` as a set of methods for which t...
r Method to calculate vapor pressure of a fluid at temperature T with a given method.
def calculate(self, T, method): r'''Method to calculate vapor pressure of a fluid at temperature `T` with a given method. This method has no exception handling; see `T_dependent_property` for that. Parameters ---------- T : float Temperature at calcu...
r Function to calculate a_alpha and optionally its first and second derivatives for the TWUPR or TWUSRK EOS. Returns a_alpha and optionally da_alpha_dT and d2a_alpha_dT2. Used by TWUPR and TWUSRK ; has little purpose on its own. See either class for the correct reference and examples of using the EOS.
def TWU_a_alpha_common(T, Tc, omega, a, full=True, quick=True, method='PR'): r'''Function to calculate `a_alpha` and optionally its first and second derivatives for the TWUPR or TWUSRK EOS. Returns 'a_alpha', and optionally 'da_alpha_dT' and 'd2a_alpha_dT2'. Used by `TWUPR` and `TWUSRK`; has little pur...
Method to an exception if none of the pairs ( T P ) ( T V ) or ( P V ) are given.
def check_sufficient_inputs(self): '''Method to an exception if none of the pairs (T, P), (T, V), or (P, V) are given. ''' if not ((self.T and self.P) or (self.T and self.V) or (self.P and self.V)): raise Exception('Either T and P, or T and V, or P and V are required')
First EOS - generic method ; should be called by all specific EOSs. For solving for T the EOS must provide the method solve_T. For all cases the EOS must provide a_alpha_and_derivatives. Calls set_from_PT once done.
def solve(self): '''First EOS-generic method; should be called by all specific EOSs. For solving for `T`, the EOS must provide the method `solve_T`. For all cases, the EOS must provide `a_alpha_and_derivatives`. Calls `set_from_PT` once done. ''' self.check_sufficient_inp...
Counts the number of real volumes in Vs and determines what to do. If there is only one real volume the method set_properties_from_solution is called with it. If there are two real volumes set_properties_from_solution is called once with each volume. The phase is returned by set_properties_from_solution and the volumes...
def set_from_PT(self, Vs): '''Counts the number of real volumes in `Vs`, and determines what to do. If there is only one real volume, the method `set_properties_from_solution` is called with it. If there are two real volumes, `set_properties_from_solution` is called once with ...
r Sets all interesting properties which can be calculated from an EOS alone. Determines which phase the fluid is on its own ; for details see phase_identification_parameter. The list of properties set is as follows with all properties suffixed with _l or _g. dP_dT dP_dV dV_dT dV_dP dT_dV dT_dP d2P_dT2 d2P_dV2 d2V_dT2 d...
def set_properties_from_solution(self, T, P, V, b, delta, epsilon, a_alpha, da_alpha_dT, d2a_alpha_dT2, quick=True): r'''Sets all interesting properties which can be calculated from an EOS alone. Determines which phase the fluid is on its own; for details, s...
Generic method to calculate T from a specified P and V. Provides SciPy s newton solver and iterates to solve the general equation for P recalculating a_alpha as a function of temperature using a_alpha_and_derivatives each iteration.
def solve_T(self, P, V, quick=True): '''Generic method to calculate `T` from a specified `P` and `V`. Provides SciPy's `newton` solver, and iterates to solve the general equation for `P`, recalculating `a_alpha` as a function of temperature using `a_alpha_and_derivatives` each iteration....
r Solution of this form of the cubic EOS in terms of volumes. Returns three values all with some complex part.
def volume_solutions(T, P, b, delta, epsilon, a_alpha, quick=True): r'''Solution of this form of the cubic EOS in terms of volumes. Returns three values, all with some complex part. Parameters ---------- T : float Temperature, [K] P : float Pres...
r Generic method to calculate vapor pressure for a specified T. From Tc to 0. 32Tc uses a 10th order polynomial of the following form:.. math:: \ ln \ frac { P_r } { T_r } = \ sum_ { k = 0 } ^ { 10 } C_k \ left ( \ frac { \ alpha } { T_r } - 1 \ right ) ^ { k } If polish is True SciPy s newton solver is launched with t...
def Psat(self, T, polish=False): r'''Generic method to calculate vapor pressure for a specified `T`. From Tc to 0.32Tc, uses a 10th order polynomial of the following form: .. math:: \ln\frac{P_r}{T_r} = \sum_{k=0}^{10} C_k\left(\frac{\alpha}{T_r} -1\righ...
r Generic method to calculate the temperature derivative of vapor pressure for a specified T. Implements the analytical derivative of the two polynomials described in Psat. As with Psat results above the critical temperature are meaningless. The first - order polynomial which is used to calculate it under 0. 32 Tc may ...
def dPsat_dT(self, T): r'''Generic method to calculate the temperature derivative of vapor pressure for a specified `T`. Implements the analytical derivative of the two polynomials described in `Psat`. As with `Psat`, results above the critical temperature are meaningless. ...
r Method to calculate molar volume of the liquid phase along the saturation line. Parameters ---------- T: float Temperature [ K ]
def V_l_sat(self, T): r'''Method to calculate molar volume of the liquid phase along the saturation line. Parameters ---------- T : float Temperature, [K] Returns ------- V_l_sat : float Liquid molar volume along the satur...
r Method to calculate molar volume of the vapor phase along the saturation line. Parameters ---------- T: float Temperature [ K ]
def V_g_sat(self, T): r'''Method to calculate molar volume of the vapor phase along the saturation line. Parameters ---------- T : float Temperature, [K] Returns ------- V_g_sat : float Gas molar volume along the saturatio...
r Method to calculate enthalpy of vaporization for a pure fluid from an equation of state without iteration... math:: \ frac { dP^ { sat }} { dT } = \ frac { \ Delta H_ { vap }} { T ( V_g - V_l ) } Results above the critical temperature are meaningless. A first - order polynomial is used to extrapolate under 0. 32 Tc ;...
def Hvap(self, T): r'''Method to calculate enthalpy of vaporization for a pure fluid from an equation of state, without iteration. .. math:: \frac{dP^{sat}}{dT}=\frac{\Delta H_{vap}}{T(V_g - V_l)} Results above the critical temperature are meaningless. A fir...
r Method to calculate a_alpha and its first and second derivatives according to Heyen ( 1980 ) [ 1 ] _. Returns a_alpha da_alpha_dT and d2a_alpha_dT2. See GCEOS. a_alpha_and_derivatives for more documentation. Two coefficients needed... math:: \ alpha = e^ { c_ { 1 } \ left ( - \ left ( \ frac { T } { Tc } \ right ) ^ ...
def Heyen(self, T, full=True, quick=True): r'''Method to calculate `a_alpha` and its first and second derivatives according to Heyen (1980) [1]_. Returns `a_alpha`, `da_alpha_dT`, and `d2a_alpha_dT2`. See `GCEOS.a_alpha_and_derivatives` for more documentation. Two coefficients needed....