Loading…

Method Name: trapezoidal_throated_flume_method_max_flowrate

Method ID: 0x41F9

Method Label: Calculate Max Flowrate

Method Help: Calculates Maximum Flowrate (Qmax) value


  • {
  • float ttapproachbasewidthconverted;
  • float ttthroatbasewidthconverted;
  • float ttthroatheightconverted;
  • float ttthroatlengthconverted;
  • float tt_numericcalc;
  • float ttareaapprochchannel;
  • float ttdischargecalc;
  • float shapecoefficientcalculation;
  • float ttvelocitycoefficientcalculation;
  • float headconvertedtrapezoidalthroat;
  • float flowratecalculated;
  • char disp_string1[135];
  • int slen1;
  • slen1 = 135;
  • _set_device_status(0xFF,0);
  • _set_xmtr_device_status(0xFF,0);
  • _set_all_resp_code(0);
  • _set_xmtr_all_resp_code(0);
  • _get_dictionary_string(19726337,disp_string1,slen1);
  • ACKNOWLEDGE(disp_string1);
  • _add_abort_method(4118);
  • if (Distance_Obj_unit == 44)
  • {
  • headconvertedtrapezoidalthroat = span_Obj_value_0 * 0.3048;
  • ttapproachbasewidthconverted = tt_base_width * 0.3048;
  • ttthroatbasewidthconverted = tt_base_width_throat * 0.3048;
  • ttthroatheightconverted = tt_throat_height * 0.3048;
  • ttthroatlengthconverted = tt_throat_length * 0.3048;
  • }
  • else
  • if (Distance_Obj_unit == 45)
  • {
  • headconvertedtrapezoidalthroat = span_Obj_value_0 * 1;
  • ttapproachbasewidthconverted = tt_base_width * 1;
  • ttthroatbasewidthconverted = tt_base_width_throat * 1;
  • ttthroatheightconverted = tt_throat_height * 1;
  • ttthroatlengthconverted = tt_throat_length * 1;
  • }
  • else
  • if (Distance_Obj_unit == 47)
  • {
  • headconvertedtrapezoidalthroat = span_Obj_value_0 * 0.0254;
  • ttapproachbasewidthconverted = tt_base_width * 0.0254;
  • ttthroatbasewidthconverted = tt_base_width_throat * 0.0254;
  • ttthroatheightconverted = tt_throat_height * 0.0254;
  • ttthroatlengthconverted = tt_throat_length * 0.0254;
  • }
  • else
  • if (Distance_Obj_unit == 48)
  • {
  • headconvertedtrapezoidalthroat = span_Obj_value_0 * 0.01;
  • ttapproachbasewidthconverted = tt_base_width * 0.01;
  • ttthroatbasewidthconverted = tt_base_width_throat * 0.01;
  • ttthroatheightconverted = tt_throat_height * 0.01;
  • ttthroatlengthconverted = tt_throat_length * 0.01;
  • }
  • else
  • if (Distance_Obj_unit == 49)
  • {
  • headconvertedtrapezoidalthroat = span_Obj_value_0 * 0.001;
  • ttapproachbasewidthconverted = tt_base_width * 0.001;
  • ttthroatbasewidthconverted = tt_base_width_throat * 0.001;
  • ttthroatheightconverted = tt_throat_height * 0.001;
  • ttthroatlengthconverted = tt_throat_length * 0.001;
  • }
  • ttareaapprochchannel = (headconvertedtrapezoidalthroat + ttthroatheightconverted) * (ttapproachbasewidthconverted + tt_sideslope * (headconvertedtrapezoidalthroat + ttthroatheightconverted));
  • tt_numericcalc = 1 + tt_sideslope * tt_sideslope;
  • tt_numericalcoefficient = sqrt(tt_numericcalc) - tt_sideslope;
  • shapecoefficientcalculation = tt_sideslope * headconvertedtrapezoidalthroat / ttthroatbasewidthconverted;
  • ttdischargecalc = 1 - 0.003 * ttthroatlengthconverted / headconvertedtrapezoidalthroat;
  • tt_dischargecoefficient = (1 - 0.006 * tt_numericalcoefficient * ttthroatlengthconverted / ttthroatbasewidthconverted) * pow(ttdischargecalc,1.5);
  • if (shapecoefficientcalculation < 0.02 || shapecoefficientcalculation > 9.0 || shapecoefficientcalculation == NaN_value())
  • {
  • ACKNOWLEDGE(literal_string(1472));
  • process_abort();
  • }
  • else
  • if (shapecoefficientcalculation >= 0.02 && shapecoefficientcalculation < 0.50)
  • {
  • tt_shapecoefficient = 1.30;
  • ttvelocitycoefficientcalculation = tt_shapecoefficient * ttthroatbasewidthconverted * headconvertedtrapezoidalthroat / ttareaapprochchannel;
  • if (ttvelocitycoefficientcalculation < 0.04 || ttvelocitycoefficientcalculation > 0.833 || ttvelocitycoefficientcalculation == NaN_value())
  • {
  • ACKNOWLEDGE(literal_string(1472));
  • process_abort();
  • }
  • else
  • if (ttvelocitycoefficientcalculation >= 0.04 && ttvelocitycoefficientcalculation < 0.2)
  • {
  • flowratecalculated = 1.704599 * 1.006 * 1.30 * tt_dischargecoefficient * ttthroatbasewidthconverted * pow(headconvertedtrapezoidalthroat,1.5);
  • }
  • else
  • if (ttvelocitycoefficientcalculation >= 0.2 && ttvelocitycoefficientcalculation < 0.46)
  • {
  • flowratecalculated = 1.704599 * 1.04 * 1.30 * tt_dischargecoefficient * ttthroatbasewidthconverted * pow(headconvertedtrapezoidalthroat,1.5);
  • }
  • else
  • if (ttvelocitycoefficientcalculation >= 0.46 && ttvelocitycoefficientcalculation < 0.56)
  • {
  • flowratecalculated = 1.704599 * 1.062 * 1.30 * tt_dischargecoefficient * ttthroatbasewidthconverted * pow(headconvertedtrapezoidalthroat,1.5);
  • }
  • else
  • if (ttvelocitycoefficientcalculation >= 0.56 && ttvelocitycoefficientcalculation < 0.66)
  • {
  • flowratecalculated = 1.704599 * 1.098 * 1.30 * tt_dischargecoefficient * ttthroatbasewidthconverted * pow(headconvertedtrapezoidalthroat,1.5);
  • }
  • else
  • if (ttvelocitycoefficientcalculation >= 0.66 && ttvelocitycoefficientcalculation < 0.76)
  • {
  • flowratecalculated = 1.704599 * 1.146 * 1.30 * tt_dischargecoefficient * ttthroatbasewidthconverted * pow(headconvertedtrapezoidalthroat,1.5);
  • }
  • else
  • if (ttvelocitycoefficientcalculation >= 0.76 && ttvelocitycoefficientcalculation <= 0.833)
  • {
  • flowratecalculated = 1.704599 * 1.25 * 1.30 * tt_dischargecoefficient * ttthroatbasewidthconverted * pow(headconvertedtrapezoidalthroat,1.5);
  • }
  • }
  • else
  • if (shapecoefficientcalculation >= 0.50 && shapecoefficientcalculation < 0.90)
  • {
  • tt_shapecoefficient = 1.55;
  • ttvelocitycoefficientcalculation = tt_shapecoefficient * ttthroatbasewidthconverted * headconvertedtrapezoidalthroat / ttareaapprochchannel;
  • if (ttvelocitycoefficientcalculation < 0.04 || ttvelocitycoefficientcalculation > 0.833 || ttvelocitycoefficientcalculation == NaN_value())
  • {
  • ACKNOWLEDGE(literal_string(1472));
  • process_abort();
  • }
  • else
  • if (ttvelocitycoefficientcalculation >= 0.04 && ttvelocitycoefficientcalculation < 0.2)
  • {
  • flowratecalculated = 1.704599 * 1.006 * 1.55 * tt_dischargecoefficient * ttthroatbasewidthconverted * pow(headconvertedtrapezoidalthroat,1.5);
  • }
  • else
  • if (ttvelocitycoefficientcalculation >= 0.2 && ttvelocitycoefficientcalculation < 0.46)
  • {
  • flowratecalculated = 1.704599 * 1.04 * 1.55 * tt_dischargecoefficient * ttthroatbasewidthconverted * pow(headconvertedtrapezoidalthroat,1.5);
  • }
  • else
  • if (ttvelocitycoefficientcalculation >= 0.46 && ttvelocitycoefficientcalculation < 0.56)
  • {
  • flowratecalculated = 1.704599 * 1.062 * 1.55 * tt_dischargecoefficient * ttthroatbasewidthconverted * pow(headconvertedtrapezoidalthroat,1.5);
  • }
  • else
  • if (ttvelocitycoefficientcalculation >= 0.56 && ttvelocitycoefficientcalculation < 0.66)
  • {
  • flowratecalculated = 1.704599 * 1.098 * 1.55 * tt_dischargecoefficient * ttthroatbasewidthconverted * pow(headconvertedtrapezoidalthroat,1.5);
  • }
  • else
  • if (ttvelocitycoefficientcalculation >= 0.66 && ttvelocitycoefficientcalculation < 0.76)
  • {
  • flowratecalculated = 1.704599 * 1.146 * 1.55 * tt_dischargecoefficient * ttthroatbasewidthconverted * pow(headconvertedtrapezoidalthroat,1.5);
  • }
  • else
  • if (ttvelocitycoefficientcalculation >= 0.76 && ttvelocitycoefficientcalculation <= 0.833)
  • {
  • flowratecalculated = 1.704599 * 1.25 * 1.55 * tt_dischargecoefficient * ttthroatbasewidthconverted * pow(headconvertedtrapezoidalthroat,1.5);
  • }


Please login for more