Exemplo n.º 1
0
        /// <summary>
        /// Calculates the maximal amount of methane (in m^3/d) which can be burned in a chp
        /// based on the electrical power. assuming that ch4 is the only
        /// gas in biogas which generates energy
        /// </summary>
        /// <param name="maxMethane">
        /// max. amount of methane which can be burned with chp in m^3/d
        /// </param>
        public void getMaxMethaneConsumption(out physValue maxMethane)
        {
            physValue unit_converter = new physValue(1, "kWh / kW * h");

            maxMethane = Pel.convertUnit("kW") / eta_el / biogas.chemistry.Hch4 * unit_converter;

            maxMethane = maxMethane.convertUnit("m^3/d");
        }
Exemplo n.º 2
0
        /// <summary>
        /// Calculates the electrical and thermal energy, respectively power
        /// generated out of the gas stream u.
        /// ch4 and h2 is burned
        /// </summary>
        /// <param name="u">
        /// vector with as many elements as there are number of gases (BioGas.n_gases)
        /// the positions of the gases inside the vector are:
        /// - biogas.BioGas.pos_ch4
        /// - biogas.BioGas.pos_co2
        /// - biogas.BioGas.pos_h2
        /// values measured in m^3/d
        /// </param>
        /// <param name="P_el_kWh_d">electrical energy per day</param>
        /// <param name="P_therm_kWh_d">thermal energy per day</param>
        /// <exception cref="exception">unit problem</exception>
        public void burnBiogas(double[] u,
                               out physValue P_el_kWh_d, out physValue P_therm_kWh_d)
        {
            // energy per day in biogas measured in kWh/d
            physValue energy;

            try
            {
                energy = biogas.BioGas.burn(u);
            }
            catch (exception e)
            {
                Console.WriteLine(e.Message);
                energy = new physValue(0, "kWh/d");
            }

            // P(t) [kWh/d]= Q_{ch4}(t) * H_{ch4} * \eta_{el}
            //
            // [ kWh/d ]= [ m^3/d * kWh / ( Nm^3 ) ]
            //
            P_el_kWh_d = eta_el * energy;

            // bound power by maximal electrical power
            try
            {
                P_el_kWh_d = physValue.min(P_el_kWh_d, Pel.convertUnit("kWh/d"));
            }
            catch (exception e)
            {
                Console.WriteLine(e.Message);
                throw new exception("burnBiogas: unit problem!");
            }

            P_el_kWh_d.Symbol = "Pel";


            // P(t) [kWh/d]= Q_{ch4}(t) * H_{ch4} * \eta_{therm}
            //
            // [ kWh/d ]= [ m^3/d * kWh / ( Nm^3 ) ]
            //
            P_therm_kWh_d = eta_therm * energy;

            // bound power by maximal thermal power
            try
            {
                P_therm_kWh_d = physValue.min(P_therm_kWh_d, Ptherm.convertUnit("kWh/d"));
            }
            catch (exception e)
            {
                Console.WriteLine(e.Message);
                throw new exception("burnBiogas: unit problem 2!");
            }

            P_therm_kWh_d.Symbol = "Ptherm";
        }