def MassFlow_Mixing(m1, T1, X1, m2, T2, X2, specificHeatCapacityDryAir, specificHeatCapacityWaterVapor, delta_h_water,
                    calc):
    """
    This function the resulting state variables when mixing two air flows.
    :param m1: float: value of the first air mass flow [kg/s]
    :param T1: float: temperature of the first air mass flow [°C]
    :param X1: float: humidity of the first air mass flow [kg water / kg air]
    :param m2: float: value of the second air mass flow [kg/s]
    :param T2: float: temperature of the second air mass flow [°C]
    :param X2: float: humidity of the second air mass flow [kg water / kg air]
    :param specificHeatCapacityDryAir: float: specific heat capacity of dry air [J/kg]
    :param specificHeatCapacityWaterVapor: float: specific heat capacity of water vapor [J/kg]
    :param delta_h_water: float: specific evaporation enthalpy [J/kg]
    :param calc: float: defines the return value(s). (Humidity(abs), Temperature)
    :return Xa float: resulting humidity [kg water / kg air]
    :return Ta float: resulting temperature [°C]
    """

    Xa = (m1 / (m1 + m2)) * X1 + (m2 / (m1 + m2)) * X2

    Ta = (m1 * (specificHeatCapacityDryAir * T1 + X1 * (delta_h_water + specificHeatCapacityWaterVapor * T1))
          + m2 * (specificHeatCapacityDryAir * T2 + X2 * (delta_h_water + specificHeatCapacityWaterVapor * T2))
          - (m1 + m2) * Xa * delta_h_water) / (
                     (m1 + m2) * (specificHeatCapacityDryAir + Xa * specificHeatCapacityWaterVapor))

    if calc == 'Humidity(abs)':
        return Xa
    elif calc == 'Temperature':
        return Ta