Hclose and Rclose Clarification Question

273 views
Skip to first unread message

Philip Margarit

unread,
Feb 25, 2022, 12:14:33 AM2/25/22
to MODFLOW Users Group
Hi All,

We are modeling a few karst regions and attempting PEST calibration. We wanted to ask if anyone knew the reasonable range for Hclose and Rclose for the PCG solver. As we relax it more, it has helped our PEST calibration run without terminating early due to non-convergence issues while adjusting parameters. We are mainly asking to make sure we do not relax it past what would be a reasonable range so long as the flow budget from the converged solution is reasonable. 

Thanks all for your time and help. 

Richard B. Winston

unread,
Feb 25, 2022, 1:10:57 AM2/25/22
to MODFLOW Google Group
Consider using the STOPERROR option in the Basic package or the CONTINUE option in the NWT package rather than adjusting the solver convergence criteria.

Philip Margarit

unread,
Feb 25, 2022, 10:39:57 PM2/25/22
to mod...@googlegroups.com
Hi Richard,

Thanks so much for getting back to me. Do you have an example of the Ba6 file where the STOPERROR option is enabled. I am using GMS and they do not have this option integrated so I assume I would have to edit the file directly or do a custom run option. 

Thanks again so much for your help. 

--
You received this message because you are subscribed to the Google Groups "MODFLOW Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to modflow+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/modflow/8deab972-f024-4168-971d-a8d08b92603c%40mindspring.com.


--
Philip Margarit

Water Resources Science (Ph.D. Student)
College of Food, Agriculture, and Natural Resources Science 
University of Minnesota-Twin Cities

Boyce, Scott E

unread,
Feb 25, 2022, 10:40:10 PM2/25/22
to MODFLOW Users Group
When using MF-2005 or MF-CFP you will want to make sure to print out the volumetric budget for every time step by putting in the OC package the keyword PRINT BUDGET for every time step. Otherwise, the mass balance errors are only checked for the last time step of each stress period or when convergence fails (too large of HCLOSE/RCLOSE can result in convergence, but with a bad mass errors).

One thing to point out is that different packages have different definitions of HCLOSE and RCLOSE. The general idea is the same (Head CLOSurE and Residual CLOSurE),  but an example is that PCG uses the L norm for RCLOSE while NWT uses the L2 normal, where the latter is less strict of a tolerance.

Base MODFLOW does include the option STOPERROR followed by an accepted percent error threshold for stopping.
That is, "STOPERROR 5.0" will take advantage of MODFLOW checking the mass error due to failed convergence, then the keyword will not stop the simulation if the mass error is less than 5%.

