Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gwe-uze): stop simulation when area of uze object not equal to cell area #2073

Merged
merged 22 commits into from
Dec 9, 2024

Conversation

emorway-usgs
Copy link
Contributor

Based of how UZE is formulated, only one UZE object per grid cell is permitted. If more than one UZE object is discovered in a grid cell, GWE will now exit with an error message. To fix, users will need to remove the AUXMULTNAME keyword from the OPTIONS block of the corresponding UZF input file.

  • Replaced section above with description of pull request
  • Fixes issue Add check for AUXMULTNAME option in UZF to GWE #2048
  • Added new test
  • Ran ruff on new python script in autotest subdirectories.
  • Formatted new and modified Fortran source files with fprettify
  • Added doxygen comments to new procedures
  • Updated develop.tex with a plain-language description of the bug fix, change, feature; required for changes that may affect users
  • Updated input and output guide

@wpbonelli wpbonelli added this to the 6.6.0 milestone Nov 26, 2024
@emorway-usgs
Copy link
Contributor Author

review comments included:

  • reducing extent of IDOMAIN such that reduced node numbers were different then absolute node number
  • ensure that the new dup_chk vector is sized to NNODES and not merely MAXLIST
  • rename subroutines
  • supplement error message with ID of cell where more than one UZF object exists

@emorway-usgs
Copy link
Contributor Author

emorway-usgs commented Nov 27, 2024

@langevin-usgs, some more work remains on this. When the GWF flows are provided to GWE in memory, the auxmultcol-adjusted area of each UZF object isn't set until the _ad() routines. So the current check (as of 52e6d7e) does not do the area comparison with the correct UZF areas.

subroutine uzf_ad(this) makes a call to call this%uzfobj%setdatauzfarea(i, rval1), which lives in UzfCellGroup.f90 and does the following:

  !> @brief Set uzfarea using cellarea and areamult
  !<
  subroutine setdatauzfarea(this, icell, areamult)
    ! -- dummy
    class(UzfCellGroupType) :: this
    integer(I4B), intent(in) :: icell
    real(DP), intent(in) :: areamult
    !
    ! -- set uzf area
    this%uzfarea(icell) = this%cellarea(icell) * areamult
  end subroutine setdatauzfarea

where the argument areamult is passed in as rval1: rval1 = this%uauxvar(this%iauxmultcol, i)

@emorway-usgs emorway-usgs force-pushed the multi_uze_fix branch 2 times, most recently from 0bc0a19 to 26ae1a9 Compare December 2, 2024 16:34
Copy link
Contributor

@langevin-usgs langevin-usgs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks much better. Did this not work if the check was done at the end of rp? Just asking because this will require a loop through all nodes at the start of every time step (instead of stress period). Probably not a big deal. Other minor suggestions.

src/Model/GroundWaterEnergy/gwe-uze.f90 Outdated Show resolved Hide resolved
src/Model/GroundWaterEnergy/gwe-uze.f90 Outdated Show resolved Hide resolved
src/Model/GroundWaterEnergy/gwe-uze.f90 Outdated Show resolved Hide resolved
@emorway-usgs emorway-usgs changed the title fix(gwe-uze): stop simulation when multiple uze objects discovered in one cell fix(gwe-uze): stop simulation when area of uze object not equal to cell area Dec 6, 2024
@emorway-usgs
Copy link
Contributor Author

Did this not work if the check was done at the end of rp? Just asking because this will require a loop through all nodes at the start of every time step (instead of stress period).

The check doesn't fail at the end of _rp() like it should. It appears that the auxiliary variable containing the UZE area hasn't been updated by the end of _rp(). However, it has been updated by the time _ad() routines have been called and the new test problems fail as designed.

@langevin-usgs langevin-usgs merged commit 8173b2e into MODFLOW-USGS:develop Dec 9, 2024
20 checks passed
@emorway-usgs emorway-usgs deleted the multi_uze_fix branch December 9, 2024 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants