Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def set_phase(self):
try:
self.phase_methods = identify_phase_mixture(T=self.T, P=self.P, zs=self.zs, Tcs=self.Tcs, Pcs=self.Pcs, Psats=self.Psats, CASRNs=self.CASs, AvailableMethods=True)
self.phase_method = self.phase_methods[0]
self.phase, self.xs, self.ys, self.V_over_F = identify_phase_mixture(T=self.T, P=self.P, zs=self.zs, Tcs=self.Tcs, Pcs=self.Pcs, Psats=self.Psats, CASRNs=self.CASs, Method=self.phase_method)
if self.phase == 'two-phase':
self.wsl = zs_to_ws(self.xs, self.MWs)
self.wsg = zs_to_ws(self.ys, self.MWs)
ng = self.V_over_F
nl = (1. - self.V_over_F)
self.MWl = mixing_simple(self.xs, self.MWs)
self.MWg = mixing_simple(self.ys, self.MWs)
self.x = self.quality = ng*self.MWg/(nl*self.MWl + ng*self.MWg)
self.Pbubble_methods = Pbubble_mixture(T=self.T, zs=self.zs, Psats=self.Psats, CASRNs=self.CASs, AvailableMethods=True)
self.Pbubble_method = self.Pbubble_methods[0]
self.Pbubble = Pbubble_mixture(T=self.T, zs=self.zs, Psats=self.Psats, CASRNs=self.CASs, Method=self.Pbubble_method)
self.Pdew_methods = Pdew_mixture(T=self.T, zs=self.zs, Psats=self.Psats, CASRNs=self.CASs, AvailableMethods=True)
def set_phase(self):
try:
self.phase_methods = identify_phase_mixture(T=self.T, P=self.P, zs=self.zs, Tcs=self.Tcs, Pcs=self.Pcs, Psats=self.Psats, CASRNs=self.CASs, AvailableMethods=True)
self.phase_method = self.phase_methods[0]
self.phase, self.xs, self.ys, self.V_over_F = identify_phase_mixture(T=self.T, P=self.P, zs=self.zs, Tcs=self.Tcs, Pcs=self.Pcs, Psats=self.Psats, CASRNs=self.CASs, Method=self.phase_method)
if self.phase == 'two-phase':
self.wsl = zs_to_ws(self.xs, self.MWs)
self.wsg = zs_to_ws(self.ys, self.MWs)
ng = self.V_over_F
nl = (1. - self.V_over_F)
self.MWl = mixing_simple(self.xs, self.MWs)
self.MWg = mixing_simple(self.ys, self.MWs)
self.x = self.quality = ng*self.MWg/(nl*self.MWl + ng*self.MWg)
self.Pbubble_methods = Pbubble_mixture(T=self.T, zs=self.zs, Psats=self.Psats, CASRNs=self.CASs, AvailableMethods=True)
self.Pbubble_method = self.Pbubble_methods[0]
self.Pbubble = Pbubble_mixture(T=self.T, zs=self.zs, Psats=self.Psats, CASRNs=self.CASs, Method=self.Pbubble_method)