Exemplo n.º 1
0
void subcatch_getRunon(Project* project, int j)
//
//  Input:   j = subcatchment index
//  Output:  none
//  Purpose: Routes runoff from a subcatchment to its outlet subcatchment
//           or between its subareas.
//
{
    int    k;                          // outlet subcatchment index
    int    p;                          // pollutant index
    double q;                          // runon to outlet subcatchment (ft/sec)
    double q1, q2;                     // runoff from imperv. areas (ft/sec)
    double pervArea;                   // subcatchment pervious area (ft2)

    // --- add previous period's runoff from this subcatchment to the
    //     runon of the outflow subcatchment, if it exists
    k = project->Subcatch[j].outSubcatch;
    q = project->Subcatch[j].oldRunoff;
    if ( k >= 0 && k != j )
    {
        subcatch_addRunonFlow(project,k, q);
        for (p = 0; p < project->Nobjects[POLLUT]; p++)
        {
            project->Subcatch[k].newQual[p] += q * project->Subcatch[j].oldQual[p] * LperFT3;
        }
    }

    // --- add any LID underdrain flow sent from this subcatchment to
    //     other subcatchments
    if ( project->Subcatch[j].lidArea > 0.0 ) lid_addDrainRunon(project,j);

    // --- add to sub-area inflow any outflow from other subarea in previous period
    //     (NOTE: no transfer of runoff pollutant load, since runoff loads are
    //     based on runoff flow from entire subcatchment.)

    // --- Case 1: imperv --> perv
    if ( project->Subcatch[j].fracImperv < 1.0 &&
         project->Subcatch[j].subArea[IMPERV0].routeTo == TO_PERV )
    {
        // --- add area-wtd. outflow from imperv1 subarea to perv area inflow
        q1 = project->Subcatch[j].subArea[IMPERV0].runoff *
             project->Subcatch[j].subArea[IMPERV0].fArea;
        q2 = project->Subcatch[j].subArea[IMPERV1].runoff *
             project->Subcatch[j].subArea[IMPERV1].fArea;
        q = q1 + q2;
        project->Subcatch[j].subArea[PERV].inflow += q *
             (1.0 - project->Subcatch[j].subArea[IMPERV0].fOutlet) /
             project->Subcatch[j].subArea[PERV].fArea;
    }

    // --- Case 2: perv --> imperv
    if ( project->Subcatch[j].fracImperv > 0.0 &&
         project->Subcatch[j].subArea[PERV].routeTo == TO_IMPERV &&
         project->Subcatch[j].subArea[IMPERV1].fArea > 0.0 )
    {
        q = project->Subcatch[j].subArea[PERV].runoff;
        project->Subcatch[j].subArea[IMPERV1].inflow +=
            q * (1.0 - project->Subcatch[j].subArea[PERV].fOutlet) *
            project->Subcatch[j].subArea[PERV].fArea /
            project->Subcatch[j].subArea[IMPERV1].fArea;
    }

    // --- Add any return flow from LID units to pervious subarea
    if ( project->Subcatch[j].lidArea > 0.0 && project->Subcatch[j].fracImperv < 1.0 )
    {
        pervArea = project->Subcatch[j].subArea[PERV].fArea *
                   (project->Subcatch[j].area - project->Subcatch[j].lidArea);
        q = lid_getFlowToPerv(project,j);
        if ( pervArea > 0.0 )
        {
            project->Subcatch[j].subArea[PERV].inflow += q / pervArea;
        }
    }
}
Exemplo n.º 2
0
void subcatch_getRunon(int j)
//
//  Input:   j = subcatchment index
//  Output:  none
//  Purpose: Routes runoff from a subcatchment to its outlet subcatchment
//           or between its subareas.
//
{
    int    i;                          // subarea index
    int    k;                          // outlet subcatchment index
    double q;                          // runon to outlet subcatchment (ft/sec)
    double q1, q2;                     // runoff from imperv. areas (ft/sec)
    double pervArea;                   // subcatchment pervious area (ft2)

    // --- add previous period's runoff from this subcatchment to the
    //     runon of the outflow subcatchment, if it exists
    k = Subcatch[j].outSubcatch;
    if ( k >= 0 && k != j && Subcatch[k].area > 0.0 )
    {
        // --- distribute previous runoff from subcatch j (in cfs)
        //     uniformly over area of subcatch k (ft/sec)
        q = Subcatch[j].oldRunoff / Subcatch[k].area;
        Subcatch[k].runon += q;

        // --- assign this flow to the 3 types of subareas
        for (i = IMPERV0; i <= PERV; i++)
        {
            Subcatch[k].subArea[i].inflow += q;
        }

        // --- add runoff mass load (in mass/sec) to receiving subcatch,
        //     storing it in Subcatch[].newQual for now
        for (i = 0; i < Nobjects[POLLUT]; i++)
        {
            Subcatch[k].newQual[i] += (Subcatch[j].oldRunoff *
                                       Subcatch[j].oldQual[i] * LperFT3);
        }
    }

    // --- add to sub-area inflow any outflow from other subarea in previous period
    //     (NOTE: no transfer of runoff pollutant load, since runoff loads are
    //     based on runoff flow from entire subcatchment.)

    // --- Case 1: imperv --> perv
    if ( Subcatch[j].fracImperv < 1.0 &&
            Subcatch[j].subArea[IMPERV0].routeTo == TO_PERV )
    {
        // --- add area-wtd. outflow from imperv1 subarea to perv area inflow
        q1 = Subcatch[j].subArea[IMPERV0].runoff *
             Subcatch[j].subArea[IMPERV0].fArea;
        q2 = Subcatch[j].subArea[IMPERV1].runoff *
             Subcatch[j].subArea[IMPERV1].fArea;
        q = q1 + q2;
        Subcatch[j].subArea[PERV].inflow += q *
                                            (1.0 - Subcatch[j].subArea[IMPERV0].fOutlet) /
                                            Subcatch[j].subArea[PERV].fArea;
    }

    // --- Case 2: perv --> imperv
    if ( Subcatch[j].fracImperv > 0.0 &&
            Subcatch[j].subArea[PERV].routeTo == TO_IMPERV &&
            Subcatch[j].subArea[IMPERV1].fArea > 0.0 )
    {
        q = Subcatch[j].subArea[PERV].runoff;
        Subcatch[j].subArea[IMPERV1].inflow +=
            q * (1.0 - Subcatch[j].subArea[PERV].fOutlet) *
            Subcatch[j].subArea[PERV].fArea /
            Subcatch[j].subArea[IMPERV1].fArea;
    }

    // --- Add any return flow from LID units to pervious subarea
    if ( Subcatch[j].lidArea > 0.0 && Subcatch[j].fracImperv < 1.0 )
    {
        pervArea = Subcatch[j].subArea[PERV].fArea *
                   (Subcatch[j].area - Subcatch[j].lidArea);
        if ( pervArea > 0.0 ) Subcatch[j].subArea[PERV].inflow +=
                lid_getFlowToPerv(j) / pervArea;
    }
}