Skip to content

Commit

Permalink
refactor(gwe-est): rename variables rhos and cps to density_solid and…
Browse files Browse the repository at this point in the history
… heat_capacity_solid (#2001)

* refactor(gwe-est): rename variables rhos and cps to density_solid and heat_capacity_solid

* update release notes

* duh

* 1 oversight and 1 spelling mistake

* ruff

* fix spelling mistake
  • Loading branch information
emorway-usgs committed Aug 28, 2024
1 parent af26abf commit d9d6092
Show file tree
Hide file tree
Showing 22 changed files with 63 additions and 51 deletions.
6 changes: 4 additions & 2 deletions autotest/test_gwe_cnd.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@
cpw = 4183.0
rhow = 1000.0
lhv = 2454.0
cps = 760.0
rhos = 1500.0

# Set solver parameter values (and related)
nouter, ninner = 100, 300
Expand Down Expand Up @@ -307,8 +309,8 @@ def build_models(idx, test):
heat_capacity_water=cpw,
density_water=rhow,
porosity=prsity,
cps=760.0,
rhos=1500.0,
heat_capacity_solid=cps,
density_solid=rhos,
filename=f"{gwename}.est",
)

Expand Down
7 changes: 5 additions & 2 deletions autotest/test_gwe_drycell_cnd0.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@
rhow = 1000.0
cpw = 4183.0
lhv = 2454.0
cps = 760.0
rhos = 1500.0


# Head input
left_hd = 15.0
Expand Down Expand Up @@ -291,8 +294,8 @@ def build_models(idx, test):
heat_capacity_water=cpw,
density_water=rhow,
latent_heat_vaporization=lhv,
cps=760.0,
rhos=1500.0,
heat_capacity_solid=cps,
density_solid=rhos,
pname="EST-2",
filename=f"{gwename1}.est",
)
Expand Down
6 changes: 4 additions & 2 deletions autotest/test_gwe_drycell_cnd1.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ def isMonotonic(A):
rhow = 1000.0
cpw = 4183.0
lhv = 2454.0
cps = 760.0
rhos = 1500.0

# Set solver parameter values (and related)
nouter, ninner = 100, 300
Expand Down Expand Up @@ -332,8 +334,8 @@ def build_models(idx, test):
heat_capacity_water=cpw,
density_water=rhow,
latent_heat_vaporization=lhv,
cps=760.0,
rhos=1500.0,
heat_capacity_solid=cps,
density_solid=rhos,
pname="EST-2",
filename=f"{gwename1}.est",
)
Expand Down
4 changes: 2 additions & 2 deletions autotest/test_gwe_drycell_cnd2.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,8 @@ def build_models(idx, test):
heat_capacity_water=cpw,
density_water=rhow,
latent_heat_vaporization=lhv,
cps=cps,
rhos=rhos,
heat_capacity_solid=cps,
density_solid=rhos,
pname="EST-3",
filename=f"{gwename}.est",
)
Expand Down
4 changes: 2 additions & 2 deletions autotest/test_gwe_drycell_cnd4.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,8 @@ def add_gwe_model(sim, gwename):
heat_capacity_water=cpw,
density_water=rhow,
latent_heat_vaporization=lhv,
cps=cps,
rhos=rhos,
heat_capacity_solid=cps,
density_solid=rhos,
pname="EST",
filename=f"{gwename}.est",
)
Expand Down
4 changes: 2 additions & 2 deletions autotest/test_gwe_esl01.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@ def build_models(idx, test):
heat_capacity_water=cpw,
density_water=rhow,
latent_heat_vaporization=lhv,
cps=cps,
rhos=rhos,
heat_capacity_solid=cps,
density_solid=rhos,
pname="EST-2",
filename=f"{gwename}.est",
)
Expand Down
4 changes: 2 additions & 2 deletions autotest/test_gwe_esl02.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ def build_models(idx, test):
heat_capacity_water=cpw,
density_water=rhow,
latent_heat_vaporization=lhv,
cps=cps,
rhos=rhos,
heat_capacity_solid=cps,
density_solid=rhos,
pname="EST-1",
filename=f"{gwename}.est",
)
Expand Down
4 changes: 2 additions & 2 deletions autotest/test_gwe_esl_analyt_sln.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,8 @@ def build_models(idx, test, ener_input):
heat_capacity_water=Cpw,
density_water=rhow,
latent_heat_vaporization=lhv,
cps=Cps,
rhos=rhos,
heat_capacity_solid=Cps,
density_solid=rhos,
pname="EST-1",
filename=f"{gwename}.est",
)
Expand Down
4 changes: 2 additions & 2 deletions autotest/test_gwe_lke_conduction.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,8 +576,8 @@ def build_models(idx, test):
heat_capacity_water=Cpw,
density_water=rhow,
latent_heat_vaporization=lhv,
cps=Cps,
rhos=rhos,
heat_capacity_solid=Cps,
density_solid=rhos,
pname="MST-1",
filename=f"{gwename}.mst",
)
Expand Down
4 changes: 2 additions & 2 deletions autotest/test_gwe_mve.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,8 +568,8 @@ def build_mf6_model(idx, ws):
heat_capacity_water=cpw,
density_water=rhow,
latent_heat_vaporization=lhv,
cps=cps,
rhos=rhos,
heat_capacity_solid=cps,
density_solid=rhos,
pname="EST",
filename=f"{gwename}.est",
)
Expand Down
4 changes: 2 additions & 2 deletions autotest/test_gwe_mwe_conduction.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,8 @@ def build_models(idx, test):
heat_capacity_water=Cpw,
density_water=rhow,
latent_heat_vaporization=lhv,
cps=Cps,
rhos=rhos,
heat_capacity_solid=Cps,
density_solid=rhos,
pname="MST-1",
filename=f"{gwename}.mst",
)
Expand Down
6 changes: 4 additions & 2 deletions autotest/test_gwe_obs.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ def isMonotonic(A):
# GWE related parameters
rhow = 1000.0
cpw = 4183.0
cps = 760.0
rhos = 1500.0
lhv = 2454.0

