Example #1
0
def saturation_line_slope(t, p):
    """ slope of the saturation line for a given temperature und pressure
        Args:
            t:                  temperature [celsius]
            p:                  fluid pressure [Pa]
        Returns:
            slope of the saturation line at t, p
    """
    return (fpa.temperature2saturation_vapour_pressure(t + 1e-4) -
            fpa.temperature2saturation_vapour_pressure(t - 1e-4)) / (p * 2e-4)
Example #2
0
def corr_fog_mt(sher, nuss, pran, schm, rh, t_interface, t, p):
    """ fog correction for the mass transfer
        H.J.H. Brouwers, Effect of fog formation on turbulent vapor condensation with noncondensable gases,
        J. Heat Transf. 118 (1) (1996) 243–245,
        doi: 10.1115/1.2824052
        Args:
            sher:               Sherwood number
            nuss:               sensible Nusselt number
            pran:               Prandtl number
            schm:               Schmidt number
            rh:                 relative humidity
            t_interface:        temperature at the condensate interface [celsius]
            t:                  temperature in the bulk flow [celsius]
            p:                  fluid pressure [Pa]
        Returns:
            corrections factor for fog formation
    """
    p_v = rh * fpa.temperature2saturation_vapour_pressure(t)
    c_p = fpa.moist_air_heat_capacity(t, p, p_v)
    x_vbs, x_vb = fpa.__moles_fraction_mixture__(p_v, p, t)
    x_vis, x_vi = fpa.__moles_fraction_mixture__(p_v, p, t_interface)
    lmbda = fpw.enthalpy_evaporation(t)
    # c_p_alt = c_p_mixture(x_vb, t)
    # lmbda_mol = lmbda * fpa.MOLES_MASS_VAPOUR
    return (1. + (lmbda / c_p * pran / schm * (x_vb - x_vi) / (t - t_interface) * sher / nuss) ** -1) / \
           (1. + (lmbda / c_p * pran / schm * saturation_line_slope(t_interface, p)) ** -1)
Example #3
0
def corr_suction_ht(sher, nuss, pran, schm, rh, t_interface, t, p):
    """ suction correction for the heat transfer
        H.J.H. Brouwers, Effect of fog formation on turbulent vapor condensation with noncondensable gases,
        J. Heat Transf. 118 (1) (1996) 243–245,
        doi: 10.1115/1.2824052
        Args:
            sher:               Sherwood number
            nuss:               sensible Nusselt number
            pran:               Prandtl number
            schm:               Schmidt number
            rh:                 relative humidity
            t_interface:        temperature at the condensate interface [celsius]
            t:                  temperature in the bulk flow [celsius]
            p:                  fluid pressure [Pa]
        Returns:
            corrections factor for suction
    """
    p_v = rh * fpa.temperature2saturation_vapour_pressure(t)
    c_p = fpa.moist_air_heat_capacity(t, p, p_v)
    c_pv = fpw.heat_capacity(t)
    x_vbs, x_vb = fpa.__moles_fraction_mixture__(p_v, p, t)
    x_vis, x_vi = fpa.__moles_fraction_mixture__(p_v, p, t_interface)
    r_t = c_pv / c_p * (sher * pran) / (schm * nuss) * np.log(
        (1 - x_vb) / (1 - x_vi))
    return -1 * r_t / (np.exp(-r_t) - 1)
Example #4
0
def jakob(t_bulk, t_interface, t_in, pressure, rel_hum):
    """ Jakob number/ ratio of sensible to latent heat
        Args:
            t_bulk:             mean bulk temperature [celsius]
            t_interface:        temperature at the condensate interface [celsius]
            t_in:               inlet temperature [celsius]
            pressure:           fluid pressure at the inlet [Pa]
            rel_hum:            relative humidity at the inlet
    """
    return fpa.moist_air_heat_capacity(t_bulk, pressure, rel_hum * fpa.temperature2saturation_vapour_pressure(t_in)) * \
        (t_bulk - t_interface) / fpw.enthalpy_evaporation(t_bulk)
Example #5
0
def mass_fraction_interface(pressure, temp_interface):
    """ noncondensable gas mass fraction at the gas-liquid interface with the assumption of saturation following the
        Gibbs-Dalton Law as formulated by
        G. Caruso, D. Di Vitale Maio, Heat and mass transfer analogy applied to condensation in the presence of
        noncondensable gases inside inclined tubes, Int. J. Heat Mass Transf. 68 (2014) 401–414,
        doi: 10.1016/j.ijheatmasstransfer.2013.09.049
        Args:
            pressure:           fluid pressure above the interface [Pa]
            temp_interface:     interface temperature [Celsius]
        Returns:
            mass fraction of the noncondensable gas fraction at the condensate interface
    """
    p_sat = fpa.temperature2saturation_vapour_pressure(temp_interface)
    M_v = fpa.MOLES_MASS_VAPOUR
    M_air = fpa.MOLES_MASS_AIR
    return (pressure - p_sat) / (pressure - (1 - M_v / M_air) * p_sat)
Example #6
0
def corr_suction_mt(rh, t_interface, t, p):
    """ suction correction for the mass transfer
        H.J.H. Brouwers, Effect of fog formation on turbulent vapor condensation with noncondensable gases,
        J. Heat Transf. 118 (1) (1996) 243–245,
        doi: 10.1115/1.2824052
        Args:
            rh:                 relative humidity
            t_interface:        temperature at the condensate interface [celsius]
            t:                  temperature in the bulk flow [celsius]
            p:                  fluid pressure [Pa]
        Returns:
            corrections factor for suction
    """
    p_v = rh * fpa.temperature2saturation_vapour_pressure(t)
    x_vbs, x_vb = fpa.__moles_fraction_mixture__(p_v, p, t)
    x_vis, x_vi = fpa.__moles_fraction_mixture__(p_v, p, t_interface)
    r_w = (x_vb - x_vi) / (1 - x_vi)
    return np.log(1 - r_w) / (-r_w)
