function updateLabels() {
var unit = document.getElementById('rfr_units').value;
if (unit === 'imperial') {
document.getElementById('label_width').innerText = 'Average Width (ft)';
document.getElementById('label_depth').innerText = 'Average Depth (ft)';
document.getElementById('label_distance').innerText = 'Float Travel Distance (ft)';
} else {
document.getElementById('label_width').innerText = 'Average Width (m)';
document.getElementById('label_depth').innerText = 'Average Depth (m)';
document.getElementById('label_distance').innerText = 'Float Travel Distance (m)';
}
}
function calculateFlowRate() {
// 1. Get input values using var
var width = parseFloat(document.getElementById('rfr_width').value);
var depth = parseFloat(document.getElementById('rfr_depth').value);
var distance = parseFloat(document.getElementById('rfr_distance').value);
var time = parseFloat(document.getElementById('rfr_time').value);
var correction = parseFloat(document.getElementById('rfr_bed').value);
var unit = document.getElementById('rfr_units').value;
// 2. Validation
if (isNaN(width) || isNaN(depth) || isNaN(distance) || isNaN(time) || time <= 0 || width <= 0 || depth <= 0) {
alert("Please enter valid positive numbers for all fields. Time cannot be zero.");
return;
}
// 3. Calculation Logic
// Velocity = Distance / Time
var surfaceVelocity = distance / time;
// Cross-Sectional Area = Width * Depth (Assuming rectangular approximation)
var area = width * depth;
// Adjusted Flow Rate (Discharge) Q = A * V * C
// Surface velocity is faster than average velocity, hence the correction factor (C)
var flowRate = area * surfaceVelocity * correction;
// 4. Output Formatting based on Units
var velocityText = "";
var areaText = "";
var flowText = "";
var secondaryText = "";
if (unit === 'imperial') {
velocityText = surfaceVelocity.toFixed(2) + " ft/s";
areaText = area.toFixed(2) + " sq ft";
flowText = flowRate.toFixed(2) + " cfs (cubic ft/sec)";
// Convert CFS to Gallons Per Minute (1 CFS approx 448.831 GPM)
var gpm = flowRate * 448.831;
secondaryText = gpm.toLocaleString(undefined, {maximumFractionDigits: 0}) + " Gallons/min";
} else {
velocityText = surfaceVelocity.toFixed(2) + " m/s";
areaText = area.toFixed(2) + " sq m";
flowText = flowRate.toFixed(2) + " m³/s (cubic m/sec)";
// Convert m3/s to Liters Per Second (1 m3 = 1000 L)
var lps = flowRate * 1000;
secondaryText = lps.toLocaleString(undefined, {maximumFractionDigits: 0}) + " Liters/sec";
}
// 5. Display Results
document.getElementById('rfr_velocity_res').innerText = velocityText;
document.getElementById('rfr_area_res').innerText = areaText;
document.getElementById('rfr_final_flow').innerText = flowText;
document.getElementById('rfr_secondary_flow').innerText = secondaryText;
document.getElementById('rfr_result_display').style.display = 'block';
}
How to Calculate Water Flow Rate in a River
Calculating the flow rate (also known as discharge) of a river or stream is an essential skill for hydrologists, civil engineers, and environmental scientists. It determines the volume of water passing through a specific cross-section of the river over a unit of time. This metric is crucial for flood prediction, water resource management, and designing bridges or dams.
The Float Method Formula
The calculator above uses the "Float Method," which is the most practical way to estimate discharge without expensive equipment. The formula used is:
Q = A × V × C
Q (Discharge): The total flow rate (Cubic Feet per Second or Cubic Meters per Second).
A (Area): The cross-sectional area of the river (Width × Average Depth).
V (Surface Velocity): The speed at which an object floats on the surface (Distance / Time).
C (Coefficient): A correction factor. Water on the surface moves faster than water at the bottom due to friction with the riverbed.
Step-by-Step Measurement Guide
To use this calculator accurately, follow these steps in the field:
Select a Section: Find a straight section of the river where the width and depth are relatively consistent. Avoid bends or large obstacles.
Measure Width: Measure the width of the stream from water's edge to water's edge.
Measure Depth: Measure the depth at several points (e.g., 25%, 50%, and 75% across the width) and calculate the average.
Measure Velocity:
Mark a start point and an end point along the bank (e.g., 20 feet apart).
Toss a floating object (like an orange or a stick) into the middle of the stream slightly upstream of the start point.
Time how long it takes (in seconds) for the object to travel from the start point to the end point.
Repeat this 3 times and use the average time for better accuracy.
Select Bed Type: Choose the correction factor. Use 0.8 for rocky or rough riverbeds (more friction) and 0.9 for smooth, muddy, or concrete channels (less friction).
Why is the Correction Coefficient Important?
If you simply multiply the area by the surface velocity, you will overestimate the flow rate. The water at the very bottom of the river moves much slower than the surface due to friction against rocks and sand. The correction coefficient (typically between 0.8 and 0.9) adjusts the calculation to reflect the average velocity of the entire water column, not just the top layer.
Applications of River Flow Data
Understanding the discharge rate helps in:
Irrigation: Determining if there is enough water flow to support agricultural pumps.
Recreation: Assessing safety for kayaking or swimming (measured in CFS or CMS).
Micro-Hydro Power: Calculating potential energy generation based on flow and head height.
Flood Monitoring: tracking changes in water volume during heavy rainfall.