# Set solver parameter values (and related)
Expand Down Expand Up @@ -343,8 +345,8 @@ def build_gwe_model(sim, gwename, idx):
heat_capacity_water=cpw,
density_water=rhow,
latent_heat_vaporization=lhv,
cps=760.0,
rhos=1500.0,
heat_capacity_solid=cps,
density_solid=rhos,
pname="EST",
filename=f"{gwename}.est",
)
Expand Down
4 changes: 2 additions & 2 deletions autotest/test_gwe_sfe_strmbedcond.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,8 +505,8 @@ def build_models(idx, test):
heat_capacity_water=Cpw,
density_water=rhow,
latent_heat_vaporization=lhv,
cps=Cps,
rhos=rhos,
heat_capacity_solid=Cps,
density_solid=rhos,
pname="EST",
filename=f"{gwename}.est",
)
Expand Down
4 changes: 2 additions & 2 deletions autotest/test_gwe_split_analyt.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ def get_gwe_model(idx, sim, gwename, gwepath, ener_input, side="right"):
heat_capacity_water=Cpw,
density_water=rhow,
latent_heat_vaporization=lhv,
cps=Cps,
rhos=rhos,
heat_capacity_solid=Cps,
density_solid=rhos,
)

# Constant temperature goes on the left side of the left model
Expand Down
4 changes: 2 additions & 2 deletions autotest/test_gwe_stallman.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ def build_models(idx, test):
heat_capacity_water=cpw,
density_water=rhow,
latent_heat_vaporization=lhv,
cps=cps,
rhos=rhos,
heat_capacity_solid=cps,
density_solid=rhos,
filename=f"{gwename}.mst",
)

Expand Down
12 changes: 7 additions & 5 deletions autotest/test_gwe_uze00.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ def temp_analyt(t, z, t0, tinfil, v, d):
scheme = "UPSTREAM"
dispersivity = 0.0
prsity = 0.2
rhow = 1000.0
cpw = 4183.0
lhv = 2500.0
cps = 760.0
rhos = 1500.0

