コード例 #1
0
ファイル: digester.cs プロジェクト: puttak/matlab_toolboxes
        /// <summary>
        /// Print the params of the digester to a string, to be displayed on a console
        /// </summary>
        /// <returns>string for console</returns>
        public string print()
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("   ----------   DIGESTER:   " + name + "   ----------   \r\n");
            sb.Append("id: " + id + "\r\n");

            sb.Append("  Vtot= " + Vtot.printValue("0") + "\t\t\t");
            sb.Append("Vliq= " + Vliq.printValue("0") + "\t\t\t");
            sb.Append("Vgas= " + Vgas.Value.ToString("0") + "\n");
            sb.Append("  Vliqmax= " + Vliqmax.printValue("0") + "\t\t\t");
            sb.Append("Vgasmax= " + Vgasmax.printValue("0") + "\t\t\t");
            sb.Append("T= " + T.printValue("0.0") + "\n");

            sb.Append("  diam= " + diam.printValue("0.0") + "\t\t\t");
            sb.Append("hwall= " + height.printValue("0.0") + "\t\t\t");
            sb.Append("hroof= " + h_roof.printValue("0.0") + "\n");
            sb.Append("  Awall= " + Awall.printValue("0.0") + "\t\t\t");
            sb.Append("Aroof= " + Aroof.printValue("0.0") + "\t\t\t");
            sb.Append("Aground= " + Aground.printValue("0.0") + "\n");

            sb.Append("  k_wall= " + k_wall.printValue("0.00") + "\t\t");
            sb.Append("k_roof= " + k_roof.printValue("0.00") + "\t\t");
            sb.Append("k_ground= " + k_ground.printValue("0.00") + "\r\n");

            sb.Append("  accum_x= " + accum_x.ToString("0.00") + "\t\t\t");
            sb.Append("accum_s= " + accum_s.ToString("0.00") + "\r\n");

            // heating
            sb.Append(heating.print());

            sb.Append(mixers.print()); // stirrer

            //
            sb.Append("   ---------- ---------- ---------- ----------   \n");

            return(sb.ToString());
        }
コード例 #2
0
        // -------------------------------------------------------------------------------------
        //                              !!! PUBLIC METHODS !!!
        // -------------------------------------------------------------------------------------

        ///// <summary>
        ///// Calculate needed thermal power to heat the substrate flow Q
        ///// up to the temperature inside the digester. Q is measured in m³/d
        ///// </summary>
        ///// <param name="Q">volumetric flow rate of substrates in m^3/d</param>
        ///// <param name="mySubstrates"></param>
        ///// <param name="Pel_kWh_d">thermal or electrical energy per day</param>
        ///// <param name="Pel_kW">thermal or electrical power</param>
        ///// <exception cref="exception">Q.Length != mySubstrates.Count</exception>
        ///// <exception cref="exception">efficiency is zero, division by zero</exception>
        //public void heatInputSubstrates(double[] Q, substrates mySubstrates,
        //                                out physValue Pel_kWh_d,
        //                                out physValue Pel_kW)
        //{
        //  heating.heatSubstrates(Q, mySubstrates, T, out Pel_kWh_d, out Pel_kW);
        //}
        ///// <summary>
        ///// Calculate needed thermal power to heat the substrate flow Q
        ///// up to the temperature inside the digester. Q is measured in m³/d
        ///// </summary>
        ///// <param name="Q">volumetric flow rate of substrates in m^3/d</param>
        ///// <param name="mySubstrates"></param>
        ///// <param name="Pel_kWh_d">thermal or electrical energy per day</param>
        ///// <exception cref="exception">Q.Length != mySubstrates.Count</exception>
        ///// <exception cref="exception">efficiency is zero, division by zero</exception>
        //public void heatInputSubstrates(double[] Q, substrates mySubstrates,
        //                                out physValue Pel_kWh_d)
        //{
        //  heating.heatSubstrates(Q, mySubstrates, T, out Pel_kWh_d);
        //}

        /// <summary>
        /// Calculate thermal power get lost due to radiation through the
        /// digester surface.
        ///
        /// TODO: at the moment power is always positive, would it be a problem if
        /// it is negative, where is it called? outside hotter than inside of digester, no
        /// problem
        /// </summary>
        /// <param name="pT_ambient">ambient temperature</param>
        /// <returns>thermal power get lost in W</returns>
        public physValue calcHeatLossDueToRadiation(physValue pT_ambient)
        {
            physValue T_ambient = pT_ambient.convertUnit("°C");

            _T      = T.convertUnit("°C");
            _k_wall = k_wall.convertUnit("W/(m^2 * K)");
            physValue myAwall = Awall.convertUnit("m^2");

            // In Ganzheitliche stoffliche und energetische Modellierung S. 56
            // eine ausführliche Formel zur Berechnung des Wärmeübergangs bei
            // mehrschichtige wänden

            // P_{radiation,loss} [W]= Atot * h_{th} * ( T_{digester} - T_{ambient} )
            //
            // [ W ]= [ m^2 * W/(m^2 * K) * K ]$$
            //
            // Achtung: es ist total falsch eine temperaturdifferenz im nachhinein
            // in Kelvin zu konvertieren. vorher beide temperaturen in Kelvin
            // dann differenz bilden
            //
            physValue P_radiation_loss_wall = myAwall * _k_wall *
                                              /*physValue.max*/ (_T.convertUnit("K") - T_ambient.convertUnit("K")/*,
                                                                                                                  * new physValue(0, "°C")*/
                                                                 );

            //

            _k_roof = k_roof.convertUnit("W/(m^2 * K)");
            physValue myAroof = Aroof.convertUnit("m^2");

            //
            // Achtung: es ist total falsch eine temperaturdifferenz im nachhinein
            // in Kelvin zu konvertieren. vorher beide temperaturen in Kelvin
            // dann differenz bilden
            //
            physValue P_radiation_loss_roof = myAroof * _k_roof *
                                              /*physValue.max*/ (_T.convertUnit("K") - T_ambient.convertUnit("K")/*,
                                                                                                                  * new physValue(0, "°C")*/
                                                                 );

            //

            _k_ground = k_ground.convertUnit("W/(m^2 * K)");
            physValue myAground = Aground.convertUnit("m^2");

            // Achtung: es ist total falsch eine temperaturdifferenz im nachhinein
            // in Kelvin zu konvertieren. vorher beide temperaturen in Kelvin
            // dann differenz bilden
            physValue P_radiation_loss_ground = myAground * _k_ground *
                                                /*physValue.max*/ (_T.convertUnit("K") - T_ambient.convertUnit("K")/*,
                                                                                                                    * new physValue(0, "°C")*/
                                                                   );

            //

            physValue P_radiation_sum = P_radiation_loss_wall + P_radiation_loss_roof + P_radiation_loss_ground;

            P_radiation_sum.Symbol = "P_rad_sum";

            return(P_radiation_sum);
        }