Exemplo n.º 1
0
        // CO2 concentration
        private double _CO2(WaterComponent temp, WaterComponent alk, double pH)
        {
            double pK1    = 6.579 - 0.013 * temp.Value + 1.869e-4 * Math.Pow(temp.Value, 2) - 1.133e-6 * Math.Pow(temp.Value, 3) + 5.953e-9 * Math.Pow(temp.Value, 4); // corr of pK1 to temp
            double lg_CO2 = Math.Log10(alk.ValueMEq * mol) - (pH - pK1);                                                                                               //  Henderson–Hasselbalch equation
            double CO2    = Math.Pow(10, lg_CO2) * 44 * 1000;                                                                                                          // CO2 in ppm, CO2 in conc = CO2 in feed

            return(Math.Round(CO2, 2));
        }
Exemplo n.º 2
0
        // pH of concentrate
        private double _pH_c(double temp, WaterComponent alk, double pH, double CF, double C_CO2)
        {
            double A      = 1 / (44.0 * 1000);                                                                                                 // reciprocal of M_CO2 multiplied by conversion to mol/L
            double pK1    = 6.579 - 0.013 * temp + 1.869e-4 * Math.Pow(temp, 2) - 1.133e-6 * Math.Pow(temp, 3) + 5.953e-9 * Math.Pow(temp, 4); // corr of pK1 to temp
            double lg_CO2 = Math.Log10(C_CO2 * A);
            double pH_c   = pK1 + Math.Log10(CF * alk.ValueMEq * mol) - lg_CO2;                                                                //  Henderson–Hasselbalch equation

            return(Math.Round(pH_c, 2));
        }
Exemplo n.º 3
0
        // IP SrSO4
        private double _IP_SrSO4(WaterComponent strontium, WaterComponent sulfates, double IS, double CF = 1)
        {
            double lgKsp = 1 / (-0.0079 * ((Math.Log10(IS) + 2.8154 * 2.8154) - 0.152)); //DuPont 1992
            double Ksp   = Math.Pow(10, lgKsp);
            // Gettins these to to mol/L; 0.5 is the same convertion factor to mol from eq
            double IP = (CF * mol * sulfates.ValueMEq * sulfates.GetIonCharge()) * (CF * mol * strontium.ValueMEq * strontium.GetIonCharge());
            //supersat is calculated as ratio of actual sol product to Ksp at this ionic strength with correction on temp
            double supersat = (IP / (Ksp));

            return(Math.Round(supersat, 2));
        }
Exemplo n.º 4
0
        // LSI index
        private double _LSI(double tds, WaterComponent temp, WaterComponent calcium, WaterComponent alk, WaterComponent pH, double CF = 1)
        {
            double tF = 9 * temp.Value / 5 + 32;

            double pCa  = -Math.Log10((calcium.ValueMEq * calcium.GetIonCharge() * mol * CF));
            double pAlk = -Math.Log10((alk.ValueMEq * mol * CF));
            //DuPont 1992, t here in F
            double C = 3.26 * Math.Exp(-0.005 * tF) - 0.0116 * Math.Log10(Math.Pow(tds, 3)) + 0.0905 * Math.Log10(Math.Pow(tds, 2)) - 0.133 * Math.Log10(tds) - 0.02;

            double LSI = pH.Value - (pCa + pAlk + C);

            return(Math.Round(LSI, 2));
        }
Exemplo n.º 5
0
        // S&DSI index
        private double _StDI(double IS, WaterComponent temp, WaterComponent calcium, WaterComponent alk, WaterComponent pH, double CF = 1)
        {
            double K = 0;

            if (IS <= 1.2)
            {
                double power = Math.Pow((Math.Log(IS) + 7.644), 2) / 102.6;
                K = 2.022 * Math.Exp(power) - 0.0002 * Math.Pow(temp.Value, 2) + 0.00097 * temp.Value + 0.262;
            }
            else if (IS > 1.2)
            {
                K = -0.1 * IS - 0.0002 * Math.Pow(temp.Value, 2) + 0.00097 * temp.Value + 3.887;
            }
            double pCa  = -Math.Log10((calcium.ValueMEq * calcium.GetIonCharge() * mol * CF));
            double pAlk = -Math.Log10((alk.ValueMEq * mol * CF));
            double StDI = pH.Value - (pCa + pAlk + K);

            return(Math.Round(StDI, 2));
        }
