void getFluxes(double theta, double lowerDepth) // // Input: upperVolume = vol. depth of upper zone (ft) // upperDepth = depth of upper zone (ft) // Output: none // Purpose: computes water fluxes into/out of upper/lower GW zones. // { double upperDepth; // --- find upper zone depth lowerDepth = MAX(lowerDepth, 0.0); lowerDepth = MIN(lowerDepth, TotalDepth); upperDepth = TotalDepth - lowerDepth; // --- find evaporation from both zones getEvapRates(theta, upperDepth); // --- find percolation rate at upper & lower zone boundaries UpperPerc = getUpperPerc(theta, upperDepth); UpperPerc = MIN(UpperPerc, MaxUpperPerc); // --- find losses to deep GW LowerLoss = A.lowerLossCoeff * lowerDepth / TotalDepth; // --- find GW flow from lower zone to conveyance system node GWFlow = getGWFlow(lowerDepth); if ( GWFlow >= 0.0 ) GWFlow = MIN(GWFlow, MaxGWFlowPos); else GWFlow = MAX(GWFlow, MaxGWFlowNeg); }
void getFluxes(Project* project, double theta, double lowerDepth) // // Input: upperVolume = vol. depth of upper zone (ft) // upperDepth = depth of upper zone (ft) // Output: none // Purpose: computes water fluxes into/out of upper/lower project->GW zones. // { double upperDepth; // --- find upper zone depth lowerDepth = MAX(lowerDepth, 0.0); lowerDepth = MIN(lowerDepth, project->TotalDepth); upperDepth = project->TotalDepth - lowerDepth; // --- save lower depth and theta to global variables project->Hgw = lowerDepth; project->Theta = theta; // --- find evaporation rate from both zones getEvapRates(project,theta, upperDepth); // --- find percolation rate from upper to lower zone project->UpperPerc = getUpperPerc(project,theta, upperDepth); project->UpperPerc = MIN(project->UpperPerc, project->MaxUpperPerc); // --- find loss rate to deep project->GW if ( project->DeepFlowExpr != NULL ) project->LowerLoss = mathexpr_eval(project, project->DeepFlowExpr, getVariableValue) / UCF(project,RAINFALL); else project->LowerLoss = project->A.lowerLossCoeff * lowerDepth / project->TotalDepth; project->LowerLoss = MIN(project->LowerLoss, lowerDepth/project->Tstep); // --- find project->GW flow rate from lower zone to drainage system node project->GWFlow = getGWFlow(project,lowerDepth); if ( project->LatFlowExpr != NULL ) { project->GWFlow += mathexpr_eval(project, project->LatFlowExpr, getVariableValue) / UCF(project, GWFLOW); } if ( project->GWFlow >= 0.0 ) project->GWFlow = MIN(project->GWFlow, project->MaxGWFlowPos); else project->GWFlow = MAX(project->GWFlow, project->MaxGWFlowNeg); }
void getFluxes(double theta, double lowerDepth) // // Input: upperVolume = vol. depth of upper zone (ft) // upperDepth = depth of upper zone (ft) // Output: none // Purpose: computes water fluxes into/out of upper/lower GW zones. // { double upperDepth; // --- find upper zone depth lowerDepth = MAX(lowerDepth, 0.0); lowerDepth = MIN(lowerDepth, TotalDepth); upperDepth = TotalDepth - lowerDepth; // --- save lower depth and theta to global variables Hgw = lowerDepth; Theta = theta; // --- find evaporation rate from both zones getEvapRates(theta, upperDepth); // --- find percolation rate from upper to lower zone UpperPerc = getUpperPerc(theta, upperDepth); UpperPerc = MIN(UpperPerc, MaxUpperPerc); // --- find loss rate to deep GW if ( DeepFlowExpr != NULL ) LowerLoss = mathexpr_eval(DeepFlowExpr, getVariableValue) / UCF(RAINFALL); else LowerLoss = A.lowerLossCoeff * lowerDepth / TotalDepth; LowerLoss = MIN(LowerLoss, lowerDepth/Tstep); // --- find GW flow rate from lower zone to drainage system node GWFlow = getGWFlow(lowerDepth); if ( LatFlowExpr != NULL ) { GWFlow += mathexpr_eval(LatFlowExpr, getVariableValue) / UCF(GWFLOW); } if ( GWFlow >= 0.0 ) GWFlow = MIN(GWFlow, MaxGWFlowPos); else GWFlow = MAX(GWFlow, MaxGWFlowNeg); }