rniswon / mfnwt

MODFLOW-NWT - Version: 1.1.0 Newton Formulation for MODFLOW-2005 For more information go to http://water.usgs.gov/ogw/modflow-nwt
4 stars 7 forks source link

CALC_XSA (calculate cross-sectional area for MT3D-USGS) #13

Closed emorway-usgs closed 5 years ago

emorway-usgs commented 7 years ago

Currently, the variable 'qa' is the flow at the upstream end of a reach. This presents a problem when the user specifies a negative value for FLOW in the SFR input (item 4b in the Online Guide to MF-NWT) because in the code below, a negative value is being sent in causing a negative cross-sectional area to be calculated (but actually creates a floating point error). Recall that a negative value signifies a direct withdraw from the channel (and that water is removed from the model). We want to instead send in the flow at the end of the reach to CALC_XSA

STRM(31,l) = CALC_XSA(qa,qcnst,cdpth,awdth,fdpth,bwdth, + icalc,slope,istsg,nreach,itstr,width, + depthtr)

rniswon commented 7 years ago

fixed with commit 0c3902f

emorway-usgs commented 5 years ago

This recently became an issue again. Turns out the previous fix was incomplete. There are two cases that need to be handled:

  1. In most cases, qa = STRM(10,l) needs to happen.
  2. In some cases, however, when an upstream diversion diverts all flow, STRM(10,l) will be set equal to 0, but flow can still be exiting the reach (from sources like accumulated overland runoff or gw discharge) and therefore X-sectional area still needs to be calculated and passed to ftl. In this case, qa = STRM(25,l)
emorway-usgs commented 5 years ago

As commented in commit 65cba36, both test models seem to be OK now. Attaching the test model passed along by @jwhite79 in case it is needed for future reference. The other test model referenced in this issue, "SFT_CrnkNic" can be found on the MT3D-USGS repo. JWub_LinkerTest.zip

emorway-usgs commented 5 years ago

This is also related to issue #19 on MT3D-USGS