//////////////////////////////////////////////////////////// // This function has been totally rewritten. (LR - 7/5/06 ) //////////////////////////////////////////////////////////// //float landuse_getWashoff(int i, float area, TLandFactor landFactor[], // float fPpt, float runoff, float wUpstrm[], // float wTotal[], float tStep) void landuse_getWashoff(int i, float area, TLandFactor landFactor[], float qRunoff, float tStep, float washoffLoad[]) // // Input: i = land use index // area = subcatchment area (ft2) // landFactor[] = array of land use data for subcatchment // runoff = runoff flow rate (ft/sec) over subcatchment // tStep = time step (sec) // Output: washoffLoad[] = pollutant load in surface washoff (mass/sec) // Purpose: computes surface washoff load for all pollutants generated by a // land use within a subcatchment. // { int p; //pollutant index float fArea; //area devoted to land use (ft2) //added float iArea; //impervious area (ft2) // --- find area devoted to land use fArea = landFactor[i].fraction * area; // --- find impervious area devoted to land use iArea = fArea * Landuse[i].pctimp; // --- initialize washoff loads from land use for (p = 0; p < Nobjects[POLLUT]; p++) washoffLoad[p] = 0.0; // --- compute contribution from direct runoff load for (p = 0; p < Nobjects[POLLUT]; p++) { if (Pollut[p].sedflag > 0) // the pollutant is sediment // calculate sediment washoff on impervious area washoffLoad[p] += landuse_getRunoffLoad(i, p, iArea, landFactor, qRunoff, tStep); else // calculate pollutant washoff on total landuse area washoffLoad[p] += landuse_getRunoffLoad(i, p, fArea, landFactor, qRunoff, tStep); } // --- compute contribution from co-pollutant for (p = 0; p < Nobjects[POLLUT]; p++) { washoffLoad[p] += landuse_getCoPollutLoad(p, washoffLoad, tStep); } }
void subcatch_getWashoff(int j, double runoff, double tStep) // // Input: j = subcatchment index // runoff = total subcatchment runoff (ft/sec) // tStep = time step (sec) // Output: none // Purpose: computes new runoff quality for subcatchment. // // Considers two separate pollutant generating streams that are combined // together: // 1. complete mix mass balance of pollutants in surface ponding due to // runon, wet deposition, infil., & evap. // 2. washoff of pollutant buildup as described by the project's land // use washoff functions. // { int i, p; double massLoad; // --- return if there is no area or no pollutants if ( Nobjects[POLLUT] == 0 || Subcatch[j].area == 0.0 ) return; // --- intialize outflow loads to zero for (p = 0; p < Nobjects[POLLUT]; p++) { WashoffLoad[p] = 0.0; // load just from washoff function OutflowLoad[p] = 0.0; // Washoff load + ponded water load } // --- add outflow of pollutants in ponded water to outflow loads // (Note: at this point, Subcatch.newQual contains mass inflow // from any upstream subcatchments draining to this one) updatePondedQual(j, Subcatch[j].newQual, Subcatch[j].pondedQual, tStep); // --- add washoff loads from landuses to outflow loads if ( runoff >= MIN_RUNOFF ) { for (i = 0; i < Nobjects[LANDUSE]; i++) { if ( Subcatch[j].landFactor[i].fraction > 0.0 ) { landuse_getWashoff(i, Subcatch[j].area, Subcatch[j].landFactor, runoff, tStep, WashoffLoad); } } // --- compute contribution from any co-pollutant for (p = 0; p < Nobjects[POLLUT]; p++) { WashoffLoad[p] += landuse_getCoPollutLoad(p, WashoffLoad); OutflowLoad[p] += WashoffLoad[p]; } } // --- switch from internal runoff (used in washoff functions) to // runoff that actually leaves the subcatchment runoff = Subcatch[j].newRunoff; // --- for each pollutant for (p = 0; p < Nobjects[POLLUT]; p++) { // --- update subcatchment's total runoff load in lbs (or kg) massLoad = OutflowLoad[p] * Pollut[p].mcf; Subcatch[j].totalLoad[p] += massLoad; // --- update overall runoff mass balance if runoff goes to // conveyance system if ( Subcatch[j].outNode >= 0 || Subcatch[j].outSubcatch == j ) massbal_updateLoadingTotals(RUNOFF_LOAD, p, massLoad); // --- save new outflow runoff concentration (in mass/L) if ( runoff > MIN_RUNOFF ) Subcatch[j].newQual[p] = OutflowLoad[p] / (runoff * tStep * LperFT3); else Subcatch[j].newQual[p] = 0.0; } }