Loading…
Loading…
Method Name: u_throated_flume_method_max_flowrate
Method ID: 0x41FA
Method Label: Calculate Max Flowrate
Method Help: Calculates Maximum Flowrate (Qmax) value
- {
- float utapproachdiameterconverted;
- float utthroatdiameterconverted;
- float utthroatheightconverted;
- float utthroatlengthconverted;
- float utheadconverted;
- float utdischangecalc1;
- float utdischangecalc2;
- float approachchanneldiametercalc;
- float utshapecoefficientcalc;
- float utvelocitycoefficientcalculation;
- 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)
- {
- utheadconverted = span_Obj_value_0 * 0.3048;
- utapproachdiameterconverted = ut_approach_channel_diameter * 0.3048;
- utthroatdiameterconverted = ut_throat_diameter * 0.3048;
- utthroatheightconverted = ut_throat_height * 0.3048;
- utthroatlengthconverted = ut_throat_length * 0.3048;
- }
- else
- if (Distance_Obj_unit == 45)
- {
- utheadconverted = span_Obj_value_0 * 1;
- utapproachdiameterconverted = ut_approach_channel_diameter * 1;
- utthroatdiameterconverted = ut_throat_diameter * 1;
- utthroatheightconverted = ut_throat_height * 1;
- utthroatlengthconverted = ut_throat_length * 1;
- }
- else
- if (Distance_Obj_unit == 47)
- {
- utheadconverted = span_Obj_value_0 * 0.0254;
- utapproachdiameterconverted = ut_approach_channel_diameter * 0.0254;
- utthroatdiameterconverted = ut_throat_diameter * 0.0254;
- utthroatheightconverted = ut_throat_height * 0.0254;
- utthroatlengthconverted = ut_throat_length * 0.0254;
- }
- else
- if (Distance_Obj_unit == 48)
- {
- utheadconverted = span_Obj_value_0 * 0.01;
- utapproachdiameterconverted = ut_approach_channel_diameter * 0.01;
- utthroatdiameterconverted = ut_throat_diameter * 0.01;
- utthroatheightconverted = ut_throat_height * 0.01;
- utthroatlengthconverted = ut_throat_length * 0.01;
- }
- else
- if (Distance_Obj_unit == 49)
- {
- utheadconverted = span_Obj_value_0 * 0.001;
- utapproachdiameterconverted = ut_approach_channel_diameter * 0.001;
- utthroatdiameterconverted = ut_throat_diameter * 0.001;
- utthroatheightconverted = ut_throat_height * 0.001;
- utthroatlengthconverted = ut_throat_length * 0.001;
- }
- waterdepth = utheadconverted + utthroatheightconverted;
- utdischangecalc1 = 1 - 0.006 * utthroatlengthconverted / utthroatdiameterconverted;
- utdischangecalc2 = 1 - 0.003 * utthroatlengthconverted / utheadconverted;
- ut_dischargecoefficient = utdischangecalc1 * pow(utdischangecalc2,1.5);
- approachchanneldiametercalc = 0.5 * utapproachdiameterconverted;
- if (waterdepth < approachchanneldiametercalc)
- {
- utangle = acos(1 - 2 * waterdepth / utapproachdiameterconverted);
- ut_approach_channel_area = 0.25 * (utapproachdiameterconverted * utapproachdiameterconverted) * (utangle - sin(utangle) * cos(utangle));
- }
- else
- {
- ut_approach_channel_area = 0.39269 * (utapproachdiameterconverted * utapproachdiameterconverted) + (waterdepth - approachchanneldiametercalc);
- }
- utshapecoefficientcalc = utheadconverted / utthroatdiameterconverted;
- if (utshapecoefficientcalc < 0.1 || utshapecoefficientcalc > 3.0 || utshapecoefficientcalc == NaN_value())
- {
- ACKNOWLEDGE(literal_string(1475));
- process_abort();
- }
- else
- if (utshapecoefficientcalc >= 0.1 && utshapecoefficientcalc < 0.2)
- {
- ut_shapecoefficient = 0.350;
- utvelocitycoefficientcalculation = ut_shapecoefficient * utthroatdiameterconverted * utheadconverted / ut_approach_channel_area;
- if (utvelocitycoefficientcalculation < 0.04 || utvelocitycoefficientcalculation > 0.833 || utvelocitycoefficientcalculation == NaN_value())
- {
- ACKNOWLEDGE(literal_string(1476));
- process_abort();
- }
- else
- if (utvelocitycoefficientcalculation >= 0.04 && utvelocitycoefficientcalculation < 0.20)
- {
- flowratecalculated = 1.704599 * 1.008 * 0.350 * ut_dischargecoefficient * utthroatdiameterconverted * pow(utheadconverted,1.5);
- }
- else
- if (utvelocitycoefficientcalculation >= 0.2 && utvelocitycoefficientcalculation < 0.3)
- {
- flowratecalculated = 1.704599 * 1.018 * 0.350 * ut_dischargecoefficient * utthroatdiameterconverted * pow(utheadconverted,1.5);
- }
- else
- if (utvelocitycoefficientcalculation >= 0.3 && utvelocitycoefficientcalculation < 0.38)
- {
- flowratecalculated = 1.704599 * 1.030 * 0.350 * ut_dischargecoefficient * utthroatdiameterconverted * pow(utheadconverted,1.5);
- }
- else
- if (utvelocitycoefficientcalculation >= 0.38 && utvelocitycoefficientcalculation < 0.440)
- {
- flowratecalculated = 1.704599 * 1.044 * 0.350 * ut_dischargecoefficient * utthroatdiameterconverted * pow(utheadconverted,1.5);
- }
- else
- if (utvelocitycoefficientcalculation >= 0.440 && utvelocitycoefficientcalculation < 0.500)
- {
- flowratecalculated = 1.704599 * 1.058 * 0.350 * ut_dischargecoefficient * utthroatdiameterconverted * pow(utheadconverted,1.5);
- }
- else
- if (utvelocitycoefficientcalculation >= 0.500 && utvelocitycoefficientcalculation < 0.540)
- {
- flowratecalculated = 1.704599 * 1.068 * 0.350 * ut_dischargecoefficient * utthroatdiameterconverted * pow(utheadconverted,1.5);
- }
- else
- if (utvelocitycoefficientcalculation >= 0.540 && utvelocitycoefficientcalculation < 0.560)
- {
- flowratecalculated = 1.704599 * 1.075 * 0.350 * ut_dischargecoefficient * utthroatdiameterconverted * pow(utheadconverted,1.5);
- }
- else
- if (utvelocitycoefficientcalculation >= 0.560 && utvelocitycoefficientcalculation < 0.620)
- {
- flowratecalculated = 1.704599 * 1.098 * 0.350 * ut_dischargecoefficient * utthroatdiameterconverted * pow(utheadconverted,1.5);
- }
- else
- if (utvelocitycoefficientcalculation >= 0.620 && utvelocitycoefficientcalculation < 0.720)
- {
- flowratecalculated = 1.704599 * 1.146 * 0.350 * ut_dischargecoefficient * utthroatdiameterconverted * pow(utheadconverted,1.5);
- }
- else
- if (utvelocitycoefficientcalculation >= 0.720 && utvelocitycoefficientcalculation < 0.780)
- {
- flowratecalculated = 1.704599 * 1.185 * 0.350 * ut_dischargecoefficient * utthroatdiameterconverted * pow(utheadconverted,1.5);
- }
- else
- if (utvelocitycoefficientcalculation >= 0.780 && utvelocitycoefficientcalculation <= 0.833)
- {
- flowratecalculated = 1.704599 * 1.250 * 0.350 * ut_dischargecoefficient * utthroatdiameterconverted * pow(utheadconverted,1.5);
- }
- }
- else
- if (utshapecoefficientcalc >= 0.2 && utshapecoefficientcalc < 0.3)
- {
- ut_shapecoefficient = 0.480;
- utvelocitycoefficientcalculation = ut_shapecoefficient * utthroatdiameterconverted * utheadconverted / ut_approach_channel_area;
- if (utvelocitycoefficientcalculation < 0.04 || utvelocitycoefficientcalculation > 0.833 || utvelocitycoefficientcalculation == NaN_value())
- {
- ACKNOWLEDGE(literal_string(1476));
- process_abort();
- }
- else
- if (utvelocitycoefficientcalculation >= 0.04 && utvelocitycoefficientcalculation < 0.20)
- {
- flowratecalculated = 1.704599 * 1.008 * 0.480 * ut_dischargecoefficient * utthroatdiameterconverted * pow(utheadconverted,1.5);
- }
- else
- if (utvelocitycoefficientcalculation >= 0.2 && utvelocitycoefficientcalculation < 0.3)
- {
- flowratecalculated = 1.704599 * 1.018 * 0.480 * ut_dischargecoefficient * utthroatdiameterconverted * pow(utheadconverted,1.5);
- }
- else
- if (utvelocitycoefficientcalculation >= 0.3 && utvelocitycoefficientcalculation < 0.38)
- {
- flowratecalculated = 1.704599 * 1.030 * 0.480 * ut_dischargecoefficient * utthroatdiameterconverted * pow(utheadconverted,1.5);
- }
- else
- if (utvelocitycoefficientcalculation >= 0.38 && utvelocitycoefficientcalculation < 0.440)
- {
- flowratecalculated = 1.704599 * 1.044 * 0.480 * ut_dischargecoefficient * utthroatdiameterconverted * pow(utheadconverted,1.5);
- }
- else
- if (utvelocitycoefficientcalculation >= 0.440 && utvelocitycoefficientcalculation < 0.500)
- {
- flowratecalculated = 1.704599 * 1.058 * 0.480 * ut_dischargecoefficient * utthroatdiameterconverted * pow(utheadconverted,1.5);
- }
- else
- if (utvelocitycoefficientcalculation >= 0.500 && utvelocitycoefficientcalculation < 0.540)
- {
- flowratecalculated = 1.704599 * 1.068 * 0.480 * ut_dischargecoefficient * utthroatdiameterconverted * pow(utheadconverted,1.5);
Please login for more