Loading…

方法名称: palmer_bowlus_flume_method_max_flowrate

方法ID: 0x41FD

方法标签: Calculate Max Flowrate

方法描述: Calculates Maximum Flowrate (Qmax) value


  • {
  • float pbbottomthroatconverted;
  • float pbthroatlenghtconverted;
  • float pbdisplacementthickness;
  • float pbthroatdiameterconverted;
  • float pbhumpheightconverted;
  • float pbnumericcalc;
  • float pbheadconverted;
  • float pbcrosssectionalcalc;
  • float pbthroatdiametercalc;
  • float pbvelocitycoefficientcalculation;
  • float pbanglecalc;
  • float pbdischargecalc;
  • float pb_numericcalc;
  • 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)
  • {
  • pbheadconverted = span_Obj_value_0 * 0.3048;
  • pbbottomthroatconverted = pb_bottom_throat_width * 0.3048;
  • pbthroatlenghtconverted = pb_throat_length * 0.3048;
  • pbthroatdiameterconverted = pb_approach_throat_diameter * 0.3048;
  • pbhumpheightconverted = pb_hump_height * 0.3048;
  • }
  • else
  • if (Distance_Obj_unit == 45)
  • {
  • pbheadconverted = span_Obj_value_0 * 1;
  • pbbottomthroatconverted = pb_bottom_throat_width * 1;
  • pbthroatlenghtconverted = pb_throat_length * 1;
  • pbthroatdiameterconverted = pb_approach_throat_diameter * 1;
  • pbhumpheightconverted = pb_hump_height * 1;
  • }
  • else
  • if (Distance_Obj_unit == 47)
  • {
  • pbheadconverted = span_Obj_value_0 * 0.0254;
  • pbbottomthroatconverted = pb_bottom_throat_width * 0.0254;
  • pbthroatlenghtconverted = pb_throat_length * 0.0254;
  • pbthroatdiameterconverted = pb_approach_throat_diameter * 0.0254;
  • pbhumpheightconverted = pb_hump_height * 0.0254;
  • }
  • else
  • if (Distance_Obj_unit == 48)
  • {
  • pbheadconverted = span_Obj_value_0 * 0.01;
  • pbbottomthroatconverted = pb_bottom_throat_width * 0.01;
  • pbthroatlenghtconverted = pb_throat_length * 0.01;
  • pbthroatdiameterconverted = pb_approach_throat_diameter * 0.01;
  • pbhumpheightconverted = pb_hump_height * 0.01;
  • }
  • else
  • if (Distance_Obj_unit == 49)
  • {
  • pbheadconverted = span_Obj_value_0 * 0.001;
  • pbbottomthroatconverted = pb_bottom_throat_width * 0.001;
  • pbthroatlenghtconverted = pb_throat_length * 0.001;
  • pbthroatdiameterconverted = pb_approach_throat_diameter * 0.001;
  • pbhumpheightconverted = pb_hump_height * 0.001;
  • }
  • pbnumericcalc = 1 + pb_throat_slope * pb_throat_slope;
  • pb_numericalcoefficient = sqrt(pbnumericcalc) - pb_throat_slope;
  • pbdisplacementthickness = 0.003 * pbthroatlenghtconverted;
  • pb_effectivewidth = pbbottomthroatconverted - 2 * pb_numericalcoefficient * pbdisplacementthickness;
  • pb_effectivehead = pbheadconverted - pbdisplacementthickness;
  • pbdischargecalc = 1 - 0.003 * pbthroatlenghtconverted / pbheadconverted;
  • pb_dischargecoefficient = pb_effectivewidth / pbbottomthroatconverted * pow(pbdischargecalc,1.5);
  • pbcrosssectionalcalc = pbheadconverted + pbhumpheightconverted;
  • pbthroatdiametercalc = 0.5 * pbthroatdiameterconverted;
  • if (pbcrosssectionalcalc < pbthroatdiametercalc)
  • {
  • pbanglecalc = acos(1 - pbcrosssectionalcalc / pbthroatdiameterconverted);
  • pb_crosssectionalarea = 0.25 * (pbthroatdiameterconverted * pbthroatdiameterconverted) * (pbanglecalc - sin(pbanglecalc) * cos(pbanglecalc));
  • }
  • else
  • {
  • pb_crosssectionalarea = -0.1073 * (pbthroatdiameterconverted * pbthroatdiameterconverted) + pbcrosssectionalcalc * pbthroatdiameterconverted;
  • }
  • pbshapecoefficientcalculation = pb_throat_slope * pbheadconverted / pb_effectivewidth;
  • if (pbshapecoefficientcalculation < 0.010 || pbshapecoefficientcalculation > 10.0 || pbshapecoefficientcalculation == NaN_value())
  • {
  • ACKNOWLEDGE(literal_string(1481));
  • process_abort();
  • }
  • else
  • if (pbshapecoefficientcalculation >= 0.010 && pbshapecoefficientcalculation < 0.16)
  • {
  • pb_shapecoefficient = 1.093;
  • pbvelocitycoefficientcalculation = pb_shapecoefficient * pb_effectivewidth * pb_effectivehead / pb_crosssectionalarea;
  • if (pbvelocitycoefficientcalculation < 0.1 || pbvelocitycoefficientcalculation > 0.9 || pbvelocitycoefficientcalculation == NaN_value())
  • {
  • ACKNOWLEDGE(literal_string(1482));
  • process_abort();
  • }
  • else
  • if (pbvelocitycoefficientcalculation >= 0.1 && pbvelocitycoefficientcalculation < 0.4)
  • {
  • pb_velocitycoefficient = 1.021;
  • flowratecalculated = 1.704599 * 1.093 * 1.021 * pb_dischargecoefficient * pbbottomthroatconverted * pow(pbheadconverted,1.5);
  • }
  • else
  • if (pbvelocitycoefficientcalculation >= 0.4 && pbvelocitycoefficientcalculation < 0.5)
  • {
  • pb_velocitycoefficient = 1.039;
  • flowratecalculated = 1.704599 * 1.093 * 1.039 * pb_dischargecoefficient * pbbottomthroatconverted * pow(pbheadconverted,1.5);
  • }
  • else
  • if (pbvelocitycoefficientcalculation >= 0.5 && pbvelocitycoefficientcalculation < 0.7)
  • {
  • pb_velocitycoefficient = 1.098;
  • flowratecalculated = 1.704599 * 1.093 * 1.098 * pb_dischargecoefficient * pbbottomthroatconverted * pow(pbheadconverted,1.5);
  • }
  • else
  • if (pbvelocitycoefficientcalculation >= 0.7 && pbvelocitycoefficientcalculation < 0.8)
  • {
  • pb_velocitycoefficient = 1.146;
  • flowratecalculated = 1.704599 * 1.093 * 1.146 * pb_dischargecoefficient * pbbottomthroatconverted * pow(pbheadconverted,1.5);
  • }
  • else
  • if (pbvelocitycoefficientcalculation >= 0.8 && pbvelocitycoefficientcalculation < 0.9)
  • {
  • pb_velocitycoefficient = 1.218;
  • flowratecalculated = 1.704599 * 1.093 * 1.218 * pb_dischargecoefficient * pbbottomthroatconverted * pow(pbheadconverted,1.5);
  • }
  • else
  • if (pbvelocitycoefficientcalculation == 0.9)
  • {
  • pb_velocitycoefficient = 1.340;
  • flowratecalculated = 1.704599 * 1.093 * 1.340 * pb_dischargecoefficient * pbbottomthroatconverted * pow(pbheadconverted,1.5);
  • }
  • }
  • else
  • if (pbshapecoefficientcalculation >= 0.16 && pbshapecoefficientcalculation < 0.80)
  • {
  • pb_shapecoefficient = 1.527;
  • pbvelocitycoefficientcalculation = pb_shapecoefficient * pb_effectivewidth * pb_effectivehead / pb_crosssectionalarea;
  • if (pbvelocitycoefficientcalculation < 0.1 || pbvelocitycoefficientcalculation > 0.9 || pbvelocitycoefficientcalculation == NaN_value())
  • {
  • ACKNOWLEDGE(literal_string(1482));
  • process_abort();
  • }
  • else
  • if (pbvelocitycoefficientcalculation >= 0.1 && pbvelocitycoefficientcalculation < 0.4)
  • {
  • pb_velocitycoefficient = 1.021;
  • flowratecalculated = 1.704599 * 1.527 * 1.021 * pb_dischargecoefficient * pbbottomthroatconverted * pow(pbheadconverted,1.5);
  • }
  • else
  • if (pbvelocitycoefficientcalculation >= 0.4 && pbvelocitycoefficientcalculation < 0.5)
  • {
  • pb_velocitycoefficient = 1.039;
  • flowratecalculated = 1.704599 * 1.527 * 1.039 * pb_dischargecoefficient * pbbottomthroatconverted * pow(pbheadconverted,1.5);
  • }
  • else
  • if (pbvelocitycoefficientcalculation >= 0.5 && pbvelocitycoefficientcalculation < 0.7)
  • {
  • pb_velocitycoefficient = 1.098;
  • flowratecalculated = 1.704599 * 1.527 * 1.098 * pb_dischargecoefficient * pbbottomthroatconverted * pow(pbheadconverted,1.5);
  • }
  • else
  • if (pbvelocitycoefficientcalculation >= 0.7 && pbvelocitycoefficientcalculation < 0.8)
  • {
  • pb_velocitycoefficient = 1.146;
  • flowratecalculated = 1.704599 * 1.527 * 1.146 * pb_dischargecoefficient * pbbottomthroatconverted * pow(pbheadconverted,1.5);
  • }
  • else
  • if (pbvelocitycoefficientcalculation >= 0.8 && pbvelocitycoefficientcalculation < 0.9)
  • {
  • pb_velocitycoefficient = 1.218;


请登录以获得完整内容