Loading…
Loading…
方法名称: rectangular_broad_crested_weir_method_max_flowrate
方法ID: 0x41F7
方法标签: Calculate Max Flowrate
方法描述: Calculates Maximum Flowrate (Qmax) value
- {
- float rblengthconverted;
- float rbwidthconverted;
- float rbheightconverted;
- float rbheadconverted;
- 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)
- {
- rblengthconverted = rb_weir_length * 0.3048;
- rbwidthconverted = rb_weir_width * 0.3048;
- rbheightconverted = rb_weir_height * 0.3048;
- rbheadconverted = span_Obj_value_0 * 0.3048;
- }
- else
- if (Distance_Obj_unit == 45)
- {
- rblengthconverted = rb_weir_length * 1;
- rbwidthconverted = rb_weir_width * 1;
- rbheightconverted = rb_weir_height * 1;
- rbheadconverted = span_Obj_value_0 * 1;
- }
- else
- if (Distance_Obj_unit == 47)
- {
- rblengthconverted = rb_weir_length * 0.0254;
- rbwidthconverted = rb_weir_width * 0.0254;
- rbheightconverted = rb_weir_height * 0.0254;
- rbheadconverted = span_Obj_value_0 * 0.0254;
- }
- else
- if (Distance_Obj_unit == 48)
- {
- rblengthconverted = rb_weir_length * 0.01;
- rbwidthconverted = rb_weir_width * 0.01;
- rbheightconverted = rb_weir_height * 0.01;
- rbheadconverted = span_Obj_value_0 * 0.01;
- }
- else
- if (Distance_Obj_unit == 49)
- {
- rblengthconverted = rb_weir_length * 0.001;
- rbwidthconverted = rb_weir_width * 0.001;
- rbheightconverted = rb_weir_height * 0.001;
- rbheadconverted = span_Obj_value_0 * 0.001;
- }
- rb_dischargecoefficientcalc1 = rbheadconverted / rbheightconverted;
- rb_dischargecoefficientcalc2 = rbheadconverted / rblengthconverted;
- if (rb_dischargecoefficientcalc1 < 0.1 || rb_dischargecoefficientcalc1 > 1.6 || rb_dischargecoefficientcalc1 == NaN_value() || rb_dischargecoefficientcalc2 < 0.1 || rb_dischargecoefficientcalc2 > 1.6 || rb_dischargecoefficientcalc2 == NaN_value())
- {
- ACKNOWLEDGE(literal_string(1470));
- process_abort();
- }
- else
- if (rb_dischargecoefficientcalc1 >= 0.1 && rb_dischargecoefficientcalc1 < 0.3 && (rb_dischargecoefficientcalc2 >= 0.1 && rb_dischargecoefficientcalc2 < 0.3))
- {
- flowratecalculated = 1.704599 * 0.855 * rbwidthconverted * pow(rbheadconverted,1.5);
- }
- else
- if (rb_dischargecoefficientcalc1 >= 0.3 && rb_dischargecoefficientcalc1 < 0.5 && (rb_dischargecoefficientcalc2 >= 0.1 && rb_dischargecoefficientcalc2 < 0.3))
- {
- flowratecalculated = 1.704599 * 0.873 * rbwidthconverted * pow(rbheadconverted,1.5);
- }
- else
- if (rb_dischargecoefficientcalc1 >= 0.5 && rb_dischargecoefficientcalc1 < 0.7 && (rb_dischargecoefficientcalc2 >= 0.1 && rb_dischargecoefficientcalc2 < 0.3))
- {
- flowratecalculated = 1.704599 * 0.892 * rbwidthconverted * pow(rbheadconverted,1.5);
- }
- else
- if (rb_dischargecoefficientcalc1 >= 0.7 && rb_dischargecoefficientcalc1 < 0.9 && (rb_dischargecoefficientcalc2 >= 0.1 && rb_dischargecoefficientcalc2 < 0.3))
- {
- flowratecalculated = 1.704599 * 0.911 * rbwidthconverted * pow(rbheadconverted,1.5);
- }
- else
- if (rb_dischargecoefficientcalc1 >= 0.9 && rb_dischargecoefficientcalc1 < 1.1 && (rb_dischargecoefficientcalc2 >= 0.1 && rb_dischargecoefficientcalc2 < 0.3))
- {
- flowratecalculated = 1.704599 * 0.929 * rbwidthconverted * pow(rbheadconverted,1.5);
- }
- else
- if (rb_dischargecoefficientcalc1 >= 1.1 && rb_dischargecoefficientcalc1 < 1.3 && (rb_dischargecoefficientcalc2 >= 0.1 && rb_dischargecoefficientcalc2 < 0.3))
- {
- flowratecalculated = 1.704599 * 0.944 * rbwidthconverted * pow(rbheadconverted,1.5);
- }
- else
- if (rb_dischargecoefficientcalc1 >= 1.3 && rb_dischargecoefficientcalc1 < 1.5 && (rb_dischargecoefficientcalc2 >= 0.1 && rb_dischargecoefficientcalc2 < 0.3))
- {
- flowratecalculated = 1.704599 * 0.959 * rbwidthconverted * pow(rbheadconverted,1.5);
- }
- else
- if (rb_dischargecoefficientcalc1 >= 1.5 && rb_dischargecoefficientcalc1 <= 1.6 && (rb_dischargecoefficientcalc2 >= 0.1 && rb_dischargecoefficientcalc2 < 0.3))
- {
- flowratecalculated = 1.704599 * 0.978 * rbwidthconverted * pow(rbheadconverted,1.5);
- }
请登录以获得完整内容