Another option is to try running your model using MODFLOW-OWHM (here is the 2020 version 2 pub: https://pubs.usgs.gov/tm/06/a60/tm6A60.pdf).
It includes MF-CFP and MF-2005. An added bonus is that it checks the mass errors for every time step and if they exceed 5%, then a warning is raised to to the LIST and command file and the volumetric budget is printed to the LIST.

The exe download and source code is hosted at: https://code.usgs.gov/modflow/mf-owhm

v2.2.0​ was just released and v2.2.1​ is about to be submitted for USGS code peer review.

It also supports the BAS option STOPERROR, but also includes another option called NO_FAILED_CONVERGENCE_STOP
If that is added the BAS package options, then the simulation will never stop if convergence fails.

One thing that I should point out, if you use OWHM, is that it includes an additional convergence metric that is handled by the BAS package.
It is called maximum allowed relative volume error, which is defined as the the error residual (r = Ah - RHS) divided by the cell volume. You can think of it is normalization the mismatch between the left and right hand sides of the groundwater equations by the volume of the cell. I added this with the v2 release to create a semi-unitless convergence metric (the units being T -1). 

The default value used is 0.025​ and the value can be changed with the BAS option MAX_RELATIVE_VOLUME_ERROR  followed by the value for the new threshold (anything >1 pretty much disables the additional metric).

There are a lot of options added to various packages. If you want to see what they are, they are located in the doc folder o the download (or go here https://code.usgs.gov/modflow/mf-owhm/-/tree/main/doc/Option_Block_Cheatsheets).

I also set up some basic syntax highlighting when viewing MODFLOW input files (if you use NotePad++). Those syntax definitions are in the doc/Notepadpp_Syntax_Highlighting directory (or read about it at: https://code.usgs.gov/modflow/mf-owhm/-/blob/main/doc/Notepadpp_Syntax_Highlighting/Notepadpp_Syntax_Install.md)

I attached an html version of some of the BAS options for you to see what it looks like with highlighting.

Hope that helps out and good luck with the model.

Scott










From: 'Philip Margarit' via MODFLOW Users Group <mod...@googlegroups.com>
Sent: Thursday, February 24, 2022 9:08 PM
To: MODFLOW Users Group <mod...@googlegroups.com>
Subject: [EXTERNAL] [MODFLOW] Hclose and Rclose Clarification Question
 

 

 This email has been received from outside of DOI - Use caution before clicking on links, opening attachments, or responding.  



Hi All,

We are modeling a few karst regions and attempting PEST calibration. We wanted to ask if anyone knew the reasonable range for Hclose and Rclose for the PCG solver. As we relax it more, it has helped our PEST calibration run without terminating early due to non-convergence issues while adjusting parameters. We are mainly asking to make sure we do not relax it past what would be a reasonable range so long as the flow budget from the converged solution is reasonable. 

Thanks all for your time and help. 

--
You received this message because you are subscribed to the Google Groups "MODFLOW Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to modflow+u...@googlegroups.com.
BAS_Options_Recommended.bas.html

Arvind - SWE

unread,
Feb 27, 2022, 10:25:59 PM2/27/22
to mod...@googlegroups.com
Can you share example data file for simulation and prediction ground water table fluctuations for Visual modflow. Please share manual or video of visual modflow working for beginners.

With Regards
Arvind
Ph.D. Research Scholar 
Department of Soil & Water Engineering
Punjab Agricultural University, Ludhiana- 141004

Richard B. Winston

unread,
Feb 28, 2022, 12:15:45 PM2/28/22
to mod...@googlegroups.com
Here is an example of the beginning of a basic packages file that uses
the STOPERROR option. STOPERROR must be followed by a number that
represents the maximum allowable percent error in the water budget.

# Basic Package file created on 2/16/2022 by ModelMuse version 4.3.0.83.
# Number of active cells = 26807.
FREE STOPERROR   5.000000000000E+000  # OPTIONS



'Philip Margarit' via MODFLOW Users Group wrote:
> Hi Richard,
>
> Thanks so much for getting back to me. Do you have an example of the
> Ba6 file where the STOPERROR option is enabled. I am using GMS and
> they do not have this option integrated so I assume I would have to
> edit the file directly or do a custom run option.
>
> Thanks again so much for your help.
>
> On Fri, Feb 25, 2022 at 12:10 AM Richard B. Winston
> <rbwi...@mindspring.com <mailto:rbwi...@mindspring.com>> wrote:
>
> Consider using the STOPERROR option in the Basic package or the
> CONTINUE option in the NWT package rather than adjusting the
> solver convergence criteria.
> On Feb 25, 2022, at 12:14 AM, 'Philip Margarit' via MODFLOW Users
> Group <mod...@googlegroups.com <mailto:mod...@googlegroups.com>>
> wrote:
>
> Hi All,
>
> We are modeling a few karst regions and attempting PEST
> calibration. We wanted to ask if anyone knew the reasonable
> range for Hclose and Rclose for the PCG solver. As we relax it
> more, it has helped our PEST calibration run without
> terminating early due to non-convergence issues while
> adjusting parameters. We are mainly asking to make sure we do
> not relax it past what would be a reasonable range so long as
> the flow budget from the converged solution is reasonable.
>
> Thanks all for your time and help.
>
> --
> You received this message because you are subscribed to the Google
> Groups "MODFLOW Users Group" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to modflow+u...@googlegroups.com
> <mailto:modflow+u...@googlegroups.com>.
> <https://groups.google.com/d/msgid/modflow/8deab972-f024-4168-971d-a8d08b92603c%40mindspring.com?utm_medium=email&utm_source=footer>.
>
>
>
> --
> Philip Margarit
>
> /Water Resources Science (Ph.D. Student)/
> /College of Food, Agriculture, and Natural Resources Science /
> /University of Minnesota-Twin Cities/
> /651-262-3561/
> --
> You received this message because you are subscribed to the Google
> Groups "MODFLOW Users Group" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to modflow+u...@googlegroups.com
> <mailto:modflow+u...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/modflow/CAO%3DMhd2uDAbRuwQOcC%2BS_b%2BCnDaHq3q-2bzRodB_aJCZSgUbSA%40mail.gmail.com
> <https://groups.google.com/d/msgid/modflow/CAO%3DMhd2uDAbRuwQOcC%2BS_b%2BCnDaHq3q-2bzRodB_aJCZSgUbSA%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Jeremy White

unread,
Feb 28, 2022, 10:36:46 PM2/28/22
to MODFLOW Users Group
In the PEST world, using the MODFLOW "CONTINUE" option is usually critical for success b/c its likely that one or more stress periods/time steps will fail to converge as parameters vary.  But, as you allude to, a fail-to-converge for MODFLOW stress period/time step doesnt necessarily mean the water budget is no-good or the simulation in general is no-good.  I typically add the global listing file volumetric budget terms as "observations" in the PEST control file just to keep an eye on these quantities, so that as parameters are varied, you can easily check that the various water budget terms are conceptually making sense and also to make sure the budget error is still acceptable...just my two cents.

Philip Margarit

unread,
Feb 28, 2022, 10:36:55 PM2/28/22
to mod...@googlegroups.com
Hi Richard, 

Thank you so much for your help on this. I attached the text from my .ba6 file that GMS creates. Do you know where I would insert that option within this file as it's output looks a bit different than what Modelmuse creates. 

Here is the original text: 

#GMS MODFLOW Simulation
#05 March 2021
FREE
HDF5 1.0 -1 "currentTBcalibratedmodel_322.h5" "Arrays/ibound1" 1 0 10000
HDF5 1.0 -1 "currentTBcalibratedmodel_322.h5" "Arrays/ibound2" 1 0 10000
HDF5 1.0 -1 "currentTBcalibratedmodel_322.h5" "Arrays/ibound3" 1 0 10000
HDF5 1.0 -1 "currentTBcalibratedmodel_322.h5" "Arrays/ibound4" 1 0 10000
HDF5 1.0 -1 "currentTBcalibratedmodel_322.h5" "Arrays/ibound5" 1 0 10000
-999.0
HDF5 1.0 -1 "currentTBcalibratedmodel_322.h5" "Arrays/StartHead1" 1 0 10000
HDF5 1.0 -1 "currentTBcalibratedmodel_322.h5" "Arrays/StartHead2" 1 0 10000
HDF5 1.0 -1 "currentTBcalibratedmodel_322.h5" "Arrays/StartHead3" 1 0 10000
HDF5 1.0 -1 "currentTBcalibratedmodel_322.h5" "Arrays/StartHead4" 1 0 10000
HDF5 1.0 -1 "currentTBcalibratedmodel_322.h5" "Arrays/StartHead5" 1 0 10000


Would it then with the STOPERROR option be: 

#GMS MODFLOW Simulation
#05 March 2021
FREE STOPERROR   5.000000000000E+000  # OPTIONS
HDF5 1.0 -1 "currentTBcalibratedmodel_322.h5" "Arrays/ibound1" 1 0 10000
HDF5 1.0 -1 "currentTBcalibratedmodel_322.h5" "Arrays/ibound2" 1 0 10000
HDF5 1.0 -1 "currentTBcalibratedmodel_322.h5" "Arrays/ibound3" 1 0 10000
HDF5 1.0 -1 "currentTBcalibratedmodel_322.h5" "Arrays/ibound4" 1 0 10000
HDF5 1.0 -1 "currentTBcalibratedmodel_322.h5" "Arrays/ibound5" 1 0 10000
-999.0
HDF5 1.0 -1 "currentTBcalibratedmodel_322.h5" "Arrays/StartHead1" 1 0 10000
HDF5 1.0 -1 "currentTBcalibratedmodel_322.h5" "Arrays/StartHead2" 1 0 10000
HDF5 1.0 -1 "currentTBcalibratedmodel_322.h5" "Arrays/StartHead3" 1 0 10000
HDF5 1.0 -1 "currentTBcalibratedmodel_322.h5" "Arrays/StartHead4" 1 0 10000
HDF5 1.0 -1 "currentTBcalibratedmodel_322.h5" "Arrays/StartHead5" 1 0 10000


Thanks again for all of your help. I really appreciate it. 

To unsubscribe from this group and stop receiving emails from it, send an email to modflow+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/modflow/15b906f9-7cb2-dbf0-0157-080f25869569%40mindspring.com.


--
Philip Margarit

Water Resources Science (Ph.D. Student)
College of Food, Agriculture, and Natural Resources Science 

Philip Margarit

unread,
Feb 28, 2022, 10:37:10 PM2/28/22
to mod...@googlegroups.com
Hi Scott, 

Thank you so much for your response as well. I really appreciate all the detailed information you sent. I will have to go through your response in more detail but I really appreciate all the time you spent in sending me this information. 

Take care and have a great start to your week. 

You received this message because you are subscribed to a topic in the Google Groups "MODFLOW Users Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/modflow/NQp0f4yd5ZI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to modflow+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/modflow/PH0PR09MB7547E5FF0D9019C48F70B689DC3E9%40PH0PR09MB7547.namprd09.prod.outlook.com.

Richard B. Winston

unread,
Mar 1, 2022, 1:19:37 AM3/1/22
to MODFLOW Google Group
What you have should work. You don't need the "#OPTIONS" but having it shouldn't hurt anything. It is just a comment and will be ignored.

Boyce, Scott E

unread,
Mar 1, 2022, 2:26:01 AM3/1/22
to MODFLOW Users Group
#05 March 2021
FREE
HDF5 1.0 -1 "currentTBcalibratedmodel_322.h5" "Arrays/ibound1" 1 0 10000

add

#05 March 2021
FREE  STOPERROR 5.0
HDF5 1.0 -1 "currentTBcalibratedmodel_322.h5" "Arrays/ibound1" 1 0 10000

From: mod...@googlegroups.com <mod...@googlegroups.com> on behalf of Jeremy White <jtwhi...@gmail.com>
Sent: Monday, February 28, 2022 11:51 AM

To: MODFLOW Users Group <mod...@googlegroups.com>
Subject: [EXTERNAL] Re: [MODFLOW] Hclose and Rclose Clarification Question
 

 

 This email has been received from outside of DOI - Use caution before clicking on links, opening attachments, or responding.  



To unsubscribe from this group and stop receiving emails from it, send an email to modflow+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/modflow/dfe362e1-d06a-4457-9b29-7b6aaf28efb9n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages