# Visual ductulator calculation method This is a preliminary straight-duct sizing aid for unlined galvanized steel. It calculates actual airflow through the entered clear inside dimensions. Airflow is **ACFM at the selected conditions**, not standard CFM. It is not a complete duct-system design or a fan-selection calculation. ## Friction model The implementation uses Darcy-Weisbach, `Δp = f (L/Dh) ρV²/2`, in SI internally, with `L = 30.48 m`. Output converts pascals to inches water gauge using `1 in. w.g. = 249.08891 Pa`. Area is the physical cross section; velocity is flow divided by area. Round hydraulic diameter is its inside diameter. Rectangular hydraulic diameter is `2wh/(w+h)`. For Reynolds number at least 4000, the Darcy friction factor solves Colebrook iteratively: `1/√f = -2 log10(ε/(3.7Dh) + 2.51/(Re√f))`. Absolute roughness is fixed at `0.0003 ft` (`0.09144 mm`), an average galvanized-steel assumption. Actual seams, joints, condition, and construction can produce different losses. **Rectangular turbulent friction uses the hydraulic-diameter approximation, not an equal-friction round-diameter conversion.** The governing duct-friction equations, hydraulic diameter, and average roughness basis are described in [ASHRAE Fundamentals, Chapter 21, sections 3.1 and Noncircular Ducts](https://handbook.ashrae.org/Handbooks/F21/IP/F21_Ch21/F21_Ch21_ip.aspx). No fitting database or proprietary friction table is reproduced. Below Reynolds number 2300, round flow uses `f = 64/Re`. Rectangular flow uses the fully developed rectangular Poiseuille solution rather than treating a square as a circle. With `a = min(w,h)/max(w,h)`, the Darcy product is `fRe = 96/((1+a)² [1 - 192a/π⁵ Σ(tanh(nπ/(2a))/n⁵)])`, summed over odd `n` from 1 through 99. This gives approximately `56.9083` for a square. The underlying rectangular flow-rate series is given in [Simulation of Pressure-Driven and Channel-Based Microfluidics on Different Abstract Levels, Equation 2](https://pmc.ncbi.nlm.nih.gov/articles/PMC9321135/). Its continuum, no-slip, fully developed laminar solution applies here. Between Reynolds numbers 2300 and 4000, friction factor is linearly interpolated between the laminar value at 2300 and Colebrook value at 4000. This is an explicit numerical convention in a physically uncertain transition range, not a claim of measured accuracy. A design near transition needs separate engineering judgment. ## Air conditions Dry-air density is `p/(287.05 T)`, where temperature is absolute kelvin. Pressure is approximated from elevation using `p = 101325 (1 - 0.0065h/288.15)^5.25588`, with `h` in metres. The reference pressure, temperature, and tropospheric lapse rate follow the standard-atmosphere basis documented in [NASA/TM-2005-213659](https://ntrs.nasa.gov/api/citations/20050207438/downloads/20050207438.pdf). The selected duct temperature affects density separately from atmospheric pressure. Weather, humidity, duct gauge pressure, and the small geometric/geopotential altitude distinction are omitted. Dynamic viscosity uses Sutherland's law with `μ₀ = 1.716×10⁻⁵ Pa s` at `T₀ = 273.15 K`, and `S = 110.4 K`. See [NASA, Viscosity](https://www.grc.nasa.gov/www/BGH/viscosity.html) for the temperature-dependent formulation. Reynolds number is `ρVDh/μ`. ## Sizing and limits `sizeRound` returns the smallest whole-inch inside diameter meeting both the selected friction target and velocity limit, up to 120 inches. Whole-inch increments are a calculator convention, not a supplier availability guarantee. The interface uses 0.08 in. w.g./100 ft and 1500 fpm as example starting points, not universal design requirements or acoustic ratings. Accepted input domains are 0.1 to 200,000 actual CFM, dimensions 1 to 120 inches, elevation -1500 to 15,000 ft, and temperature -40 to 80°C. Computed velocity above 12,000 fpm is rejected to keep this incompressible model within a low-Mach scope. Sizing accepts friction targets 0.001 to 5 in. w.g./100 ft and velocity limits 50 to 12,000 fpm. Invalid/nonfinite values and unsatisfiable requests throw `RangeError`. These are software scope limits, not recommended operating ranges. Losses exclude elbows, transitions, takeoffs, dampers, terminals, equipment, entrance/developing flow, leakage, and system effects. Flexible, lined, dirty, damaged, and non-galvanized duct need other roughness models. Rectangular aspect ratios and construction should be reviewed independently. Results do not establish noise, balancing, code compliance, available fan pressure, or installed performance. ## Verification Run from repository root: ```sh node --test web-tests/unit/ductulator-math.test.mjs ``` Tests check a rounded independent SI hand calculation (1000 ACFM through 12 inches gives about 47.13 Pa per 100 ft), the separate Hagen-Poiseuille equation, the known square-duct laminar coefficient, dimension symmetry, friction and velocity trends, transition continuity, smallest-size selection, and rejected inputs. These checks establish numerical behavior under the stated model, not field validation.