Ejemplo n.º 1
0
 def __init__(self,
              identifier='1.4301',
              latex=None,
              comment='X5CrNi18-10, AISI 304'):
     super().__init__(identifier, latex=latex, comment=comment)
     self.T.ref = C2K(20)
     self.T_sol = C2K(1400)
     self.E.calc = lambda T=0., p=0., x=0.: 200e+9
     self.beta.calc = lambda T=0., p=0., x=0.: 17.5e-6
     self.c_p.calc = lambda T=0., p=0., x=0.: 500.
     self.k.calc = lambda T=0., p=0., x=0.: 15.
     self.rho.calc = lambda T=0., p=0., x=0.: 7900.
Ejemplo n.º 2
0
    def __init__(self, identifier='Fe', latex=None, comment=None):
        """
        Args:
            identifier (string, optional):
                identifier of matter

            latex (string, optional):
                Latex-version of identifier. If None, identifier is assigned

            comment (string, optional):
                comment on matter

        Reference:
            - Heat capacity c_p^* = 41.8 [J/(mol K)] for pure iron in
              T-range 1809..1873 K, data from:
              Kubaschewski,O., Alcock,C.B.: Metallurgical thermochemistry
              (5th Edn.), Pergamon Press, Oxford, 1979, p.336, in: [IIDA93]
            - Atomic weight of pure iron: M = 55.85 kg/kmol
            - Mass-specific heat capacity of Fe:
              c_p =c_p^* / M = 41.8 * (1000 / 55.85) = 748.4 [J/(kg K)]
        """
        # calls firstly: Solid.__init__() and secondly: Liquid.__init__()
        super().__init__(identifier, latex=latex, comment=comment)

        self.version = '110118_dww'
        self.T.ref = C2K(20)

        self.nu_mech = None
        self.friction = None
        self.E.calc = lambda T=0, p=0, x=0: 211e9

        self.T_sol = C2K(1430)
        self.T_liq = self.T_sol + 50
        self.T_vap = C2K(2700)
        self.T_deform = self.T_sol + 0.66 * (self.T_liq - self.T_sol)
        self.h_melt = 270e+3
        self.h_vap = 6.35e+6
        self.beta.calc = lambda T=0, p=0, x=0: 23.1e-6
        self.work_function = 4.3  # JAP Vol6 1973 p.2250 [QUIG73]

        self.c_p.calc = self._c_p
        self.k.calc = self._k
        self.M.calc = lambda T=0, p=0, x=0: 55.845e-3
        self.mu.calc = self._mu
        self.nu.calc       = lambda T=0, p=0, x=0: self.mu(T, p, x) / \
                                                  self.rho(T, p, x)
        self.rho.calc = self._rho
        self.rho_el.calc = self._rho_el
Ejemplo n.º 3
0
    def _rho_el(self,
                T: float = C2K(20),
                p: float = atm(),
                x: float = 0.) -> float:
        """
        Reference:
            Rykalin, in Radaj: Heat Effects of Welding, Springer 1992, p.68
            T[deg C]  rho [Ohm*mm]
            0         1.26e-4
            400       4e-4
            800       10.2e-4
            1200      12e-4
            1600      12.6e-4
        """
        T_Celsius = max(K2C(T), 20.)

        # specific resistance in [Ohm m]
        if T_Celsius < 800:
            rho_el = (
                (1.081e-8 * T_Celsius + 2.53e-6) * T_Celsius + 1.26e-3) * 1e-4
        elif T < self.T_sol:
            rho_el = (
                (-3.75e-9 * T_Celsius + 1.2e-5) * T_Celsius + 3e-3) * 1e-4
        else:
            rho_el = 2 * 1.2e-6
        return rho_el
