Exemplo n.º 1
0
 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
Exemplo n.º 2
0
 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
Exemplo n.º 3
0
 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
Exemplo n.º 4
0
 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
Exemplo n.º 5
0
 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
Exemplo n.º 6
0
 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
Exemplo n.º 7
0
 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
Exemplo n.º 8
0
 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
Exemplo n.º 9
0
 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
Exemplo n.º 10
0
 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!'
Exemplo n.º 11
0
 def Densities(self):
     values = [
         che(i, T=self.Temperature, P=self.Pressure).rho
         for i in self._Components
     ]
     return OrderedDict(zip(self._Components, values))