def SolidContent(self): sc = 0 for i, component in enumerate(self._Components): if che(component, T=self.Temperature, P=self.Pressure).phase == 's' or che( component, T=self.Temperature, P=self.Pressure).phase is None: sc += self.MassFractions[i] return sc
def LiquidContent(self): lc = 0 for i, component in enumerate(self._Components): if che(component, T=self.Temperature, P=self.Pressure).phase == 'l': lc += self.MassFractions[i] return lc
def SolidComponents(self): solid_list = [] for component in self._Components: if che(component, T=self.Temperature, P=self.Pressure).phase == 's': solid_list.append(component) return solid_list
def GasContent(self): gc = 0 for i, component in enumerate(self._Components): if che(component, T=self.Temperature, P=self.Pressure).phase == 'g': gc += self.MassFractions[i] return gc
def LiquidComponents(self): liquid_list = [] for component in self._Components: if che(component, T=self.Temperature, P=self.Pressure).phase == 'l': liquid_list.append(component) return liquid_list
def GasComponents(self): gas_list = [] for component in self._Components: if che(component, T=self.Temperature, P=self.Pressure).phase == 'g': gas_list.append(component) return gas_list
def SolidFractions(self): sf = [] for i, component in enumerate(self._Components): if che(component, T=self.Temperature, P=self.Pressure).phase == 's': sf.append(self.MassFractions[i]) sf = [sfi / sum(sf) for sfi in sf] return sf
def LiquidFractions(self): lf = [] for i, component in enumerate(self._Components): if che(component, T=self.Temperature, P=self.Pressure).phase == 'l': lf.append(self.MassFractions[i]) lf = [lfi / sum(lf) for lfi in lf] return lf
def GasFractions(self): gf = [] for i, component in enumerate(self._Components): if che(component, T=self.Temperature, P=self.Pressure).phase == 'g': gf.append(self.MassFractions[i]) gf = [gfi / sum(gf) for gfi in gf] return gf
def SolidDensity(self): if self.SolidContent > 0: rho = mix(self.SolidComponents, ws=self.SolidFractions, T=self.Temperature, P=self.Pressure).rho if rho is None: rho = 0 for i, c in enumerate(self.SolidComponents): rho += self.SolidFractions[i] / che(c).rhos return 1 / rho else: return mix(self.SolidComponents, ws=self.SolidFractions, T=self.Temperature, P=self.Pressure).rho else: return 'not a solid!'
def Densities(self): values = [ che(i, T=self.Temperature, P=self.Pressure).rho for i in self._Components ] return OrderedDict(zip(self._Components, values))