Ejemplo n.º 4
0
    def __init__(self, identifier: str = 'gas',
                 latex: Optional[str] = None,
                 comment: Optional[str] = None) -> None:
        """
        Args:
            identifier:
                Identifier of matter

            latex:
                Latex-version of identifier. If None, identical with identifier

            comment:
                Comment on matter

        Note:
            Do NOT define a self.__call__() method in this class
        """
        super().__init__(identifier=identifier, latex=latex, comment=comment)

        # self.a.calc = self._a
        self.D_in_air = Property('D_in_air', 'm2/s', 
                                 calc=lambda T, p=atm(), x=0.: None)
        self.T.ref = C2K(15.)        


        
Ejemplo n.º 5
0
 def __init__(self, identifier='1.4362', latex=None, comment='X2CrNiN23-4'):
     super().__init__(identifier, latex=latex, comment=comment)
     self.T.ref = C2K(20)
     self.T_sol = None
     self.E.calc = lambda T=0, p=0, x=0: 200e+9
     self.beta.calc = lambda T=0, p=0, x=0: 17.5e-6
     self.c_p.calc = lambda T=0, p=0, x=0: 500.
     self.k.calc = lambda T=0, p=0, x=0: 15.
     self.rho.calc = lambda T=0, p=0, x=0: 7800.
Ejemplo n.º 6
0
 def __init__(self, identifier='1.4003', latex=None, comment='X2CrNi12'):
     super().__init__(identifier, latex=latex, comment=comment)
     self.T.ref = C2K(20)
     self.T_sol = None
     self.E.calc = lambda T=0., p=0., x=0.: 220e+9
     self.beta.calc = lambda T=0., p=0., x=0.: 11.6e-6
     self.c_p.calc = lambda T=0., p=0., x=0.: 430.
     self.k.calc = lambda T=0., p=0., x=0.: 25.
     self.rho.calc = lambda T=0., p=0., x=0.: 7700.
Ejemplo n.º 7
0
    def __init__(self, identifier: str = 'matter',
                 latex: Optional[str] = None,
                 comment: Optional[str] = None) -> None:
        """
        Args:
            identifier:
                Identifier of matter

            latex:
                Latex-version of identifier. 
                If None, latex is identical with identifier

            comment:
                Comment on matter

        Note:
            Do NOT define a self.__call__() method in this class
        """
        super().__init__(identifier=identifier, latex=latex, comment=comment)

        self.a = Property('a', 'm$^2$/s', comment='thermal diffusity',
                          calc = self._a)        
        self.beta = Property('beta', '1/K', latex=r'$\beta_{th}$',
                             comment='volumetric thermal expansion')
        self.c_p = Property('c_p', 'J/kg/K',
                            comment='specific heat capacity')
        self.c_sound = Property('c_sound', 'm/s', latex='$c_{sound}$')
        self.c_sound.calc = lambda T, p, x: None
        self.composition: Dict[str, float] = OrderedDict()
        self.compressible: bool = False
        self.E = Property('E', 'Pa', comment="Young's (elastic) modulus")
        self.h_melt: float = None
        self.h_vap: float = None
        self.k = Property('k', 'W/m/K', latex='$k$',
                                comment='thermal conductivity')
        self.M = Property('M', 'kmol/kg', comment='molar mass')
        self.M.calc = lambda T=0, p=0, x=0: None
        self.nu_mech: float = None
        self.rho = Property('rho', 'kg/m$^3$', latex=r'$\varrho$', ref=1.,
                            comment='density')
        self.rho.T.ref = C2K(20.)
        self.rho.p.ref = atm()
        self.rho_el = Property('rho_el', r'$\Omega$', latex=r'$\varrho_{el}$',
                               comment='electric resistance')
        self.T_boil: float = 0.
        self.T_flash_point: float = 0.
        self.T_liq: float = 0.
        self.T_melt: float = 0.
        self.T_sol: float = 0.

        if self.E() is None or np.abs(self.E()) < 1e-20:
            self.rho.calc = lambda T, p, x: self.rho.ref \
                / (1. + (T - self.rho.T.ref) * self.beta())
        else:
            self.rho.calc = lambda T, p, x: self.rho.ref \
                / (1. + (T - self.rho.T.ref) * self.beta()) \
                / (1. - (p - self.rho.p.ref) / self.E())