# transient uzf info
# iuzno cellid landflg ivertcn surfdp vks thtr thts thti eps [bndnm]
Expand Down Expand Up @@ -340,18 +345,15 @@ def build_models(idx, test):
)

# Instantiating MODFLOW 6 transport mass storage package
rhow = 1000.0
cpw = 4183.0
lhv = 2500.0
flopy.mf6.ModflowGweest(
gwe,
save_flows=True,
porosity=prsity,
heat_capacity_water=cpw,
density_water=rhow,
latent_heat_vaporization=lhv,
cps=760.0,
rhos=1500.0,
heat_capacity_solid=cps,
density_solid=rhos,
pname="EST",
filename=f"{gwename}.est",
)
Expand Down
4 changes: 2 additions & 2 deletions autotest/test_gwe_vs_gwt.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,8 @@ def build_models(idx, test):
heat_capacity_water=cpw,
density_water=rhow,
latent_heat_vaporization=lhv,
cps=760.0,
rhos=1500.0,
heat_capacity_solid=cps,
density_solid=rhos,
filename=f"{gwename}.est",
)

Expand Down
8 changes: 4 additions & 4 deletions autotest/test_gwegwe_exchng_with_comp2gwt.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,8 +582,8 @@ def add_upper_gwemodel(sim, scheme):
heat_capacity_water=cpw,
density_water=rhow,
latent_heat_vaporization=lhv,
cps=cps,
rhos=rhos,
heat_capacity_solid=cps,
density_solid=rhos,
pname="EST-UP",
filename=f"{mname}.est",
)
Expand Down Expand Up @@ -660,8 +660,8 @@ def add_lower_gwemodel(sim, scheme):
heat_capacity_water=cpw,
density_water=rhow,
latent_heat_vaporization=lhv,
cps=cps,
rhos=rhos,
heat_capacity_solid=cps,
density_solid=rhos,
pname="EST-LO",
filename=f"{mname}.est",
)
Expand Down
2 changes: 1 addition & 1 deletion doc/ReleaseNotes/develop.tex
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
\item Entangled with the previous issue, the ternary method could erroneously terminate a particle and report no exit face (before now this would hang) due to precision error in the exit time/position calculation. This could happen when two conditions are both met: the particle enters the subcell very close to one of its vertices, and flow very nearly parallels one of the subcell's faces. We have encountered similar situations before, solved by nudging the particle a small distance into the interior of the subcell before applying the tracking method. This particular case is resolved by increasing the padding distance from $\sisetup{input-digits = 0123456789\epsilon} \num{\epsilon e+2}$ to $\sisetup{input-digits = 0123456789\epsilon} \num{\epsilon e+5}$, where $\epsilon$ is machine precision.
\item For ASCII input files erroneously containing a mix of line endings, MODFLOW would sometimes proceed with unexpected results. The program was corrected to stop with an error message if an input line contained both carriage returns and line feeds.
\item Previously the PRT model's default behavior was to track particles until termination, beyond the specified simulation end time if necessary, as with MODPATH 7 stop time option 2 (extend). Under extended tracking, a particle entrained in a cyclic flow pattern, as can occur in variable-density flow, might cycle indefinitely and never terminate. The PRT model's default behavior has been changed to the equivalent of MP7 stop time option 1 (final), terminating any active particles at the specified simulation end time. If a new particle release point (PRP) package keyword option EXTEND\_TRACKING is provided, tracking is extended until particle termination.
\item A refactor of the energy storage and transfer (EST) package associated with the GWE model type results in different input requirements that breaks backward compatibility with what was required in version 6.5.0. The PACKAGEDATA block was removed from the EST package input. In its place, the heat capabity of water, the specified density of water, and the latent heat of vaporization are instead given default values that can be overridden by specifying alternative values in the OPTIONS block.
\item A refactor of the energy storage and transfer (EST) package associated with the GWE model type results in different input requirements that breaks backward compatibility with what was required in version 6.5.0. The PACKAGEDATA block was removed from the EST package input. In its place, the heat capacity of water, the specified density of water, and the latent heat of vaporization are instead given default values that can be overridden by specifying alternative values in the OPTIONS block. Additionally, the following variable names in the EST package input have been updated as follows: ``rhow'' changed to ``DENSITY\_WATER''; ``rhos'' changed to ``DENSITY\_SOLID''; ``cpw'' changed to ``HEAT\_CAPACITY\_WATER''; and ``cps'' changed to ``HEAT\_CAPACITY\_SOLID''.
\item The PRT model's cell face flows were improperly combined with boundary flows; for cell faces with active neighbors, the face flow replaced any boundary flows (likely a rare situation because IFLOWFACE is typically applied to faces on the boundary of the active domain). The face flow calculation has been corrected.
\item A bad pointer reference has been fixed in the PRT model. Depending on the combination of platform and compiler used to build the program, this could result in crashes (e.g. divide by zero errors) or in silent failures to properly pass particles downward between vertically adjacent cells, leading to early termination. The latter could occur as a consequence of undefined behavior which prevented detection of situations when a particle should exit a cell through its bottom face.
\item For a UZF setup with multiple UZF objects in a cell, the auxmultname option would cause the program to issue an unnecessary error. The program was corrected to remove the unnecessary error. The revised program was tested to ensure that the assignment of multiple UZF objects per cell works when it should and fails when the cumulative area of the UZF objects within a cell exceed the total area for the cell.
Expand Down
7 changes: 4 additions & 3 deletions doc/mf6io/mf6ivar/dfn/gwe-est.dfn
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,21 @@ longname aqueous phase decay rate coefficient
description is the rate coefficient for zero-order decay for the aqueous phase of the mobile domain. A negative value indicates heat (energy) production. The dimensions of decay for zero-order decay is energy per length cubed per time. Zero-order decay will have no effect on simulation results unless zero-order decay is specified in the options block.