def read(config_file, data_file=None, switch='config'):
    if switch == 'config':
        config = configparser.ConfigParser()
        config.read(config_file)
        cfg_numbers = config['dimless_numbers']
        re = np.array([cfg_numbers.getfloat('reynolds')])
        pr = np.array([cfg_numbers.getfloat('prandtl')])
        sc = np.array([cfg_numbers.getfloat('schmidt')])
        ri = np.array([cfg_numbers.getfloat('richardson')])

        cfg_temp = config['temperatures']
        t_in = np.array([cfg_temp.getfloat('t_in')])
        t_out = np.array([cfg_temp.getfloat('t_out')])
        t_w = np.array([cfg_temp.getfloat('t_w')])
        t_mean = np.array([cfg_temp.getfloat('t_mean')])
        t_dp_in = np.array([cfg_temp.getfloat('t_dp_in')])
        t_dp_out = np.array([cfg_temp.getfloat('t_dp_out')])
        rh = np.array([cfg_temp.getfloat('rH')])

        cfg_dim = config['dimensions']
        b = cfg_dim.getfloat('width')
        h = cfg_dim.getfloat('height')
        l = cfg_dim.getfloat('length')

        cfg_oth = config['other']
        p_standard = cfg_oth.getfloat('pressure')
        theta_a = cfg_oth.getfloat('ascending_contact_angle')
        theta_r = cfg_oth.getfloat('receding_contact_angle')
        flow_direction = cfg_oth.get('flow_direction')

        try:
            cfg_mf = config['mass_flow']
            m_air = np.array([cfg_mf.getfloat('massflow_moistair')])
            m_water = np.array([cfg_mf.getfloat('massflow_water')])
            m_cond = np.array([cfg_mf.getfloat('massflow_condensate')])
            mf_int = mf.mass_fraction_interface(p_standard, t_w)
            mf_bulk = mf.mass_fraction_bulk(m_air - m_water, m_water)
        except KeyError:
            print('using mass fraction')
            mf_int, mf_bulk = None, None
        if mf_int is None:
            try:
                cfg_mf = config['mass_fraction']
                mf_int = np.array(cfg_mf.getfloat('mass_fraction_interface'))
                mf_bulk = np.array(cfg_mf.getfloat('mass_fraction_bulk'))
            except KeyError:
                print('no mass flow or mass fractions were given.')
                mf_int, mf_bulk = [], []

        return re, pr, ri, sc, t_in, t_out, t_w, t_mean, t_dp_in, t_dp_out, \
            rh, mf_int, mf_bulk, b, h, l, p_standard, theta_a, theta_r, flow_direction
    elif switch == 'dat' and data_file is not None:
        config = configparser.ConfigParser()
        config.read(config_file)
        cfg_dim = config['dimensions']
        b = cfg_dim.getfloat('width')
        h = cfg_dim.getfloat('height')
        l = cfg_dim.getfloat('length')
        p_standard = config['other'].getfloat('pressure')
        theta_a = config['other'].getfloat('ascending_contact_angle')
        theta_r = config['other'].getfloat('receding_contact_angle')
        flow_direction = config['other'].get('flow_direction')
        re = np.loadtxt(data_file, skiprows=1, usecols=2)
        pr = np.loadtxt(data_file, skiprows=1, usecols=4)
        ri = np.loadtxt(data_file, skiprows=1, usecols=44)

        t_in = np.loadtxt(data_file, skiprows=1, usecols=28)
        t_out = np.loadtxt(data_file, skiprows=1, usecols=30)
        t_w = np.loadtxt(data_file, skiprows=1, usecols=26)
        t_mean = np.loadtxt(data_file, skiprows=1, usecols=32)
        t_dp_in = np.loadtxt(data_file, skiprows=1, usecols=34)
        t_dp_out = np.loadtxt(data_file, skiprows=1, usecols=36)
        # rh = np.loadtxt(data_file, skiprows=1, usecols=45)
        rh = fpa.relativehumidity(t_mean, mf.log_mean(t_dp_in, t_dp_out))

        m_air = np.loadtxt(data_file, skiprows=1, usecols=50)
        m_water = np.loadtxt(data_file, skiprows=1, usecols=40)
        m_cond = np.loadtxt(data_file, skiprows=1, usecols=18)
        mf_int = mf.mass_fraction_interface(p_standard, t_w)
        mf_bulk = mf.mass_fraction_bulk(m_air - m_water, m_water)

        sc = (fpa.moist_air_dynamic_viscosity(t_mean, p_standard,
                                              rh * fpa.temperature2saturation_vapour_pressure(t_in))) / \
             (fpa.diffusion_coefficient(t_mean) *
              fpa.moist_air_density(p_standard, rh * fpa.temperature2saturation_vapour_pressure(t_in), t_mean))
        return re, pr, ri, sc, t_in, t_out, t_w, t_mean, t_dp_in, t_dp_out, \
            rh, mf_int, mf_bulk, b, h, l, p_standard, theta_a, theta_r, flow_direction
    else:
        print('switch not set or data file missing')
        exit(0)