MODFLOW 6  version 6.5.0.dev2
MODFLOW 6 Code Documentation
gwfstorageutilsmodule Module Reference

This module contains stateless storage subroutines and functions. More...

Functions/Subroutines

pure subroutine, public ssterms (iconvert, iorig_ss, iconf_ss, top, bot, rho1, rho1old, snnew, snold, hnew, hold, aterm, rhsterm, rate)
 Calculate the specific storage terms. More...
 
pure subroutine, public syterms (top, bot, rho2, rho2old, snnew, snold, aterm, rhsterm, rate)
 Calculate the specific yield storage terms. More...
 
pure real(dp) function, public sscapacity (istor_coef, top, bot, area, ss)
 Calculate the specific storage capacity. More...
 
pure real(dp) function, public sycapacity (area, sy)
 Calculate the specific yield capacity. More...
 

Detailed Description

This module contains the functions to calculate the specific storage (SC1) and specific yield (SC2) capacities that are used in the storage (STO) package. It also contains subroutines to calculate the amat and rhs terms for specific storage and specific yield. This module does not depend on the STO package.

Function/Subroutine Documentation

◆ sscapacity()

pure real(dp) function, public gwfstorageutilsmodule::sscapacity ( integer(i4b), intent(in)  istor_coef,
real(dp), intent(in)  top,
real(dp), intent(in)  bot,
real(dp), intent(in)  area,
real(dp), intent(in)  ss 
)

Function to calculate the specific storage capacity using the cell geometry and the specific storage or storage coefficient.

Returns
sc1 specific storage capacity
Parameters
[in]istor_coefflag indicating if ss is the storage coefficient
[in]toptop of cell
[in]botbottom of cell
[in]areahorizontal cell area
[in]ssspecific storage or storage coefficient

Definition at line 149 of file GwfStorageUtils.f90.

150  ! -- dummy variables
151  integer(I4B), intent(in) :: istor_coef !< flag indicating if ss is the storage coefficient
152  real(DP), intent(in) :: top !< top of cell
153  real(DP), intent(in) :: bot !< bottom of cell
154  real(DP), intent(in) :: area !< horizontal cell area
155  real(DP), intent(in) :: ss !< specific storage or storage coefficient
156  ! -- local variables
157  real(DP) :: sc1
158  real(DP) :: thick
159  ! -- calculate specific storage capacity
160  if (istor_coef == 0) then
161  thick = top - bot
162  else
163  thick = done
164  end if
165  sc1 = ss * thick * area
166  !
167  ! -- return
168  return
Here is the caller graph for this function:

◆ ssterms()

pure subroutine, public gwfstorageutilsmodule::ssterms ( integer(i4b), intent(in)  iconvert,
integer(i4b), intent(in)  iorig_ss,
integer(i4b), intent(in)  iconf_ss,
real(dp), intent(in)  top,
real(dp), intent(in)  bot,
real(dp), intent(in)  rho1,
real(dp), intent(in)  rho1old,
real(dp), intent(in)  snnew,
real(dp), intent(in)  snold,
real(dp), intent(in)  hnew,
real(dp), intent(in)  hold,
real(dp), intent(inout)  aterm,
real(dp), intent(inout)  rhsterm,
real(dp), intent(inout), optional  rate 
)

Subroutine to calculate the specific storage terms for a cell using the cell geometry, current and previous specific storage capacity, current and previous cell saturation, and the current and previous head. Subroutine can optionally return the flow rate from specific storage.

Parameters
[in]iconvertflag indicating if cell is convertible
[in]iorig_ssflag indicating if the original MODFLOW 6 specific storage formulation is being used
[in]iconf_ssflag indicating if specific storage only applies under confined conditions
[in]toptop of cell
[in]botbottom of cell
[in]rho1current specific storage capacity
[in]rho1oldprevious specific storage capacity
[in]snnewcurrent cell saturation
[in]snoldprevious cell saturation
[in]hnewcurrent head
[in]holdprevious head
[in,out]atermcoefficient matrix term
[in,out]rhstermright-hand side term
[in,out]ratecalculated specific storage rate

Definition at line 32 of file GwfStorageUtils.f90.