block griddata
name cps
name heat_capacity_solid
type double precision
shape (nodes)
reader readarray
layered true
longname heat capacity of the aquifer material
description is the mass-based heat capacity of dry solids (aquifer material). For example, units of J/kg/C may be used (or equivalent).
mf6internal cps

block griddata
name rhos
name density_solid
type double precision
shape (nodes)
reader readarray
layered true
longname density of aquifer material
description is a user-specified value of the density of aquifer material not considering the voids. Value will remain fixed for the entire simulation. For example, if working in SI units, values may be entered as kilograms per cubic meter.

mf6internal rhos
4 changes: 2 additions & 2 deletions doc/mf6io/mf6ivar/examples/gwe-est-example.dat
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ END OPTIONS
BEGIN GRIDDATA
POROSITY
CONSTANT 0.1
CPS
HEAT_CAPACITY_SOLID
CONSTANT 880.0
RHOS
DENSITY_SOLID
CONSTANT 2650.0
END GRIDDATA

8 changes: 4 additions & 4 deletions src/Model/GroundWaterEnergy/gwe-est.f90
Original file line number Diff line number Diff line change
Expand Up @@ -772,12 +772,12 @@ subroutine read_data(this)
this%parser%iuactive, this%decay, &
aname(2))
lname(2) = .true.
case ('CPS')
case ('HEAT_CAPACITY_SOLID')
call this%dis%read_grid_array(line, lloc, istart, istop, this%iout, &
this%parser%iuactive, this%cps, &
aname(3))
lname(3) = .true.
case ('RHOS')
case ('DENSITY_SOLID')
call this%dis%read_grid_array(line, lloc, istart, istop, this%iout, &
this%parser%iuactive, this%rhos, &
aname(4))
Expand All @@ -801,11 +801,11 @@ subroutine read_data(this)
call store_error(errmsg)
end if
if (.not. lname(3)) then
write (errmsg, '(a)') 'CPS not specified in griddata block.'
write (errmsg, '(a)') 'HEAT_CAPACITY_SOLID not specified in griddata block.'
call store_error(errmsg)
end if
if (.not. lname(4)) then
write (errmsg, '(a)') 'RHOS not specified in griddata block.'
write (errmsg, '(a)') 'DENSITY_SOLID not specified in griddata block.'
call store_error(errmsg)
end if
!
Expand Down

0 comments on commit d9d6092

Please sign in to comment.