Exemplo n.º 6
0
        public WaterList()
        {
            // Cations
            NH4 = new WaterComponent("Аммоній", WaterComponentType.Cation, 18.00, 1);
            K   = new WaterComponent("Калій", WaterComponentType.Cation, 39.10, 1);
            Na  = new WaterComponent("Натрій", WaterComponentType.Cation, 23.00, 1);
            Ca  = new WaterComponent("Кальцій", WaterComponentType.Cation, 20.04, 2);
            Mg  = new WaterComponent("Магній", WaterComponentType.Cation, 12.15, 2);
            Fe2 = new WaterComponent("Залізо 2+", WaterComponentType.Cation, 27.93, 2);
            Fe3 = new WaterComponent("Залізо 3+", WaterComponentType.Cation, 18.62, 3);
            Mn  = new WaterComponent("Марганець", WaterComponentType.Cation, 27.47, 2);
            Sr  = new WaterComponent("Стронцій", WaterComponentType.Cation, 43.81, 2);
            Ba  = new WaterComponent("Барій", WaterComponentType.Cation, 68.66, 2);

            // Anions
            HCO3 = new WaterComponent("Гідрокарбонати", WaterComponentType.Anion, 61.00, 1);
            SO4  = new WaterComponent("Сульфати", WaterComponentType.Anion, 48.00, 2);
            Cl   = new WaterComponent("Хлориди", WaterComponentType.Anion, 35.45, 1);
            NO2  = new WaterComponent("Нітрити", WaterComponentType.Anion, 46.00, 1);
            NO3  = new WaterComponent("Нітрати", WaterComponentType.Anion, 62.00, 1);
            F    = new WaterComponent("Фториди", WaterComponentType.Anion, 19.00, 1);
            SiO2 = new WaterComponent("Силікати", WaterComponentType.Anion, 0, 4);
            PO4  = new WaterComponent("Фосфати", WaterComponentType.Anion, 31.66, 3);

            // Others
            pH          = new WaterComponent("pH", WaterComponentType.Other);
            Temperature = new WaterComponent("Температура", WaterComponentType.Other);
            Oxidability = new WaterComponent("Окисність", WaterComponentType.Other);
            Turbidity   = new WaterComponent("Мутність", WaterComponentType.Other);
            TSS         = new WaterComponent("Зважені речовини", WaterComponentType.Other);
            Odor        = new WaterComponent("Запах", WaterComponentType.Other);
            Colority    = new WaterComponent("Кольоровість", WaterComponentType.Other);
            Taste       = new WaterComponent("Присмак", WaterComponentType.Other);

            //Lists
            _cations = new List <WaterComponent> {
                NH4, K, Na, Ca, Mg, Fe2, Fe3, Mn, Sr, Ba
            };
            _anions = new List <WaterComponent> {
                HCO3, SO4, Cl, NO2, NO3, F, SiO2, PO4
            };
        }
Exemplo n.º 7
0
        // IP CaSO4
        private double _IP_CaSO4(WaterComponent calcium, WaterComponent sulfates, double IS, WaterComponent temp, double CF = 1)
        {
            // Ratio of solubility of monohydrate im mg/L @ given temp in deg C to solubility @ 25 deg C (611...) at which Ksp eq is calculated
            double sol_corr_t = (-0.0602986 * (temp.Value * temp.Value) + 5.65504 * temp.Value + 507.332) / 611.021375;

            if (sol_corr_t > 1)
            {
                sol_corr_t = 1;
            }

            // double Ksp = 8.365e-5 + 2.101e-3 * IS  - 7.09e-4 * IS * IS + 3.019e-4 * Math.pow(IS,3) - 6.969e-5 * Math.pow(IS,4);
            double lgKsp = 1 / (-0.022 * ((Math.Log10(IS) + 2.2954 * 2.2954)) - 0.2478); //DuPont 1992
            double Ksp   = Math.Pow(10, lgKsp);

            // Gettins these to to mol/L; 0.5 is the same convertion factor to mol from eq
            double IP = (CF * mol * sulfates.ValueMEq * sulfates.GetIonCharge()) * (CF * mol * calcium.ValueMEq * calcium.GetIonCharge());

            //supersat is calculated as ratio of actual sol product to Ksp at this ionic strength with correction on temp
            double supersat = (sol_corr_t * IP / (Ksp));

            return(Math.Round(supersat, 2));
        }
Exemplo n.º 8
0
        // Acid dose
        private double _pHCorrectionAcidDose(ProjectBase.EnumpHCorrection acid, double pH_adj, WaterComponent alk, WaterComponent pH, WaterComponent temp, double C_CO2)
        {
            if (acid == ProjectBase.EnumpHCorrection.None)
            {
                return(0);
            }

            double C_coef = 1;
            double dose   = 0;

            switch (acid)
            {
            case ProjectBase.EnumpHCorrection.HCl:
                // alk_coef = 1.37;
                C_coef = 1.21;
                break;

            case ProjectBase.EnumpHCorrection.H2SO4:
                //alk_coef = 1.02;
                C_coef = 0.9;
                break;

            default:
                // alk_coef = 0;
                C_coef = 1;
                break;
            }

            if (pH_adj < pH.Value)
            {
                double pK1        = 6.579 - 0.013 * temp.Value + 1.869e-4 * Math.Pow(temp.Value, 2) - 1.133e-6 * Math.Pow(temp.Value, 3) + 5.953e-9 * Math.Pow(temp.Value, 4);
                double alk_to_CO2 = Math.Exp((pH_adj - pK1) / 0.4275);
                double A          = C_CO2 * alk_to_CO2 - (alk.ValueMEq * 50);
                dose = (A) / (-1 * (C_coef * alk_to_CO2));
            }
            return(Math.Round(dose, 2));
        }