35  ! -- dummy variables
36  integer(I4B), intent(in) :: iconvert !< flag indicating if cell is convertible
37  integer(I4B), intent(in) :: iorig_ss !< flag indicating if the original MODFLOW 6 specific storage formulation is being used
38  integer(I4B), intent(in) :: iconf_ss !< flag indicating if specific storage only applies under confined conditions
39  real(DP), intent(in) :: top !< top of cell
40  real(DP), intent(in) :: bot !< bottom of cell
41  real(DP), intent(in) :: rho1 !< current specific storage capacity
42  real(DP), intent(in) :: rho1old !< previous specific storage capacity
43  real(DP), intent(in) :: snnew !< current cell saturation
44  real(DP), intent(in) :: snold !< previous cell saturation
45  real(DP), intent(in) :: hnew !< current head
46  real(DP), intent(in) :: hold !< previous head
47  real(DP), intent(inout) :: aterm !< coefficient matrix term
48  real(DP), intent(inout) :: rhsterm !< right-hand side term
49  real(DP), intent(inout), optional :: rate !< calculated specific storage rate
50  ! -- local variables
51  real(DP) :: tthk
52  real(DP) :: zold
53  real(DP) :: znew
54  !
55  ! -- initialize terms
56  aterm = -rho1 * snnew
57  rhsterm = dzero
58  !
59  ! -- calculate specific storage terms
60  if (iconvert /= 0) then
61  if (iorig_ss == 0) then
62  if (iconf_ss == 0) then
63  tthk = top - bot
64  zold = bot + dhalf * tthk * snold
65  znew = bot + dhalf * tthk * snnew
66  rhsterm = -rho1old * snold * (hold - zold) - rho1 * snnew * znew
67  else
68  if (snold == done) then
69  rhsterm = rhsterm - rho1old * (hold - top)
70  end if
71  if (snnew == done) then
72  rhsterm = rhsterm - rho1 * top
73  else
74  aterm = dzero
75  end if
76  end if
77  else
78  rhsterm = -rho1old * snold * hold
79  end if
80  else
81  rhsterm = -rho1old * snold * hold
82  end if
83  !
84  ! -- calculate rate
85  if (present(rate)) then
86  rate = aterm * hnew - rhsterm
87  end if
88  !
89  ! -- return
90  return
Here is the caller graph for this function:

◆ sycapacity()

pure real(dp) function, public gwfstorageutilsmodule::sycapacity ( real(dp), intent(in)  area,
real(dp), intent(in)  sy 
)

Function to calculate the specific yield capacity using the cell area and the specific yield.

Returns
sc2 specific yield capacity
Parameters
[in]areahorizontal cell area
[in]syspecific yield

Definition at line 178 of file GwfStorageUtils.f90.

179  ! -- dummy variables
180  real(DP), intent(in) :: area !< horizontal cell area
181  real(DP), intent(in) :: sy !< specific yield
182  ! -- local variables
183  real(DP) :: sc2
184  ! -- calculate specific yield capacity
185  sc2 = sy * area
186  !
187  ! -- return
188  return
Here is the caller graph for this function:

◆ syterms()

pure subroutine, public gwfstorageutilsmodule::syterms ( real(dp), intent(in)  top,
real(dp), intent(in)  bot,
real(dp), intent(in)  rho2,
real(dp), intent(in)  rho2old,
real(dp), intent(in)  snnew,
real(dp), intent(in)  snold,
real(dp), intent(inout)  aterm,
real(dp), intent(inout)  rhsterm,
real(dp), intent(inout), optional  rate 
)

Subroutine to calculate the specific yield storage terms for a cell using the cell geometry, current and previous specific yield storage capacity, and the current and previous cell saturation. Subroutine can optionally return the flow rate from specific yield.

Parameters
[in]toptop of cell
[in]botbottom of cell
[in]rho2current specific yield storage capacity
[in]rho2oldprevious specific yield storage capacity
[in]snnewcurrent cell saturation
[in]snoldprevious cell saturation
[in,out]atermcoefficient matrix term
[in,out]rhstermright-hand side term
[in,out]ratecalculated specific yield rate

Definition at line 101 of file GwfStorageUtils.f90.

103  ! -- dummy variables
104  real(DP), intent(in) :: top !< top of cell
105  real(DP), intent(in) :: bot !< bottom of cell
106  real(DP), intent(in) :: rho2 !< current specific yield storage capacity
107  real(DP), intent(in) :: rho2old !< previous specific yield storage capacity
108  real(DP), intent(in) :: snnew !< current cell saturation
109  real(DP), intent(in) :: snold !< previous cell saturation
110  real(DP), intent(inout) :: aterm !< coefficient matrix term
111  real(DP), intent(inout) :: rhsterm !< right-hand side term
112  real(DP), intent(inout), optional :: rate !< calculated specific yield rate
113  ! -- local variables
114  real(DP) :: tthk
115  !
116  ! -- initialize terms
117  aterm = dzero
118  tthk = top - bot
119  !
120  ! -- calculate specific yield storage terms
121  if (snnew < done) then
122  if (snnew > dzero) then
123  aterm = -rho2
124  rhsterm = -rho2old * tthk * snold - rho2 * bot
125  else
126  rhsterm = tthk * (dzero - rho2old * snold)
127  end if
128  ! -- known flow from specific yield
129  else
130  rhsterm = tthk * (rho2 * snnew - rho2old * snold)
131  end if
132  !
133  ! -- calculate rate
134  if (present(rate)) then
135  rate = rho2old * tthk * snold - rho2 * tthk * snnew
136  end if
137  !
138  ! -- return
139  return
Here is the caller graph for this function: