This document describes the computational methods, formulas, references, and known limitations of HydroComplete Pro. Engineers are responsible for verifying that the methods implemented here are appropriate for their specific application and for applying their professional judgment to interpret results. Nothing in this manual substitutes for site investigation, regulatory review, or a licensed professional engineer’s seal. Intended for use by licensed professionals.
Cite as: HydroComplete Pro Technical Reference Manual, Version 1.0, April 2026.
HydroComplete Pro is a browser-based stormwater and hydrology analysis platform that assembles four independent computation engines behind a diagram-driven user interface. Engineers build a watershed model by placing nodes (watersheds, BMPs, outlets) and links (pipes, swales) on a canvas; the platform runs the connected analysis through the engines and reports numerical results, formula steps, and regulatory compliance findings.
The four engines and their domains are:
Supporting modules include a HydraulicEngine core for open-channel normal depth, critical depth, and gradually varied flow profiles (standard step); a BMPOptimizer for cost-effectiveness ranking and lifecycle cost analysis; and a ComplianceChecker that evaluates analysis output against state regulatory configurations (NC, SC, VA).
HydroComplete Pro is not a two-dimensional hydraulic model. It does not solve the full Saint-Venant equations in the momentum form, does not simulate bed-load transport, and does not perform a long-term continuous simulation. It does not replace HEC-RAS for detailed floodplain hydraulics, EPA SWMM for long-term continuous urban simulation, or SEDCAD4 for reservoir deposition forecasts over multi-year horizons. See Chapter 9 — Known Limitations and Scope for a full list.
HydroComplete Pro does not make permit decisions. It reports numerical results and checks them against configured state rules; the licensed professional engineer of record is responsible for the correctness of inputs, interpretation of outputs, and the final seal on any submittal.
HydroComplete Pro is intended for use by licensed professional engineers, their supervised staff, and by students and educators for coursework. Results generated by HydroComplete Pro are not PE-sealed. A sealed calculation package requires review and endorsement by a licensed PE who has taken professional responsibility for the inputs and outputs.
Every engine in HydroComplete Pro implements peer-reviewed methods from published references. Every formula in this manual is cited to its original publication or to a primary engineering source. However, published methods come with their own validity envelopes: the Rational Method is not valid for large watersheds, the SCS curve-number method is not valid for winter snowmelt events, Stokes’ law is not valid for sand-sized particles in warm water, and so on. The engineer using HydroComplete Pro is responsible for verifying that the method the platform applies is appropriate for the site in question.
HydroComplete Pro Technical Reference Manual, Version 1.0, April 2026. Section numbers and equation numbers in this manual are stable across minor revisions.
HydroComplete Pro uses US customary units throughout: feet, inches, square feet, acres, cubic feet, acre-feet, cubic feet per second (cfs), tons per acre per year, and degrees Fahrenheit. Internal physical constants are taken as $g = 32.174 \text{ ft/s}^2$ and, for the Stokes/Rubey settling module, the SI-unit equivalent $g = 9.81 \text{ m/s}^2$ with conversions back to ft/s for reporting. Water temperature is input in degrees Celsius to match the kinematic viscosity table.
The Hydraflow Engine (source: src/engines/HydraflowEngine.js)
implements event-based rainfall-runoff and routing. It is designed for peak-flow
and hydrograph analysis of single design storms; it does not perform continuous
simulation.
Direct runoff depth $Q$ from rainfall depth $P$ is computed by the NRCS Curve Number method (Soil Conservation Service, 1954; NRCS, 2004). The runoff equation and potential maximum retention $S$ are:
where $Q$ is runoff depth (in), $P$ is cumulative rainfall depth (in), $S$ is potential maximum retention (in), $I_a$ is initial abstraction (in), and $CN$ is the dimensionless curve number (30–98) from NRCS TR-55 Table 2-2 based on hydrologic soil group and land cover.
Variables and typical ranges:
| Symbol | Name | Units | Typical range |
|---|---|---|---|
| $P$ | Cumulative rainfall depth | in | 0.5 – 15 |
| $CN$ | Curve number | — | 30 (A-soil forest) – 98 (pavement) |
| $S$ | Potential maximum retention | in | 0.2 – 23.3 |
| $I_a$ | Initial abstraction | in | $0.2\,S$ |
| $Q$ | Runoff depth | in | 0 – $P$ |
The Hydraflow Engine accumulates rainfall by timestep (from a design-storm hyetograph) and evaluates the running $Q(t)$ as in the NRCS method; incremental runoff at each timestep is the difference from the previous step. The initial abstraction fraction is fixed at 0.2 (the classical ratio).
The Conveyance Engine computes a composite $t_c$ from a sequence of sub-reaches using the three flow regimes prescribed in NRCS TR-55 Chapter 3 (USDA-NRCS, 1986):
Travel time for each segment is $t = L/V/3600$ (hours); the composite $t_c$ is the sum of segment travel times.
Two additional empirical $t_c$ methods are available for small-watershed screening or when segment-by-segment data is not yet developed:
Kirpich (1940) — developed for small agricultural watersheds in Tennessee with well-defined channels:
where $t_c$ is in minutes, $L$ is the maximum flow path length (ft), and $S$ is the average watershed slope (ft/ft). Reference: Kirpich (1940).
FAA (1970) — developed for overland flow on airport surfaces; appropriate for small, relatively flat paved or graded areas:
where $t_c$ is in minutes, $C$ is the Rational Method runoff coefficient (0–1), $L$ is the overland flow length (ft), and $S$ is the surface slope (%). Reference: FAA Advisory Circular AC 150/5320-5B (1970).
The SCS dimensionless unit hydrograph is defined by the triangular approximation with a peak-rate factor of 484 (NRCS NEH Part 630, Chapter 16; NRCS, 2007). The Hydraflow Engine computes lag time, time-to-peak, and peak unit discharge as:
where $t_c$ is the time of concentration (hr), $t_{lag}$ is the watershed lag time (hr), $T_p$ is the time to peak (hr), $q_p$ is the peak unit discharge (cfs per inch of runoff), and $A$ is the drainage area (square miles).
The 484 peak-rate factor is the standard SCS value for “average” humid watersheds. NRCS NEH Chapter 16 documents an acceptable range of roughly 300 (flat, arid, swampy watersheds) to 600 (steep, well-drained watersheds). Hydraflow’s current release uses 484 as a fixed constant. For watersheds outside the humid-average envelope the engineer should verify the peak-rate factor against site conditions and, if needed, adjust the resulting peak flow manually. A future release may expose the peak-rate factor as a user input.
The engine then convolves incremental runoff depths with the dimensionless unit hydrograph ordinates. Ordinate-by-ordinate flow is accumulated into the design hydrograph via linear superposition, a standard application of the unit-hydrograph principle (Sherman, 1932).
The Hydraflow Engine ships with a 19-city database of NOAA Atlas 14 24-hour precipitation depths for return periods 1, 2, 5, 10, 25, 50, and 100 years. Sources: NOAA Atlas 14 Precipitation Frequency Atlas, Volumes 1–11 (Bonnin et al., 2006–2011; Perica et al., 2013). Each city record also includes latitude, longitude, annual average rainfall, number of rain events per year, monthly totals, and the assigned SCS rainfall distribution (Type I, IA, II, or III per NRCS TR-55 Figure B-2).
| City | 2-yr | 10-yr | 25-yr | 100-yr | SCS type |
|---|---|---|---|---|---|
| Charlotte, NC | 3.38 | 5.02 | 6.10 | 7.99 | II |
| Raleigh, NC | 3.53 | 5.25 | 6.40 | 8.41 | II |
| Asheville, NC | 3.12 | 4.71 | 5.78 | 7.67 | II |
| Atlanta, GA | 3.32 | 4.91 | 5.97 | 7.82 | II |
| Houston, TX | 4.23 | 6.63 | 8.27 | 11.14 | III |
| Los Angeles, CA | 2.36 | 3.97 | 5.04 | 6.89 | I |
The engine synthesizes design hyetographs from SCS Type I, IA, II, and III 24-hour distributions by converting the published cumulative rainfall fractions into incremental rainfall at a user-specified timestep (default 0.1 hr).
The built-in Atlas-14 database currently covers 19 cities. Outside those cities the engineer should pull project-specific precipitation frequency estimates from hdsc.nws.noaa.gov/hdsc/pfds/ and enter them manually. The engine does not geocode arbitrary locations against Atlas-14 grids.
Detention pond routing uses the Storage-Indication (Modified Puls) method (NRCS NEH Part 630, Chapter 17; USACE, 2000). The continuity equation is written so that all unknowns appear on one side:
where $S$ is storage volume (ft$^3$), $O$ is outflow (cfs), $I$ is inflow (cfs), and subscripts 1 and 2 denote the start and end of the timestep. For each step the engine computes the right-hand side from known quantities, then solves for the pair $(S_2, O_2)$ by interpolating the user-supplied storage–outflow curve expressed in the form $\frac{2S}{\Delta t} + O$ vs. $O$.
The default routing timestep is 0.1 hr (6 min). When the pond has multiple outlets (see §2.7), each outlet’s contribution to total outflow is tracked and interpolated separately so that downstream routing can use the individual per-outlet hydrographs.
Channel reach routing uses the physically-based Muskingum-Cunge method (Cunge, 1969; Ponce, 1989; USACE EM 1110-2-1417, 1994), which derives the routing parameters from channel geometry and a reference flow rather than requiring the engineer to supply $K$ and $X$ directly.
Reference normal depth $d_{ref}$ is found by bisection on Manning’s equation at the peak inflow $Q_{ref}$. The kinematic wave celerity, reach travel time, and weighting factor are then:
where $c$ is celerity (ft/s), $V_{ref}$ is reference velocity (ft/s), $L$ is reach length (ft), $B_{ref}$ is top width at reference depth (ft), and $S$ is bed slope (ft/ft). $X$ is clamped to the valid range $[0, 0.5]$.
The routing equation is the classical Muskingum form applied at each timestep:
with coefficients computed from $K$, $X$, and the routing timestep $\Delta t$:
The engine checks the Courant stability condition $2KX \leq \Delta t \leq 2K(1-X)$ and adjusts $\Delta t$ into the valid envelope if necessary. It verifies $C_1 + C_2 + C_3 = 1$ after each routing run as a mass-balance check.
The Hydraflow Engine supports control structures with multiple hydraulically independent outlets (e.g., a low-flow orifice, a principal weir, and an emergency spillway stacked in a single riser). The storage-outflow curve stores per-outlet flows at every elevation; during routing the engine tracks each outlet’s contribution to the total and produces a separate outflow hydrograph per outlet, which allows downstream routing to send each outlet’s flow to a different downstream node.
Outlet primitives include:
The Hydraflow Engine supports inline flow splitters that divert flow above a
user-defined threshold to a bypass path while passing low flows through to a
treatment train. The splitHydrograph(hydrograph, thresholdQ) method
splits each timestep as:
Volume is conserved at every timestep: $Q_{primary}(t) + Q_{bypass}(t) = Q_{in}(t)$. A typical use case routes low flows to a water-quality treatment BMP (e.g., bioretention or sand filter) while bypassing peak storm flows directly to the detention pond or receiving stream.
The culvertHeadwater(Q, culvert, tailwater) method implements the FHWA
Hydraulic Design Series No. 5 inlet-control vs. outlet-control analysis (Schall
et al., 2012). The governing headwater is the greater of the two control modes.
Inlet control headwater is computed from the FHWA nomograph equations. At low heads the entrance acts as an unsubmerged weir; as head rises above a transition depth the flow regime changes to a submerged orifice. The engine evaluates both forms and takes the maximum.
Under outlet control, headwater is governed by the sum of entrance, friction, and exit losses through the barrel:
where $K_e$ is the entrance loss coefficient, $n$ is the barrel Manning’s roughness, $L$ is the barrel length (ft), $R$ is the hydraulic radius (ft), $V$ is the barrel velocity (ft/s), and $g = 32.174$ ft/s$^2$. The controlling headwater is $HW = \max(HW_{inlet}, HW_{outlet})$.
Culvert analysis is integrated into the storage-outflow curve as
type: ’culvert’ in generateStorageCurve,
allowing culvert outlets to participate in Modified Puls routing alongside orifice
and weir outlets. Reference: FHWA HDS-5 (Schall et al., 2012).
A triangular (V-notch) weir is available as an outlet type for both low-flow measurement and water-quality orifice sizing. The discharge equation is:
where $C_v$ is the V-notch discharge coefficient (typically 0.58–0.62 for
a sharp-crested notch), $\theta$ is the notch angle, $h$ is the head above the
notch vertex (ft), and $g = 32.174$ ft/s$^2$. The V-notch weir is integrated as
type: ’vnotch’ in generateStorageCurve.
Reference: Kindsvater & Carter (1957).
When two ponds in series are close enough that the downstream pond’s water
surface elevation affects the upstream pond’s outlet capacity, the
routeInterconnectedPonds(hydrograph, upstreamPond, downstreamPond)
method performs iterative Modified Puls routing:
Convergence is typically achieved in 3–5 iterations. This method captures the backwater effect that can reduce upstream pond performance during large storms when the downstream pond is simultaneously filling.
The SEDCAD4 Engine (source: src/engines/SEDCAD4Engine.js) is the
centerpiece of HydroComplete Pro’s erosion and sediment control (ESC) module.
It implements annual soil loss (RUSLE), single-storm yield (MUSLE), sediment
delivery ratios, physics-based particle settling with the Camp equation, and the
design of the four standard sediment control structures used in North Carolina
and most Southeastern erosion control programs. Where possible, inputs are pulled
from USDA-NRCS SSURGO via the Soil Data Access (SDA) REST service so that K-factor,
particle-size distribution, organic matter, and bulk density are site-specific
rather than generic lookups.
Annual average sheet-and-rill soil loss is computed by the Revised Universal Soil Loss Equation (Renard et al., 1997; USDA Agriculture Handbook No. 703):
where $A$ is the long-term average annual soil loss (tons per acre per year), $R$ is the rainfall-runoff erosivity factor, $K$ is the soil erodibility factor, $LS$ is the combined slope length and steepness factor, $C$ is the cover and management factor, and $P$ is the support practice factor.
| Factor | Units | Typical range | Source in HydroComplete |
|---|---|---|---|
| $R$ | hundreds of ft-tonf in hr$^{-1}$ yr$^{-1}$ | 80 – 350 | NRCS isoerodent map (Renard et al., 1997, Fig. 2-1); by city code. |
| $K$ | ton ac hr / (hundreds of ac ft-tonf in) | 0.05 (sand) – 0.60 (silt) | SSURGO kwfact when available; otherwise textural lookup. |
| $LS$ | dimensionless | 0.1 – 20 | McCool et al. (1987); computed from slope length and steepness. |
| $C$ | dimensionless | 0.001 (forest) – 1.00 (bare) | Renard et al. (1997); by land cover class. |
| $P$ | dimensionless | 0.15 (terracing) – 1.00 (none) | Renard et al. (1997); by support practice. |
The combined slope length and steepness factor is computed per McCool et al. (1987) as coded in SEDCAD4Engine.calculateLSFactor():
where $\lambda$ is slope length (ft), $s$ is slope in percent, and $\theta$ is the slope angle. The 72.6-ft denominator is the RUSLE unit-plot length.
kwfact if
available); slope length 100 ft at 5%; bare construction ($C = 0.90$); no
support practice ($P = 1.00$); $A_{site} = 5$ ac.For single-storm sediment yield computations the engine implements the Modified Universal Soil Loss Equation (Williams, 1975; USDA Agricultural Research Service):
where $Y$ is storm sediment yield in tons, $Q_{vol}$ is the storm runoff volume in acre-feet, $q_p$ is the storm peak flow in cfs, and $K$, $LS$, $C$, $P$ are the same factors as in RUSLE. The 95 coefficient and the 0.56 exponent are empirical fits to the USDA watershed dataset used by Williams (1975); the hydrologic term $95\,(Q_{vol}\,q_p)^{0.56}$ replaces RUSLE’s $R$ factor because sediment delivery in a single storm depends on both runoff volume and peak rate, not just long-term rainfall energy.
MUSLE is appropriate when a single design-storm sediment yield is needed (e.g., sizing a sediment basin to trap one 25-yr storm’s sediment). RUSLE is appropriate for annual average loss and for the long-term operating sediment accumulation estimate.
Not all sediment eroded from upland sources reaches the watershed outlet. SEDCAD4 applies a sediment delivery ratio (SDR) based on drainage area using the two published forms coded in calculateSedimentYield():
A linear slope adjustment $SDR \leftarrow SDR(1 + 0.01\,s)$ is applied and the result is capped at 1.0. Sediment yield is then $Y = A_{loss} \cdot SDR$. The SDR is a coarse correction that rolls up deposition on foot-slopes, in depressions, and in vegetated buffers into a single coefficient. For a formal delivery budget with explicit deposition zones, use a dedicated watershed sediment budget model.
This section documents the most important upgrade in the 2026 release of
HydroComplete Pro: the replacement of hardcoded trap efficiencies with a
physics-based particle settling calculation using the USDA 7-bin particle size
distribution, Stokes’ law, Rubey’s transition formula, and
Camp’s (1946) ideal settling basin efficiency. The full implementation
appears in SEDCAD4Engine.js under the header
PHYSICS-BASED PSD, STOKES SETTLING VELOCITY, CAMP’S BASIN EFFICIENCY.
Soil particles are binned according to the USDA-NRCS Soil Survey Manual
(Soil Survey Staff, 2017) and Gee & Bauder (1986). HydroComplete’s
PSD_BINS constant holds the bin definitions shown below. The
representative diameter for each bin is the geometric mean of the bin bounds,
which is the conventional choice for settling-velocity computations.
| Bin | Name | $d_{min}$ (mm) | $d_{max}$ (mm) | $d_{rep}$ (mm) |
|---|---|---|---|---|
| clay | Clay | < 0.002 | 0.002 | 0.0008 |
| silt | Silt | 0.002 | 0.050 | 0.010 |
| sandVFS | Very fine sand | 0.050 | 0.100 | 0.075 |
| sandFS | Fine sand | 0.100 | 0.250 | 0.158 |
| sandMS | Medium sand | 0.250 | 0.500 | 0.354 |
| sandCS | Coarse sand | 0.500 | 1.000 | 0.707 |
| sandVCS | Very coarse sand | 1.000 | 2.000 | 1.414 |
For particles small enough that inertial forces are negligible ($\mathrm{Re}_p \ll 1$), the settling velocity of a sphere in still water is derived by balancing gravity against viscous drag (Stokes, 1851; see also Fair & Geyer, 1954; Rouse, 1938):
where $V_s$ is terminal settling velocity (m/s), $g = 9.81$ m/s$^2$, $\rho_s$ is particle density (kg/m$^3$; 2650 for quartz), $\rho_w$ is water density (1000 kg/m$^3$ at 20°C), $d$ is particle diameter (m), and $\mu$ is dynamic viscosity (Pa·s; 1.004×10$^{-3}$ at 20°C).
Validity: Stokes’ law is exact only as $\mathrm{Re}_p \to 0$; it is commonly used for $\mathrm{Re}_p < 1$, but the drag coefficient begins to deviate from the Stokes value noticeably by $\mathrm{Re}_p \approx 0.5$. Rouse (1938) recommends the more conservative $\mathrm{Re}_p \leq 0.5$ cutoff, which HydroComplete adopts as the regime boundary. Particles coarser than this boundary are handled by Rubey’s transition formula (below).
Kinematic viscosity of water varies strongly with temperature; HydroComplete uses the table below (standard reference values; see White, 2006, Appendix A).
| Temperature (°C) | $\nu$ (m$^2$/s) |
|---|---|
| 5 | 1.519×10$^{-6}$ |
| 10 | 1.307×10$^{-6}$ |
| 15 | 1.139×10$^{-6}$ |
| 20 | 1.004×10$^{-6}$ |
| 25 | 0.893×10$^{-6}$ |
For particles in the 0.1–2 mm range (fine to very coarse sand in the USDA classification), Reynolds numbers typically exceed the Stokes ceiling and the drag coefficient transitions from the $24/\mathrm{Re}$ Stokes form toward a turbulent-wake value. Rubey (1933) published an explicit closed-form solution to the full drag balance that is valid through this transition regime:
where $SG$ is particle specific gravity (2.65 for quartz), $d$ is diameter (m), $g$ is gravitational acceleration, and $\nu$ is kinematic viscosity. The Rubey form is valid from approximately 0.1 mm to 2 mm for natural quartz sand in water; above 2 mm, fully turbulent forms (e.g., Dietrich 1982) are more appropriate.
HydroComplete’s regime selection logic tests $\mathrm{Re}_p$ computed under the Stokes solution and switches to Rubey if the Reynolds number exceeds 0.5. The regime name is returned alongside the velocity so that reviewers can verify the computation path.
| $d$ (mm) | Regime | $V_s$ (m/s), computed | $V_s$ (m/s), published | Δ |
|---|---|---|---|---|
| 0.001 (clay) | Stokes | ~9×10$^{-7}$ | 8.5×10$^{-7}$ | < 20% |
| 0.01 (silt) | Stokes | ~8.9×10$^{-5}$ | 8.47×10$^{-5}$ | < 20% |
| 0.1 (VFS boundary) | Stokes/Rubey transition | ~8×10$^{-3}$ | 6.92×10$^{-3}$ | < 35% |
| 0.5 (medium sand) | Rubey | ~0.07 | 0.072 | < 35% |
| 1.0 (coarse sand) | Rubey | ~0.11 | 0.116 | < 35% |
The 0.1-mm bin sits at the Stokes/Rubey transition and published
values from different sources differ by roughly ±30% in this regime
because it is the regime where simplified settling theories are least accurate.
HydroComplete’s test suite (test-stokes-camp.js) allows
a 35% tolerance at the transition bins and tighter 20% tolerances
at pure Stokes diameters.
HydroComplete’s buildPSDFromSiteData() method accepts any
of the following inputs, in order of preference:
sandvc_r,
sandco_r, sandmed_r, sandfine_r,
sandvf_r) from the USDA-NRCS Soil Data Access query. These are
stored as percent of the whole sample; the engine normalizes them so the
subclass sum equals the reported total sand fraction to correct for rounding
drift.sandtotal_r, silttotal_r, claytotal_r.
The sand fraction is cascaded into the five sand bins using published general
within-class proportions from Kilmer & Alexander (1949) and the SEDCAD4
default particle-size library: VFS 15%, FS 25%, MS 30%,
CS 20%, VCS 10%.The 7-bin PSD is a dictionary of fractions that sums to 1.0. The resulting
_source tag in the PSD object ("SSURGO sand subclasses"
or "Kilmer-Alexander defaults") is carried through the calculation
so the output report shows the provenance of the particle distribution.
Camp (1946) showed that for an ideal quiescent settling basin with uniform horizontal flow, no short-circuiting, and a uniform particle input distribution over the depth, the fraction of particles of a given diameter $d$ that are trapped is:
where $V_o$ is the overflow velocity (ft/s; the ratio of design inflow to basin surface area), $V_s(d)$ is the settling velocity for the representative diameter of the bin (ft/s, from Stokes or Rubey), and $A_s$ is the basin water-surface area (ft$^2$).
The overall weighted trap efficiency is the sum over the 7 USDA bins:
where $f_i$ is the incoming fraction of the $i$-th bin (from
buildPSDFromSiteData) and $\eta_i$ is the per-bin trap efficiency.
The per-bin results, overflow velocity, total efficiency, and PSD provenance
are all returned in the calculateCampEfficiency() output object
and are surfaced in the analysis report.
The Camp equation assumes an ideal basin: no short-circuiting, perfect plug flow, uniform particle entry across the full depth, and no re-suspension. Real basins under-perform Camp because short-circuiting, wind-driven surface currents, inlet jets, and flocculation all reduce the effective residence time. Real basins can also over-perform Camp for very fine material because flocculation turns individual clay particles into larger aggregates that settle faster than Stokes predicts for a single particle. In most engineering practice the Camp efficiency is treated as a conservative upper bound on the achievable design-basis trap efficiency of a properly baffled basin.
Site soil data is pulled from USDA-NRCS Soil Data Access (SDA) through
server/routes/soilData.js. The backend builds a WKT point or polygon
from the project location and issues a POST to the SDA tabular service endpoint
at sdmdataaccess.nrcs.usda.gov/Tabular/SDMTabularService/post.rest. The
SDA query joins the four SSURGO tables required to retrieve surface-horizon
soil properties for the dominant component of each map unit:
SELECT mapunit.mukey, mapunit.muname,
component.compname, component.comppct_r, component.hydgrp,
chorizon.hzdept_r, chorizon.hzdepb_r,
chorizon.sandtotal_r, chorizon.silttotal_r, chorizon.claytotal_r,
chorizon.sandvc_r, chorizon.sandco_r, chorizon.sandmed_r,
chorizon.sandfine_r, chorizon.sandvf_r,
chorizon.kwfact, chorizon.kffact, chorizon.om_r, chorizon.dbthirdbar_r,
chtexturegrp.texture
FROM mapunit
INNER JOIN component ON component.mukey = mapunit.mukey
LEFT OUTER JOIN chorizon ON chorizon.cokey = component.cokey AND chorizon.hzdept_r = 0
LEFT OUTER JOIN chtexturegrp ON chtexturegrp.chkey = chorizon.chkey AND chtexturegrp.rvindicator = 'Yes'
WHERE component.majcompflag = 'Yes'
AND mapunit.mukey IN (SELECT * FROM SDA_Get_Mukey_from_intersection_with_WktWgs84('__WKT__'))
ORDER BY mapunit.mukey, component.comppct_r DESC
The query is restricted to the surface horizon of the dominant
component (majcompflag = 'Yes', hzdept_r = 0) so
that sediment calculations reflect the erodible topsoil and not a deeper
subsoil layer. The fields used by downstream calculations are:
sandtotal_r, silttotal_r, claytotal_r — total percentages used to build the 3-bin and 7-bin PSDs.sandvc_r, sandco_r, sandmed_r, sandfine_r, sandvf_r — sand subclass percentages (VCS, CS, MS, FS, VFS) used directly by buildPSDFromSiteData() when available.kwfact, kffact — RUSLE K factor. Used as siteData.kFactor when present; the textural lookup is the fallback.om_r — organic matter (reported, not currently used for additional K correction).dbthirdbar_r — bulk density at 1/3-bar water content (g/cm$^3$). Used as the site-specific deposited-sediment bulk density in sediment-storage sizing when provided; the default is 80 lb/ft$^3$.hydgrp — hydrologic soil group (A/B/C/D) for curve-number selection.The multiple-row SDA response is aggregated by map unit; fractions across multiple map units in a polygon AOI are area-weighted. The resulting soil properties replace the default SEDCAD4Engine lookup values and flow through both RUSLE and the Camp-equation basin calculations, so a project’s soil loss and basin efficiency reflect the actual SSURGO soil series rather than a generic textbook entry.
Sediment basin surface area is sized to the North Carolina Erosion and Sediment Control Planning and Design Manual rule of 435 ft$^2$ of water surface per cfs of design peak flow (NCDEQ, 2013). Minimum depth is 3 ft, length-to- width ratio 2:1 minimum, forebay 25% of total volume, dewatering no more than 48 hours.
Six-month sediment storage is added to the water storage by converting the
estimated sediment yield to volume at the specified bulk density. When SSURGO
dbthirdbar_r is available it overrides the 80 lb/ft$^3$ default.
where $Y$ is sediment yield (tons/ac/yr), $A_{drain}$ is drainage area (ac), $\gamma_{bulk}$ is bulk density (lb/ft$^3$), and the 0.5 factor represents the 6-month accumulation. Trap efficiency is computed by the Camp equation (§3.4) whenever site PSD data is provided; otherwise the engine falls back to a weighted 3-bin method and, as a last resort, to the NCDEQ manual’s default 70%. All three methods are tagged in the output so the reviewer can identify the source of the reported efficiency.
Sediment traps serve drainage areas up to 5 acres at 3,600 ft$^3$ per acre of wet storage, minimum depth 2 ft, length-to-width ratio 2:1, perforated-riser outlet. Dewatering time is 72 hours. These are temporary structures intended for the active phase of construction.
Silt fence is sized for sheet flow from small disturbed areas. The NCDEQ rule
used by designSiltFence() is 100 linear feet of fence per 0.25
acre of contributing drainage area. Slope length is limited to 100 ft and
maximum slope to 50% (2:1). The design output includes the fence length,
post count at 6-ft spacing, embedment trench dimensions, and a TSS removal
estimate based on Barrett et al. (1998) and the weighted 3-bin efficiency
hardcoded for the silt-fence structure type.
Rock check dams are sized for concentrated flow in temporary diversions, ditches, and channels draining disturbed areas. Maximum height is 2 ft. Spacing is computed so the toe of the upstream dam meets the crest elevation of the downstream dam: $S = H \times 100 / s\%$. The center notch is 1/3 of the channel width and 1/3 of the dam height; weir capacity of the notch is computed by the broad-crested weir form:
The rock-check $C_w$ of 2.65 is lower than the 3.0–3.33 sharp-crested weir coefficient because of the porosity and roughness of the rock face. The engine computes rock quantity per dam assuming a trapezoidal cross-section at channel width and height, 3-ft effective thickness, and 165 lb/ft$^3$ rock unit weight.
Basin dewatering is assumed through a floating skimmer that draws water from the top of the water column so that settled sediment is not re-entrained at the outlet. Design drawdown time is 48 hours for sediment basins and 72 hours for sediment traps. The engine does not size the skimmer orifice directly; it reports the required drawdown time as a design constraint.
Riprap lining is sized by the Isbash method (Isbash, 1936; FHWA HEC-11, Brown & Clyde, 1989):
where $d_{50}$ is the median stone size (ft), $V$ is design velocity (ft/s), $g = 32.2$ ft/s$^2$, $S_s = 2.65$ is the specific gravity of rock, $C_s$ is the Isbash stability coefficient (0.86 for high-turbulence conditions, 1.20 for low-turbulence), and $\mathrm{SF}$ is the safety factor. The engine defaults are $C_s = 0.86$ and $\mathrm{SF} = 1.2$, which are the conservative choice for concentrated-flow and outlet conditions. Riprap thickness is $2\,d_{50}$, with a minimum of 12 in.
The SEDCAD4 Engine’s channel stability routine (in the diversion channel analysis) compares applied tractive shear $\tau = \gamma\,R\,S$ against critical shear from one of two sources:
Required $d_{50}$ is obtained by rearranging the Shields form to a target safety factor, and the engine reports whether the proposed lining is stable, marginal, or requires an upsized riprap class.
The IDEAL Engine (source: src/engines/IDEALEngine.js) computes
runoff pollutant loads, sizes BMPs for the water quality volume, evaluates
treatment-train effects, and reports pollutant removal for fifteen BMP types.
It is inspired by the Woolpert IDEAL methodology (“Integrated Design
and Evaluation Assessment of Loadings”), adapted to the event-based
data structures already produced by the Hydraflow Engine.
The water quality volume is the volume of runoff produced by the water-quality storm (typically 1.0” in North Carolina, 0.5” in the drier West, or per the applicable state rule). HydroComplete computes WQV using the Schueler (1987) volumetric runoff coefficient:
where $R_v$ is the dimensionless volumetric runoff coefficient, $I$ is site percent impervious (0–100), $P$ is the water-quality design rainfall depth (inches), $A$ is the drainage area (acres), and $WQV$ is the water quality volume (cubic feet). The 43,560 factor converts acre-inches to cubic feet.
Between storms, pollutants accumulate on impervious surfaces; each storm washes off a fraction of the accumulated mass. The IDEAL Engine implements the Sartor-Boyd style power-function buildup and power-function washoff (Sartor & Boyd, 1972; Alley & Smith, 1981):
where $M_{buildup}$ is accumulated mass per unit area, $M_{max}$ is the saturation mass, $k$ is a land-use-specific buildup rate constant, $t$ is the antecedent dry period (days), $W$ is washoff mass, $M$ is the available buildup mass, $r$ is runoff depth (inches), and $a$, $b$ are pollutant- and land-use-specific washoff coefficients.
The engine’s default buildup and washoff parameters are calibrated for the southeastern Piedmont land-cover classes. Parameters can be overridden per project. The washoff formulation uses a fractional-washoff variant capped at 1.0 for storms large enough to remove the full accumulated load.
analyzeFirstFlush() computes the fraction of the total storm
pollutant load that appears in the first $f$ of the runoff volume (default
$f = 0.20$). This supports sizing decisions for BMPs that target the first
flush rather than the full WQV.
When two or more BMPs are arranged in series (either automatically by the BMPOptimizer search or by the engineer in the diagram), the combined removal for each pollutant is computed by the sequential-removal rule:
This rule assumes the residual concentration leaving one BMP is the untreated influent to the next and that no pollutant is added between BMPs. It is the standard treatment-train aggregation used by NCDEQ (2020) Section 3.3, ASCE/EWRI (2012), and the Int'l BMP Database (Geosyntec & Wright Water Engineers, 2020). It is conservative in the sense that it ignores any synergistic effects of upstream pretreatment, and it over-credits downstream BMPs when the upstream effluent is already at irreducible concentration (below which most BMPs cannot treat further; see Schueler, 2000).
HydroComplete’s BMP library combines the IDEALEngine.bmpLibrary
catalog with the ConveyanceEngine BMP conveyance entries and the
BMPOptimizer cost library. The list below gives the removal
efficiencies actually implemented in the code, with the primary citation for
each.
| BMP | TSS | TN | TP | Bacteria | Metals | Primary source |
|---|---|---|---|---|---|---|
| Dry extended detention | 0.60 | 0.25 | 0.35 | 0.50 | 0.45 | Int'l BMP DB (2020); Barrett et al. (2004) |
| Wet retention pond | 0.80 | 0.40 | 0.50 | 0.70 | 0.65 | NCDEQ (2020); Int'l BMP DB |
| Bioretention cell | 0.85 | 0.45 | 0.60 | 0.75 | 0.80 | Davis et al. (2009); Hunt & Lord (2006) |
| Rain garden | 0.85 | 0.45 | 0.60 | 0.75 | 0.80 | Davis et al. (2009) |
| Sand filter | 0.85 | 0.35 | 0.50 | 0.55 | 0.75 | Urbonas (1999); Int'l BMP DB |
| Constructed wetland | 0.85 | 0.35 | 0.45 | 0.75 | 0.60 | Hunt & Doll (2000); Kadlec & Wallace (2009) |
| Infiltration trench/basin | 0.90 | 0.40 | 0.55 | 0.70 | 0.85 | Schueler (1987); EPA (2021) |
| Permeable pavement | 0.90 | 0.45 | 0.60 | 0.65 | 0.85 | Brattebo & Booth (2003); Bean et al. (2007) |
| Green roof | 0.80 | 0.40 | 0.45 | 0.50 | 0.65 | Mentens et al. (2006); Berndtsson (2010) |
| Vegetated filter strip | 0.70 | 0.30 | 0.45 | 0.40 | 0.50 | Int'l BMP DB (2020); NCDEQ |
| Vegetated swale | 0.65 | 0.35 | 0.40 | 0.45 | 0.55 | Hunt et al. (2006); Int'l BMP DB |
| Grassed swale | 0.55 | 0.25 | 0.30 | 0.35 | 0.45 | Stagge et al. (2012); Int'l BMP DB |
| Bioswale (engineered media) | 0.80 | 0.45 | 0.55 | 0.60 | 0.70 | Davis et al. (2012) |
| Level spreader — filter | 0.75 | 0.30 | 0.40 | 0.45 | 0.55 | Hunt et al. (2006); Winston et al. (2011) |
| Cistern / harvesting (volume) | — | — | — | — | — | Jones & Hunt (2010) |
These are median values from the literature. Real BMP performance is highly site-, soil-, and storm-dependent, and the cited distributions have interquartile ranges of roughly ±15 percentage points around the medians. For regulatory submittals the engineer should verify that the state agency accepts these values (most do; NCDEQ Table 3-1 is the primary reference for North Carolina).
Each BMP in the library carries a set of sizing constraints that the engine checks before reporting a design. Examples include:
The IDEAL Engine ships with a 30-year historical rainfall statistics table (derived from NOAA GHCN-Daily summaries) for the same 19 cities as the Atlas-14 database. For each city the engine stores rain days per month, mean event depth, event-depth standard deviation, maximum observed dry-day count, and annual peak depths by return period. A stochastic series of rainfall events generated from these statistics can be used to run an event-by-event long-record simulation through a BMP under design evaluation.
The stochastic simulation is an event-series approximation, not a true continuous simulation. It produces annualized pollutant load reductions that are suitable for early-design screening and state water-quality compliance reporting, but it does not track soil moisture, antecedent precipitation between events at sub-daily resolution, or snow processes. For a full continuous simulation with soil moisture tracking and ET, see §4.10.
The original IDEAL Engine (§4.2) uses a single set of buildup/washoff coefficients calibrated to the southeastern Piedmont. Phase 1 replaces this with a differentiated library of 11 land-use categories, each carrying NSQD-calibrated parameters for six pollutants: TSS, TN, TP, bacteria, copper, and zinc. Five new EMC categories are introduced (parking, institutional, open-space, construction, agricultural) alongside the six original categories (residential-low, residential-medium, residential-high, commercial, industrial, roadway).
The buildup model is exponential saturation (Sartor & Boyd, 1972; Alley & Smith, 1981):
where $B(t)$ is the accumulated pollutant mass per unit area at time $t$ (days of dry weather), $B_{max}$ is the saturation buildup mass, and $k$ is a first-order accumulation rate constant (day$^{-1}$). Each land-use/pollutant pair carries its own $B_{max}$ and $k$.
The washoff model is a power-law fraction of available buildup:
where $B_{avail}$ is the mass available at the start of the event (from the buildup equation), $R$ is the runoff depth (inches), and $a$, $b$ are land-use- and pollutant-specific washoff coefficients. The $\min(1, \cdot)$ cap ensures washoff cannot exceed available mass.
Table 4.2 gives the calibrated parameters for four representative land
uses. The full 11-category library is coded in
createBuildupWashoffLibrary().
| Land use | Pollutant | $B_{max}$ | $k$ | $a$ | $b$ |
|---|---|---|---|---|---|
| Open-space | TSS | 10 | 0.08 | 0.06 | 1.2 |
| TN | 0.5 | 0.06 | 0.04 | 1.1 | |
| TP | 0.10 | 0.05 | 0.03 | 1.2 | |
| Bacteria | 80,000 | 0.12 | 0.10 | 1.5 | |
| Cu | 0.02 | 0.05 | 0.02 | 1.0 | |
| Zn | 0.08 | 0.05 | 0.02 | 1.0 | |
| Residential-medium | TSS | 40 | 0.18 | 0.15 | 1.4 |
| TN | 2.0 | 0.12 | 0.08 | 1.2 | |
| TP | 0.38 | 0.10 | 0.06 | 1.3 | |
| Bacteria | 400,000 | 0.25 | 0.20 | 1.9 | |
| Cu | 0.08 | 0.09 | 0.04 | 1.1 | |
| Zn | 0.40 | 0.09 | 0.04 | 1.1 | |
| Commercial | TSS | 80 | 0.25 | 0.20 | 1.5 |
| TN | 2.8 | 0.15 | 0.10 | 1.3 | |
| TP | 0.42 | 0.12 | 0.08 | 1.4 | |
| Bacteria | 350,000 | 0.22 | 0.20 | 1.8 | |
| Cu | 0.12 | 0.12 | 0.05 | 1.2 | |
| Zn | 0.60 | 0.12 | 0.05 | 1.2 | |
| Roadway | TSS | 120 | 0.30 | 0.25 | 1.6 |
| TN | 3.2 | 0.16 | 0.12 | 1.4 | |
| TP | 0.55 | 0.12 | 0.09 | 1.4 | |
| Bacteria | 400,000 | 0.30 | 0.25 | 2.0 | |
| Cu | 0.18 | 0.12 | 0.06 | 1.2 | |
| Zn | 0.90 | 0.12 | 0.06 | 1.2 |
The gradient across land uses reflects physical reality: open-space sites have low $B_{max}$ values (little impervious accumulation) with slow buildup rates, while roadways and parking lots have high $B_{max}$ and fast buildup. Metal loadings (Cu, Zn) increase with traffic volume as expected from tire and brake-pad wear. Bacteria loading is highest in residential areas (pet waste) and agricultural land (livestock).
Sources: NSQD (Pitt et al., 2004; Maestre & Pitt, 2005/2008), Sartor & Boyd (1972) Table IV-1, USEPA (2002) NURP results, Alley & Smith (1981), USDA-NRCS agricultural NPS handbook, Novotny & Chesters (1981). Where published data were sparse (institutional, construction), parameters were interpolated from bracketing categories.
Phase 2 adds physics-based routing through three BMP types, replacing the
flat percentage-removal model with methods that account for storage capacity,
hydraulic residence time, and pollutant-specific kinetics. A dispatcher
(routeThroughBMP()) routes bioretention, wet ponds, and
constructed wetlands to their respective physics methods; all other BMP types
fall back to the percentage-box model described in §4.5.
Bioretention routing (routeThroughBioretention()) computes
three hydraulic components: media infiltration via Darcy’s law,
underdrain outflow via the orifice equation, and overflow when ponding
exceeds the maximum depth.
Media infiltration (Darcy):
where $K_{sat}$ is the saturated hydraulic conductivity of the bioretention soil media (in/hr), $A$ is the filter surface area (ft$^2$), $h_{pond}$ is the ponding head (ft), and $d_{media}$ is the media depth (ft). The engine uses an average head of $h_{pond}/2 + d_{media}$ for the event.
Underdrain outflow (orifice):
where $C_d$ is the orifice discharge coefficient (default 0.6), $A_{orifice}$ is the underdrain pipe cross-sectional area (ft$^2$), $g = 32.2$ ft/s$^2$, and $h$ is the head above the underdrain (approximated as $d_{media}/2$).
Storage and overflow: Available storage is the sum of media pore space (above current moisture content) and ponding volume:
where $\phi$ is the media porosity and $\theta_{current}$ is the current media moisture content (tracked between events during continuous simulation; defaults to field capacity for single-event analysis). Inflow exceeding $V_{cap}$ is routed as untreated overflow.
Pollutant removal: Removal efficiency is a function of residence time per Davis (2008):
where $t_{res}$ is the hydraulic residence time (hr) computed as treated volume divided by total outflow rate, $E_{max}$ is the asymptotic removal for the pollutant (e.g., 0.92 for TSS, 0.50 for TN), and $\alpha$ is a pollutant-specific rate constant. The blended removal for the whole event accounts for the untreated overflow fraction:
The engine returns treated/bypassed volumes, drawdown time, media storage, ponding storage, and post-event media moisture for continuous-simulation inter-event recovery tracking.
| Pollutant | $E_{max}$ | $\alpha$ (hr$^{-1}$) |
|---|---|---|
| TSS | 0.92 | 0.50 |
| TN | 0.50 | 0.20 |
| TP | 0.65 | 0.30 |
| Bacteria | 0.80 | 0.40 |
| Metals | 0.90 | 0.45 |
Wet pond routing (routeThroughWetPond()) uses the Kadlec &
Knight (1996) first-order decay model. The treatment mechanism is
sedimentation and biological uptake during the permanent-pool residence time.
For each pollutant:
where $k$ is the first-order decay rate constant (min$^{-1}$) and $t_{res}$ is the hydraulic residence time (min). Default decay rates are:
| Pollutant | $k$ (min$^{-1}$) |
|---|---|
| TSS | 0.0015 |
| TN | 0.0005 |
| TP | 0.0008 |
| Bacteria | 0.0020 |
| Metals | 0.0010 |
Overflow occurs when the event inflow volume exceeds 1.5 times the permanent pool volume. The 1.5× factor reflects the live-storage zone above the permanent pool that is available before the emergency spillway activates. Overflow bypasses treatment and is blended with the treated fraction in the same manner as bioretention (§4.9.1).
The residence time for the permanent pool is estimated from the pool volume and the steady-state drawdown rate: $t_{res} = V_{pool} / Q_{out}$, where $Q_{out} = V_{pool} / (t_{drawdown,\,days} \times 24)$ and the default drawdown period is 14 days (the typical wet-pond design residence time).
Constructed wetland routing (routeThroughWetland()) implements
the Kadlec & Wallace (2009) k-C* model through four treatment zones in
series: forebay (10% of area), deep pool (15%), shallow marsh (40%),
and shallow land (35%). The governing equation for each zone is:
where $C^{*}$ is the irreducible background concentration (mg/L) below which the wetland cannot treat, $C_{in}$ is the influent concentration, $k$ is the areal decay rate constant (m/yr), $A_{zone}$ is the wetland zone area (m$^2$), and $Q$ is the hydraulic loading rate (m$^3$/yr). The effluent from one zone becomes the influent to the next.
| Pollutant | $k$ (m/yr) | $C^{*}$ (mg/L) | Default $C_{in}$ (mg/L) |
|---|---|---|---|
| TSS | 20 | 5.0 | 150 |
| TN | 10 | 1.0 | 2.5 |
| TP | 12 | 0.05 | 0.40 |
| Bacteria | 30 | 100 | 20,000 |
| Metals | 15 | 0.005 | 0.05 |
The four-zone series configuration captures the distinct treatment mechanisms that occur at different depth profiles in a properly designed constructed wetland: coarse sediment removal in the forebay, further settling in the deep pool, biological uptake and filtration in the shallow marsh, and polishing/denitrification in the shallow land zone. The zone-by-zone concentration trace is included in the result output so the engineer can evaluate the marginal benefit of each zone.
The routeThroughBMP() dispatcher inspects the BMP type and
routes accordingly:
routeThroughBioretention() (§4.9.1)routeThroughWetPond()
(§4.9.2)routeThroughWetland() (§4.9.3)bmpLibrary (§4.5)This design allows physics-based routing to be added incrementally for additional BMP types without breaking existing analyses. The dispatcher merges BMP-library defaults with user-supplied overrides before passing the configuration to the routing method.
Phase 3 adds a multi-year continuous simulation mode
(runContinuousSimulation()) that replaces the event-series
approximation (§4.7) with a daily time-step model tracking soil
moisture, evapotranspiration, moisture-adjusted curve numbers, land-use
kinetics, and inter-event BMP recovery. This mode is appropriate for
annualized load estimates that account for seasonal ET variation,
antecedent conditions, and BMP drying between storms.
Daily reference evapotranspiration ($ET_0$) is computed from the Hargreaves & Samani (1985) temperature-based method as recommended by FAO-56 (Allen et al., 1998) for situations where only temperature data are available:
where $T_{mean}$, $T_{max}$, $T_{min}$ are in °C (converted internally from the NOAA data stored in °F), and $R_a$ is the extraterrestrial radiation in mm/day equivalent. The engine stores monthly $T_{min}$/$T_{max}$ normals from NOAA GHCN-Daily (1991–2020 period) for 18 US cities.
Extraterrestrial radiation $R_a$ is computed from solar geometry following FAO-56 equations 21–25:
where $G_{sc} = 0.0820$ MJ/m$^2$/min is the solar constant, $d_r = 1 + 0.033\cos(2\pi J/365)$ is the inverse relative Earth–Sun distance (with $J$ = day of year), $\delta = 0.409\sin(2\pi J/365 - 1.39)$ is solar declination, $\varphi$ is station latitude (radians), and $\omega_s = \arccos[-\tan\varphi\,\tan\delta]$ is the sunset hour angle. The result in MJ/m$^2$/day is converted to mm/day by the factor 0.408.
| City | Latitude | Jan $T_{min}$/$T_{max}$ | Jul $T_{min}$/$T_{max}$ |
|---|---|---|---|
| Charlotte, NC | 35.23°N | 30 / 51 | 69 / 91 |
| Chicago, IL | 41.88°N | 18 / 32 | 67 / 84 |
| Dallas, TX | 32.78°N | 36 / 57 | 77 / 98 |
| Seattle, WA | 47.61°N | 36 / 47 | 56 / 76 |
| Phoenix, AZ | 33.45°N | 44 / 67 | 83 / 107 |
| Minneapolis, MN | 44.98°N | 6 / 24 | 65 / 84 |
The daily soil moisture balance (dailySoilMoistureBalance())
tracks the volumetric water content $\theta$ of the root zone:
where $I_{inf}$ is infiltration (in), $ET_{act}$ is actual evapotranspiration (in), $P_{erc}$ is deep percolation (in), and $D_r$ is the root-zone depth (in). Actual ET is scaled from reference ET by a crop coefficient and moisture availability factor:
where $\theta_{wp}$ is the wilting point and $\theta_{fc}$ is field capacity. When $\theta \leq \theta_{wp}$, ET ceases. Infiltration is limited by the sum of the soil deficit below field capacity and the daily $K_{sat}$ capacity. Deep percolation drains at 50% of the excess above field capacity per time step.
Soil parameters are assigned per land use from Rawls et al. (1983):
| Land use | $\phi$ | $\theta_{fc}$ | $\theta_{wp}$ | $K_{sat}$ (in/hr) | $D_r$ (in) | $K_{crop}$ |
|---|---|---|---|---|---|---|
| Open-space | 0.45 | 0.30 | 0.12 | 1.0 | 18 | 1.00 |
| Residential-medium | 0.40 | 0.26 | 0.11 | 0.5 | 12 | 0.70 |
| Commercial | 0.35 | 0.22 | 0.10 | 0.2 | 8 | 0.30 |
| Roadway | 0.30 | 0.20 | 0.10 | 0.1 | 6 | 0.10 |
| Agricultural | 0.44 | 0.28 | 0.12 | 0.8 | 16 | 0.90 |
The traditional SCS CN method uses discrete antecedent moisture conditions (AMC I/II/III). The continuous simulation replaces this with a smooth, moisture-dependent CN scaling that responds to the actual soil moisture state each day:
where $\alpha = 0.4$ and $\beta = 0.3$ are calibration constants. The adjusted CN is clamped to the range [30, 98]. When the soil is saturated ($\theta \to \phi$), $CN_{adj}$ increases by up to 40%, producing higher runoff. When the soil is dry ($\theta \to \theta_{wp}$), $CN_{adj}$ decreases by up to 30%, reflecting higher infiltration capacity. This eliminates the discontinuous AMC jumps that plague event-series models.
Between storms, bioretention media dries via ET and gravity drainage,
recovering storage capacity for the next event. The engine tracks a
bmpMediaMoisture state variable that is updated on both event and
dry days:
The drainage rate is $K_{sat} / d_{media}$ (moisture fraction per day) and the ET draw on the media is half the site $ET_0$ rate (reflecting partial exposure of the bioretention surface). This mechanism captures the seasonal variation in BMP performance: in summer, inter-event ET rapidly restores storage capacity, improving capture of the next storm. In winter, slow drying means the media may still be partially saturated when the next event arrives, reducing effective storage and increasing overflow.
The continuous simulation returns:
The single-event analysis (§4.7) is appropriate for regulatory submittals that evaluate BMP performance against the design water-quality storm. The continuous simulation (§4.10) is appropriate when the engineer needs annualized load estimates, seasonal performance variation, or wants to account for antecedent conditions and BMP recovery. Both modes share the same underlying buildup/washoff library (§4.8) and BMP routing methods (§4.9).
The Conveyance Engine (source: src/engines/ConveyanceEngine.js)
handles 14 conveyance types: four closed conduits (RCP, CMP, HDPE, PVC), three
open channels (concrete-lined, riprap-lined, earthen), five BMP conveyances
(grassed swale, vegetated swale, bioswale, filter strip), and two overland
flow types (sheet flow, shallow concentrated flow). Each type carries its
Manning’s roughness coefficient, shape, and (where applicable) a pollutant
removal profile.
All closed-conduit and open-channel flow uses Manning’s equation in its US-customary form (Chow, 1959; FHWA HDS-5, Schall et al., 2012):
where $V$ is flow velocity (ft/s), $n$ is Manning’s roughness coefficient, $R$ is hydraulic radius (ft), $S$ is friction slope (ft/ft), and $A$ is cross-sectional area (ft$^2$). The 1.486 (often written 1.49 in the literature) is the unit-conversion factor from SI.
Typical $n$ values coded in the conveyance type library:
| Type | $n$ (typical) | Source |
|---|---|---|
| RCP (smooth concrete) | 0.013 | Chow (1959); ASTM C76 |
| CMP (corrugated metal) | 0.024 | AASHTO M36 |
| HDPE (smooth interior) | 0.012 | AASHTO M294 |
| PVC | 0.010 | ASTM D3034 |
| Concrete-lined channel | 0.013 | Chow (1959) |
| Riprap-lined channel | 0.035 | FHWA HEC-15 |
| Earthen channel (unlined) | 0.025 | Chow (1959) |
| Grassed swale | 0.035 | NRCS TR-55 |
| Vegetated swale (dense) | 0.150 | Int'l BMP DB |
| Bioswale (engineered media) | 0.200 | Davis et al. (2012) |
| Sheet flow (dense grass) | 0.400 | NRCS TR-55 Table 3-1 |
Published Manning’s n values carry an intrinsic uncertainty of roughly ±20%. For RCP, Chow (1959) gives 0.011–0.015 depending on age, joint condition, and sediment. HydroComplete uses a single tabulated value per conveyance type for defaulting, but the engineer can override $n$ on a per-segment basis in the diagram. For flood studies or design velocity calculations the engineer should consider sensitivity to $n$ rather than treating the default as a fixed constant.
For a circular pipe flowing full, $A = \pi D^2 / 4$ and $R = D / 4$. Manning’s equation collapses to:
Partial-flow depth in a circular pipe is found by iteratively solving Manning’s equation with the partial-area and partial-hydraulic-radius relations. The engine uses a bisection solver over depth ratio $d/D$; it terminates on either flow convergence within 1% or after a fixed number of iterations.
For trapezoidal channels the HydraulicEngine core solves normal depth by
bisection on the full Manning’s equation (see src/core/HydraulicEngine.js):
with $A(y) = y(b + zy)$, $P(y) = b + 2y\sqrt{1 + z^2}$, $R(y) = A/P$. The bisection tolerance is $10^{-8}$ on relative flow error.
The HydraulicEngine reports the Froude number for every normal-depth calculation as a flow-regime indicator. For a trapezoidal section:
where $D_h$ is hydraulic depth (ft) and $T$ is top width (ft). $\mathrm{Fr} < 1$ indicates subcritical flow; $\mathrm{Fr} > 1$ indicates supercritical flow; $\mathrm{Fr} = 1$ is critical flow. The engine computes critical depth $y_c$ by solving $Q^2\,T = g\,A^3$ for the channel geometry.
The Conveyance Engine computes HGL and EGL profiles through a pipe network by walking upstream from a user-supplied tailwater boundary (FHWA HDS-5, Schall et al., 2012). For each pipe segment, friction loss is computed from Manning’s form:
Minor losses (entrance, exit, bend, junction) are added where specified. Each pipe end is tagged as surcharged if the computed HGL exceeds the pipe crown elevation. The engine reports $HGL_{up}$, $HGL_{down}$, $EGL_{up}$, $EGL_{down}$, velocity head, and surcharge status for every segment.
Inlet hydraulics follow FHWA HEC-22 (Brown et al., 2013) for street drainage design. Gutter flow uses the modified Izzard form of Manning’s equation for a triangular gutter section:
where $S_x$ is cross slope, $S_L$ is longitudinal slope, $T$ is spread width (ft), and $n$ is gutter Manning’s n (typically 0.016 for concrete per HEC-22). The grate-inlet capture efficiency is built from the front-gutter fraction $E_o$:
where $W$ is grate width (ft) and $T$ is spread. The engine also implements the splash-over velocity check and the side-flow factor $R_s$ per HEC-22 Equations 4-19 and 4-20. Curb-opening inlet capacity and inlet-in-sag forms are included with HEC-22 standard coefficients.
Channel and riprap stability analysis appears in both the
SEDCAD4Engine (diversion channel and outlet protection designs)
and the HydraulicEngine core. This chapter consolidates the relevant formulas.
For steady uniform flow the applied bed shear stress is (Chow, 1959):
where $\tau_0$ is applied shear stress (lb/ft$^2$), $\gamma = 62.4$ lb/ft$^3$ for water, $R$ is hydraulic radius (ft), and $S$ is the energy slope (ft/ft). On the outside of channel bends the local shear is amplified; FHWA HEC-15 (Kilgore & Cotton, 2005) uses the bend factor $K_b = 2.0\,(R_c/T)^{-0.39}$ for radius-of-curvature-to-top-width ratios between 2 and 10.
For a non-cohesive granular bed the Shields (1936) criterion gives the critical tractive force at which particles begin to move:
where $\tau^{*}_c$ is the dimensionless critical Shields parameter (0.03–0.06 for natural sand and gravel depending on particle Reynolds number; HydroComplete uses 0.06 as the conservative design value), $\gamma_s = 165$ lb/ft$^3$ for riprap, and $d_{50}$ is the median stone size (ft).
Rearranging for the required stone size at a target safety factor $\mathrm{SF}$ yields:
For velocity-controlled riprap sizing (outlet aprons, plunge pools, concentrated-flow dissipators) the Isbash (1936) velocity form is more convenient than the shear form because the primary input is design velocity rather than energy slope. The Isbash equation is given in §3.7; the default stability coefficient $C_s = 0.86$ and safety factor $\mathrm{SF} = 1.2$ correspond to high-turbulence outlet conditions.
For grass-lined, earthen, and cohesive-lined channels HydroComplete uses the classic Fortier & Scobey (1926) permissible velocity table (as adopted by USDA-SCS). Permissible velocities range from roughly 1.5 ft/s (fine sand) to 6 ft/s (cemented gravel with colloids). The engine checks design velocity against the permissible value for the specified lining type and flags any exceedance.
HydroComplete’s designPlungePool() implements the USBR
Engineering Monograph No. 25 scour depth formula and the FHWA HEC-14 (Thompson
& Kilgore, 2006) outlet protection guidelines:
where $D_p$ is the scour pool depth (ft), $Q$ is design discharge (cfs), $W$ is jet width at impact (ft; for a circular pipe, the pipe diameter), and $H_d$ is the drop height from invert to pool floor (ft). The pool length is taken as $L_p = \max(10\,D_p,\ 4D)$ and the width as $W_p = \max(3D,\ L_p/3)$. Pool floor riprap is sized by the Isbash form from the pipe outlet velocity.
For riprap aprons at pipe outlets under subcritical tailwater, the apron length uses the FHWA HEC-14 Froude-number dependency:
with downstream apron width $W_a = \max(3D + 0.4 L_a,\ 6\text{ ft})$. The engine reports the apron length, flared width, and riprap gradation requirements (AASHTO M288 Class 2 geotextile under-layer, trapezoidal flared shape, full channel with 2-ft extensions beyond the toe).
The BMPOptimizer (source: src/core/BMPOptimizer.js) provides
cost-effective BMP selection: single-BMP ranking, two- and three-BMP treatment
train search, and lifecycle cost analysis. All monetary values are in 2024
US dollars, escalated from the original literature using the ENR Construction
Cost Index (CCI ratio of approximately 1.18 applied to pre-2020 sources).
Each BMP in the optimizer carries three cost components: construction cost per square foot of BMP footprint, annual maintenance as a percent of construction cost, and opportunity cost of the land it occupies. The default values are drawn from Weiss et al. (2007), US EPA (2021), NCDEQ (2020), and the Int'l BMP Database (Geosyntec & Wright Water Engineers, 2020).
| BMP | Constr. $/sf | Annual maint. (%) | Land $/sf | Sizing factor |
|---|---|---|---|---|
| Bioretention | 28.00 | 5% | 5.00 | 1.0 |
| Constructed wetland | 12.00 | 2% | 5.00 | 2.5 |
| Wet pond | 8.50 | 3% | 5.00 | 3.0 |
| Dry pond | 5.50 | 3% | 5.00 | 2.0 |
| Sand filter | 35.00 | 8% | 5.00 | 0.8 |
| Permeable pavement | 18.00 | 4% | 0.00 | 0.0 (pavement is the BMP) |
| Grassed swale | 4.00 | 6% | 3.00 | 1.5 |
| Green roof | 30.00 | 2% | 0.00 | 0.0 |
| Infiltration basin | 10.00 | 6% | 5.00 | 1.2 |
| Level spreader — filter | 15.00 | 4% | 4.00 | 1.8 |
BMP lifecycle cost is reported as the net present value of capital plus maintenance over a 20-year analysis period at a 5% discount rate (defaults; both are user-adjustable):
where $C_{const}$ is construction cost, $C_{land}$ is the opportunity cost of the land occupied, $M$ is annual maintenance cost, $r$ is the annual discount rate, and $T$ is the analysis period in years. The annuity factor $[1 - (1 + r)^{-T}]/r$ is the standard present-worth-of-annuity factor for a uniform-payment series.
The optimizer ranks single BMPs by cost per pound of TSS removed over the full lifecycle:
where $L_{TSS}$ is the annual TSS load entering the BMP (lbs/yr) and $\eta_{TSS}$ is the BMP’s TSS removal efficiency. The result is a ranked table from lowest to highest cost per lb removed.
For treatment trains of two or three BMPs in series, the optimizer enumerates candidate pairs (and triplets), computes combined sequential removal efficiencies using the $1 - \prod(1 - \eta_i)$ rule (Chapter 4), and evaluates the total lifecycle cost. Each BMP in a train is sized at 60% of the WQV footprint (a split sizing heuristic that reflects the reduced load on each stage). The best train is the one that meets the removal targets at the lowest NPV.
The optimizer respects a set of compatibility constraints (e.g., an infiltration basin will not be placed downstream of a pond whose effluent is already effectively treated; see the code for the full set). Trains that violate these constraints are filtered before the search.
The ComplianceChecker (source: src/core/ComplianceChecker.js)
evaluates analysis results against state regulatory configurations. The
currently configured states are North Carolina (NCDEQ), South Carolina (DHEC),
and Virginia (DEQ). Each state configuration defines the regulatory authority,
the minimum removal targets by pollutant and development type, volume-control
and peak-flow requirements, and analysis-storm requirements.
The compliance report is a structured object: state name, regulatory authority, development type, list of criteria (each with required value, actual value, PASS/FAIL/REVIEW/INCOMPLETE status, and the authority citation), list of warnings, and list of recommendations. For failing criteria the checker generates actionable recommendations (e.g., “Treatment train with bioretention + grassed swale can increase combined TSS removal to 90%”).
The ComplianceChecker evaluates against published state rules as of the configuration file date. State rules change; the engineer is responsible for verifying that the state configuration reflects the latest regulatory language. HydroComplete does not substitute for a regulatory pre-submittal meeting with the permitting agency. A PASS from the ComplianceChecker is necessary but not sufficient for permit approval.
This chapter is deliberately blunt. HydroComplete Pro is a competent event-based stormwater analysis platform built on published methods. It is not a full-featured hydraulic or sediment-transport modeling suite. The items below are the most important boundaries of what the tool can and cannot do.
.hms basin files or HEC-RAS
.prj project files. Hydrograph data can be exchanged in
tabular form.Every engineering analysis in HydroComplete Pro needs professional judgment to interpret. Specifically:
HydroComplete Pro is not a substitute for a site-specific geotechnical investigation, a topographic survey, a field reconnaissance of the drainage network, or a regulatory pre-submittal meeting. It is a calculation engine. The engineer is responsible for the physical reality behind the numbers.
HydroComplete Pro is a single-page web application with an optional server backend. The layout as of build 2026.04 is:
src/engines/HydraflowEngine.js,
src/engines/SEDCAD4Engine.js,
src/engines/IDEALEngine.js,
src/engines/ConveyanceEngine.js. Each engine is an ES module
with an initialize() method and a set of domain calculation
methods. No engine depends on any other; they are composed by
src/core/AnalysisController.js.src/core/HydraulicEngine.js (open
channel solvers), src/core/BMPOptimizer.js (cost optimization),
src/core/ComplianceChecker.js (regulatory evaluation),
src/core/DataManager.js (persistence), StateManager.js
(undo/redo), FileImporter.js and FileExporter.js
(SWMM, CSV, PDF).server/routes/soilData.js),
authentication, billing, and AI assistance endpoints. Supabase supplies
auth, user storage, and a Postgres subscription table. Stripe handles
checkout and subscription management.test-calcs.js, test-scenarios.js,
test-conveyance.js, test-multi-outlet.js,
test-treatment-train.js, test-analysis-controller.js,
test-ssurgo-psd.js, test-ssurgo-controller.js,
test-stokes-camp.js). See Appendix C.No single engine file exceeds ~2,500 lines. All calculation methods return
a formulaSteps array alongside numerical results; each step
carries the equation (as a LaTeX string), the substituted values, the
computed result, and a citation. This is the data structure that the
frontend displays with KaTeX on every analysis page.
| Symbol | Meaning | Typical units |
|---|---|---|
| $A$ | Area (drainage area, cross-section area, surface area) | ac, ft$^2$, mi$^2$ |
| $A_s$ | Basin surface area | ft$^2$ |
| $B_{max}$ | Saturation pollutant buildup mass per unit area | lbs/ac |
| $C$ | RUSLE cover and management factor; or weir coefficient $C_w$; or concentration | —, mg/L |
| $C^{*}$ | Irreducible background concentration (Kadlec k-C* model) | mg/L |
| $C_d$ | Orifice discharge coefficient | — |
| $C_v$ | V-notch weir discharge coefficient | — |
| $C_s$ | Isbash riprap stability coefficient | — |
| $c$ | Kinematic wave celerity | ft/s |
| $CN$ | SCS curve number | — |
| $D$ | Pipe diameter | ft, in |
| $d$ | Particle diameter; flow depth | mm, ft |
| $D_r$ | Root-zone depth | in |
| $d_{50}$ | Median riprap or bed-material size | ft, in |
| $E_{max}$ | Asymptotic maximum BMP removal efficiency | — |
| $ET_0$ | Reference evapotranspiration (Hargreaves) | mm/day, in/day |
| $\eta$ | Trap or removal efficiency | % |
| $f_i$ | Fraction of PSD in bin $i$ | — |
| $\mathrm{Fr}$ | Froude number | — |
| $g$ | Gravitational acceleration | ft/s$^2$, m/s$^2$ |
| $\gamma$ | Unit weight of water, 62.4 | lb/ft$^3$ |
| $\gamma_s$ | Unit weight of rock or sediment solids | lb/ft$^3$ |
| $HW$ | Headwater depth above culvert invert | ft |
| $I$ | Percent impervious cover; or inflow rate | %, cfs |
| $I_a$ | Initial abstraction in the SCS runoff method | in |
| $K$ | RUSLE soil erodibility factor; or Muskingum storage constant | —, hr |
| $K_e$ | Culvert entrance loss coefficient | — |
| $K_{crop}$ | Crop coefficient for actual ET | — |
| $K_{sat}$ | Saturated hydraulic conductivity | in/hr |
| $L$ | Slope length (RUSLE); or channel reach length | ft |
| $LS$ | Combined slope length and steepness factor | — |
| $\mu$ | Dynamic viscosity of water | Pa·s |
| $n$ | Manning’s roughness coefficient | — |
| $\nu$ | Kinematic viscosity of water | m$^2$/s |
| $O$ | Outflow rate | cfs |
| $P$ | Rainfall depth; or RUSLE support-practice factor; or wetted perimeter | in, —, ft |
| $Q$ | Discharge / flow rate; or runoff depth (in SCS method) | cfs, in |
| $Q_{threshold}$ | Diversion threshold flow for flow splitter | cfs |
| $q_p$ | Unit-hydrograph peak (SCS) | cfs/in |
| $R$ | RUSLE rainfall erosivity factor; or hydraulic radius | —, ft |
| $R_a$ | Extraterrestrial radiation | MJ/m$^2$/day |
| $R_v$ | Volumetric runoff coefficient (Schueler) | — |
| $\mathrm{Re}_p$ | Particle Reynolds number | — |
| $\rho_s, \rho_w$ | Density of sediment, water | kg/m$^3$ |
| $S$ | Slope (bed or energy); or retention parameter in SCS method | ft/ft, in |
| $SDR$ | Sediment delivery ratio | — |
| $SG, S_s$ | Specific gravity of sediment solids (2.65 for quartz) | — |
| $\mathrm{SF}$ | Safety factor | — |
| $\tau_0, \tau_c$ | Applied and critical shear stress | lb/ft$^2$ |
| $\tau^*_c$ | Dimensionless critical Shields parameter | — |
| $T$ | Top width; or analysis period (years) | ft, yr |
| $TW$ | Tailwater depth at culvert outlet or downstream pond | ft |
| $\theta$ | Volumetric soil moisture content | — |
| $\theta_{fc}$ | Field capacity (volumetric) | — |
| $\theta_{wp}$ | Wilting point (volumetric) | — |
| $t_c$ | Time of concentration | hr |
| $t_{res}$ | Hydraulic residence time | hr, min |
| $T_p$ | Time to peak | hr |
| $V$ | Flow velocity | ft/s |
| $V_s$ | Particle settling velocity | m/s, ft/s |
| $V_o$ | Overflow velocity (Camp) = $Q / A_s$ | ft/s |
| $WQV$ | Water quality volume | ft$^3$, ac-ft |
| $X$ | Muskingum weighting factor (0 to 0.5) | — |
| $y, y_c, y_n$ | Flow depth, critical depth, normal depth | ft |
| $z$ | Trapezoidal side slope (H:V) | — |
| Abbrev. | Meaning |
|---|---|
| ASCE | American Society of Civil Engineers |
| BMP | Best Management Practice |
| CN | Curve Number (NRCS method) |
| EGL | Energy Grade Line |
| EMC | Event Mean Concentration |
| ENR CCI | Engineering News-Record Construction Cost Index |
| ET | Evapotranspiration |
| FAO | Food and Agriculture Organization of the United Nations |
| FHWA | Federal Highway Administration |
| GHCN | Global Historical Climatology Network (NOAA) |
| HDS-5 | Hydraulic Design Series No. 5 — Hydraulic Design of Highway Culverts (FHWA) |
| HEC | Hydraulic Engineering Circular (FHWA) / Hydrologic Engineering Center (USACE) |
| HGL | Hydraulic Grade Line |
| IDEAL | Integrated Design and Evaluation Assessment of Loadings |
| MUSLE | Modified Universal Soil Loss Equation (Williams, 1975) |
| NCDEQ | North Carolina Department of Environmental Quality |
| NSQD | National Stormwater Quality Database (Pitt et al.) |
| NEH | National Engineering Handbook (USDA-NRCS) |
| NPV | Net Present Value |
| NRCS | Natural Resources Conservation Service (USDA) |
| PSD | Particle Size Distribution |
| RUSLE | Revised Universal Soil Loss Equation |
| SCS | Soil Conservation Service (now NRCS) |
| SDA | Soil Data Access (USDA-NRCS web service) |
| SDR | Sediment Delivery Ratio |
| SSURGO | Soil Survey Geographic Database (USDA-NRCS) |
| SWMM | Storm Water Management Model (US EPA) |
| TSS | Total Suspended Solids |
| TN, TP | Total Nitrogen, Total Phosphorus |
| USACE | US Army Corps of Engineers |
| USDA | US Department of Agriculture |
| WQV | Water Quality Volume |
HydroComplete Pro ships with a comprehensive regression test suite built on Vitest. The suite comprises 35 test files containing approximately 1,190+ individual assertions, all passing as of build 2026.04. Tests are organized into two tiers: unit tests (formula-level) and integration tests (multi-engine and end-to-end scenarios).
To run the full suite from the project root:
npx vitest run
Unit tests validate individual formulas and helper functions in isolation: SCS runoff, RUSLE/MUSLE factors, Manning’s equation, Stokes/Rubey settling velocities, Camp basin efficiency, orifice and weir equations, and unit-hydrograph convolution. Each test compares computed output to a hand-calculated or published-reference value within a stated tolerance.
Integration tests exercise multi-engine workflows and realistic design scenarios. The table below summarizes the coverage domains and assertion counts.
| Domain | Key tests | Approx. assertions |
|---|---|---|
| Core formulas | SCS CN, unit hydrograph, RUSLE, MUSLE, Manning’s normal/critical depth | ~80 |
| Multi-outlet routing | Orifice + weir + spillway composite, per-outlet hydrograph tracking, mass balance | ~50 |
| Conveyance | 14 pipe/channel types, HGL profiles, gutter/inlet capacity | ~60 |
| Treatment trains | 2- and 3-BMP series removal for TSS, TN, TP, bacteria, metals; $\eta_{total} = 1 - \prod(1 - \eta_i)$ | ~40 |
| SSURGO soil integration | Sand-subclass → 7-bin PSD builder, K-factor propagation into RUSLE and Camp | ~35 |
| Stokes/Camp settling | Five benchmark diameters, regime selection, Camp efficiency vs. Fair & Geyer (1954) | ~30 |
| Multi-storm MUSLE | Storm-sequence sediment yield accumulation, per-event volume tracking | ~25 |
| Forebay sizing | Forebay volume, area, and depth checks against state minimums | ~20 |
| Lane-Koelzer compaction | Reservoir sediment compaction over 25-yr and 50-yr horizons | ~15 |
| Land-use-specific kinetics | Buildup/washoff rates for 12 land-use categories, EMC regression | ~310 |
| BMP hydraulics | Internal routing for bioretention, sand filter, wet pond, constructed wetland | ~40 |
| Continuous simulation | 30-day ET draw-down, soil moisture accounting, inter-event recovery | ~25 |
| HydroCAD parity | Elev-area input, pre/post peak comparison, auto-size detention pond | ~30 |
| Advanced hydrology | Flow diversions (splitter), culvert HDS-5 inlet/outlet control, interconnected pond backwater | ~35 |
| Cross-engine consistency | Mass balance across Hydraflow → SEDCAD4 → IDEAL; formula transparency audit; no NaN checks | ~74 |
| Flow diversion integration | Split → WQ + sediment mass conservation across primary and bypass paths | ~28 |
| Tier | Files | Assertions | Status |
|---|---|---|---|
| Unit tests (Vitest) | 15 | ~290 | All passing |
| Integration tests (Vitest) | 20 | ~900+ | All passing |
| Total | 35 | ~1,190+ | All passing |
A reviewer or regulator can execute npx vitest run against the
current release to reproduce all benchmark numbers cited throughout this manual.
Each test file prints a pass/fail summary; Vitest reports total assertions,
failures, and elapsed time.
End of HydroComplete Pro Technical Reference Manual, Version 1.0.