Speeding up HGS models using “unsaturated tables”
This post describes how unsaturated tables can be used to speed up model runs. Unsaturated tables refer to the Pressure-Saturation and Saturation-Relative Permeability tables that can be generated from van Genuchten parameters in an MPROPS file when running grok.exe
. Conceptually, these tables replace the need for on-the-fly calculations of unsaturated properties during simulation, improving computational efficiency.
Figure 1: Add command to *.mprops file
Hello everyone, this week’s post will show how “unsaturated tables” can be used to speed up model runs. “Unsaturated tables” refer to the "Pressure-Saturation" and "Saturation-Relative permeability" tables that can be optionally generated from the van Genuchten parameters in an MPROPS file when running grok.exe.
This post will walk through the steps of how to use the unsaturated tables, taking the Forsyth verification model as an example (found in the HGS installation folder; C:\Program_Files\HydroGeoSphere\verification\forsyth).
Step 1) Add command to generate the unsaturated tables (Figure 1)
To generate the unsaturated tables, the “generate tables from unsaturated functions” command must be added to each material definition in the prefix.mprops file.
Step 2) Run grok.exe
to generate the unsaturated tables (Figure 2)
Figure 2: Auto-generated unsat tables
Once that is done, you can run grok.exe
. After which, pressure-saturation and saturation-relative K tables will have been generated. In this example, there are four materials defined in the MPROPS file and thus a pressure-saturation table and a saturation-relative K table were generated for each material (Figure 2).
Step 3) Retrofit the MPROPS file with the p_s_table and s_k_table files (Figure 3)
In the MPROPS file, the van Genuchten information for each material must now be removed and replaced with its respective pressure-saturation and saturation-relative K tables. The image below offers some guidance on formatting.
For further guidance (and to save you the trouble of having to retrofit the MPROPS file yourselves), I have included the retrofitted MPROPS file here.
Step 4) Run grok.exe
and phgs.exe (Figure 4)
After that has been set up, you should notice an improvement in the model’s run time. Below is a comparison of this model’s run time on one of our machines before and after using the unsaturated tables.
I hope the information presented in this post can help improve the run times of your models. Please feel free to ask any questions you may have on using the unsaturated tables.
Figure 3: *.mprops file modified with unsaturated tables
Figure 4: Model runtime using unsat tables (right) compared to unsat functions (left)