Ejemplo n.º 8
0
 def _rho(self, T, p=1e5, x=0):
     Tp = C2K(np.array([20, 40, 60, 80, 100]))
     Pp = np.array([0.1, 10.1, 20.1]) * 1e6
     Up = np.array([[874.5, 879.7, 884.6],
                    [862.1, 867.8, 873.1],
                    [849.8, 855.8, 861.6],
                    [837.4, 843.9, 850.1],
                    [825.0, 832.0, 838.6]]).T
     f = interp2d(Tp, Pp, Up)
     return f(T, p)
Ejemplo n.º 9
0
 def _c_p(self, T, p=1e5, x=0):
     Tp = C2K(np.array([20, 40, 60, 80, 100]))
     Pp = np.array([0.1, 10.1, 20.1]) * 1e6
     Up = np.array([[1939.6, 1936.4, 1933.4],
                    [2028.2, 2024.7, 2021.4],
                    [2116.9, 2112.9, 2110.0],
                    [2205.5, 2201.1, 2197.2],
                    [2294.2, 2289.3, 2284.9]]).T
     f = interp2d(Tp, Pp, Up)
     return f(T, p)
Ejemplo n.º 10
0
    def __init__(self,
                 identifier: str = 'Property',
                 unit: str = '/',
                 absolute: bool = True,
                 latex: Optional[str] = None,
                 val: Optional[Union[float, Iterable[float]]] = None,
                 ref: Optional[Union[float, Iterable[float]]] = None,
                 comment: Optional[str] = None,
                 calc: Optional[Callable[..., float]] = None) -> None:

        super().__init__(identifier=identifier,
                         unit=unit,
                         absolute=absolute,
                         latex=latex,
                         val=val,
                         ref=ref,
                         comment=comment)

        # reference temperature gases: 15C, solids: 20C or 25C, liquids: 20C
        T_Celsius = 20.

        self.T = Parameter(identifier='T', unit='K', absolute=True)
        self.T.ref = C2K(T_Celsius)
        self.T['operational'] = Range(C2K(-40.), C2K(200.))
        self.T.accuracy = Range('-1', '+1')

        self.p = Parameter(identifier='p', unit='Pa', absolute=True)
        self.p.ref = atm()
        self.p['operational'] = Range(0. + self.p.ref, 100e5 + self.p.ref)
        self.p.accuracy = Range('-1%FS', '+1%FS')

        self.x = Parameter(identifier='x', unit='/', absolute=True)
        self.x['operational'] = Range(0., 1.)
        self.x.ref = 0.

        self.accuracy = Range('-1%', '1%')
        self.repeatability = Range('-0.1', '+0.1', '95%')

        if calc is None:
            calc = lambda T, p, x: 1.
        self.calc = calc

        self.regression_coefficients: Optional[Iterable[float]] = None
Ejemplo n.º 11
0
 def _mu(self,
         T: float = C2K(20),
         p: float = atm(),
         x: float = 0.) -> float:
     """
     [JONE96]: eta = eta0 * exp(E / (R*T)), eta0 = 0.3699e-3 kg/(m s),
               E = 41.4e3 J/mol, and R = 8.3144 J/(K mol)
     """
     return 0.3699e-3 * np.exp(41.4e3 / (8.3144*T)) \
         if T > self.T_deform else 1e20
Ejemplo n.º 12
0
    def __init__(self, identifier: str='water',
                 latex: Optional[str]='$H_2O$',
                 comment: Optional[str]=None) -> None:
        """
        Args:
            identifier:
                identifier of matter

            latex:
                Latex-version of identifier. 
                If None, latex is identical with identifier

            comment:
                comment on matter
        """
        super().__init__(identifier=identifier, latex=latex, comment=comment)
        self.version = '301017_dww'

        # reference point and operational range
        self.T.operational = Range(C2K(0), C2K(100))
        self.T.ref = C2K(15)
        self.T.val = self.T.ref
        self.p.operational = Range(0. + atm(), 100e5 + atm())
        self.p.ref = atm()
        self.p.val = self.p.ref

        # constants
        self.hMelt = 334.0e3
        self.hVap = 2270.0e3
        self.T_liq = C2K(0.0)
        self.T_boil = C2K(99.9839)
        self.composition['H2O'] = 100.

        # functions of temperature, pressure and spare parameter 'x'
        self.rho.calc     = self._rho
        self.nu.calc      = self._nu
        self.mu.calc      = self._mu
        self.c_p.calc     = self._c_p
        self.k.calc = self._k
        self.c_sound.calc = self._c_sound
        self.E.calc       = self._E
Ejemplo n.º 13
0
 def __init__(self,
              identifier='1.4401',
              latex=None,
              comment='X5CrNiMo17-12-2'):
     super().__init__(identifier, latex=latex, comment=comment)
     self.T.ref = C2K(20)
     self.T_sol = None
     self.E.calc = lambda T=0., p=0., x=0.: 200e+9
     self.beta.calc = lambda T=0., p=0., x=0.: 17.5e-6
     self.c_p.calc = lambda T=0., p=0., x=0.: 500.
     self.k.calc = lambda T=0., p=0., x=0.: 15.
     self.rho.calc = lambda T=0., p=0., x=0.: 8000.
Ejemplo n.º 14
0
 def __init__(self,
              identifier='1.4541',
              latex=None,
              comment='X6CrNiTi18-10'):
     super().__init__(identifier, latex=latex, comment=None)
     self.T.ref = C2K(20)
     self.T_sol = None
     self.E.calc = lambda T=0., p=0., x=0.: 200e+9
     self.beta.calc = lambda T=0., p=0., x=0.: 17.5e-6
     self.c_p.calc = lambda T=0., p=0., x=0.: 500.
     self.k.calc = lambda T=0., p=0., x=0.: 15.
     self.rho.calc = lambda T=0., p=0., x=0.: 7900.
Ejemplo n.º 15
0
 def __init__(self,
              identifier='1.4571',
              latex=None,
              comment='X6CrNiMoTi17-12-2'):
     super().__init__(identifier, latex=latex, comment=comment)
     self.T.ref = C2K(20)
     self.T_sol = None
     self.E.calc = lambda T=0, p=0, x=0: 200e+9
     self.beta.calc = lambda T=0, p=0, x=0: 18.5e-6
     self.c_p.calc = lambda T=0, p=0, x=0: 500
     self.k.calc = lambda T=0, p=0, x=0: 15
     self.rho.calc = lambda T=0, p=0, x=0: 8000
Ejemplo n.º 16
0
    def __init__(self, identifier: str='hydraulic_oil',
                 latex: Optional[str]=None,
                 comment: Optional[str]=None) -> None:
        super().__init__(identifier=identifier)
        """
        Args:
            identifier:
                identifier of matter

            latex:
                Latex-version of identifier. 
                If None, latex is identical with identifier

            comment:
                comment on matter
        """
        super().__init__(identifier=identifier, latex=latex, comment=comment)
        self.version = '160118_dww'

        # reference point and operational range
        self.T.operational = Range(C2K(0), C2K(100))
        self.T.ref = C2K(15)
        self.T.val = self.T.ref
        self.p.operational = Range(0. + atm(), 100e5 + atm())
        self.p.ref = atm()
        self.p.val = self.p.ref

        # constants
#        self.hMelt =
#        self.hVap =
#        self.T_liq = C2K(  )
#        self.T_boil = C2K(   )
        self.composition['C12H24'] = 100  # TODO

        # functions of temperature, pressure and spare parameter 'x'
        self.rho.calc = self._rho
        self.nu.calc = self._nu
        self.mu.calc = self._mu
        self.c_p.calc = self._c_p
        self.k.calc = self._k
Ejemplo n.º 17
0
 def _c_p(self,
          T: float = C2K(20),
          p: float = atm(),
          x: float = 0.) -> float:
     Tp = [
         300, 600, 900, 1033, 1040, 1184, 1184.1, 1400, 1673, 1673.1, 1809,
         1809.1, 2000, 3000
     ]
     Up = [
         430, 580, 760, 1260, 1160, 720, 610, 640, 680, 730, 760, 790, 790,
         790
     ]
     return np.interp(T, Tp, Up)
Ejemplo n.º 18
0
    def __init__(self,
                 identifier: str = 'Ryton',
                 latex: Optional[str] = None,
                 comment: Optional[str] = None) -> None:
        """
        Args:
            identifier:
                identifier of matter

            latex:
                Latex-version of identifier. If None, identifier is assigned

            comment:
                comment on matter
        """
        super().__init__(identifier, latex=latex, comment=comment)

        self.version = '240817_dww'
        if comment is None:
            self.comment = 'Ryton R-4-230 40% fiberglass reinforced ' + \
                           'polyphenylene sulfide resins'
        self.T.ref = C2K(20)

        self.nu_mech = 0.38  # TODO from Solvay Spec. Polymers Ryton R-4
        self.friction = 0.5
        self.R_compr.calc = lambda T=0, p=0, x=0: 0 * K2C(T) + 268e6

        self.E.calc = lambda T=0, p=0, x=0: 14.5e+9
        self.beta.calc = lambda T=0, p=0, x=0: 15e-6
        self.c_p.calc = lambda T=0, p=0, x=0: 1000
        # TODO difference between c_p of reference [2]:1003 and [3]:1000
        self.k.calc = lambda T=0, p=0, x=0: 3.63
        self.rho.calc = lambda T=0, p=0, x=0: 1680
        self.rho_el.calc = lambda T=0, p=0, x=0: 1e+12

        self.T_melt = (C2K(1399), C2K(1454))
Ejemplo n.º 19
0
 def _rho(self,
          T: float = C2K(20),
          p: float = atm(),
          x: float = 0.) -> float:
     """
     Reference for liquid iron:
     Steinberg, D. J.: Met. Trans. 5 (1974), 1341, in [Iida93]
     """
     T_Celsius = min(K2C(T), 1600)
     if T_Celsius > 1536:
         rho = 7030 + (-8.8e-1) * (T_Celsius - 1536)
     elif T_Celsius > 723:
         rho = (-1e-4 * T_Celsius - 0.2) * T_Celsius + 7852.3
     else:
         rho = (-1e-4 * T_Celsius - 0.3) * T_Celsius + 7849.1
     return rho
Ejemplo n.º 20
0
    def __init__(self, identifier: str = 'liquid',
                 latex: Optional[str] = None,
                 comment: Optional[str] = None) -> None:
        """
        Args:
            identifier:
                Identifier of matter

            latex:
                Latex-version of identifier. If None, identical with identifier

            comment:
                Comment on matter

        Note:
            Do NOT define a self.__call__() method in this class
        """
        super().__init__(identifier=identifier, latex=latex, comment=comment)

        self.T.ref = C2K(20.)
Ejemplo n.º 21
0
 def _k(self, T: float = C2K(20), p: float = atm(), x: float = 0.) -> float:
     Tp = [
         300, 600, 900, 1184, 1400, 1673, 1673.1, 1809, 1809.1, 2000, 3000
     ]
     Up = [59.6, 54.6, 37.4, 28.2, 30.6, 33.7, 33.4, 34.6, 40.3, 42.6, 48]
     return np.interp(T, Tp, Up)
Ejemplo n.º 22
0
 def _nu(self, T, p=1e5, x=0):
     Tp = C2K(np.array([20, 40, 60, 80, 100]))
     Up = np.array([90, 32, 15, 8.5, 5.5]) * 1e-6
     return np.interp(T, Tp, Up)