MODFLOW 6 version 6.9.0.dev0
USGS Modular Hydrologic Model
Loading...
Searching...
No Matches
tvdschememodule Module Reference

Data Types

interface  tvdschemetype

Functions/Subroutines

type(tvdschemetype) function constructor (dis, fmi, ibound)
subroutine set_field (this, phi)
 Set the scalar field for which interpolation will be computed.
type(coefficientstype) function, target compute (this, n, m, iposnm)

Function/Subroutine Documentation

◆ compute()

type(coefficientstype) function, target tvdschememodule::compute ( class(tvdschemetype), target this,
integer(i4b), intent(in) n,
integer(i4b), intent(in) m,
integer(i4b), intent(in) iposnm )
private

Definition at line 57 of file TVDScheme.f90.

58 !-- return
59 type(CoefficientsType), target :: phi_face
60 ! -- dummy
61 class(TVDSchemeType), target :: this
62 integer(I4B), intent(in) :: n
63 integer(I4B), intent(in) :: m
64 integer(I4B), intent(in) :: iposnm
65 ! -- local
66 integer(I4B) :: ipos, isympos, iup, idn, i2up, j
67 real(DP) :: qnm, qmax, qupj, elupdn, elup2up
68 real(DP) :: smooth, cdiff, alimiter
69 real(DP), pointer :: coef_up, coef_dn
70 !
71 ! -- Find upstream node
72 isympos = this%dis%con%jas(iposnm)
73 qnm = this%fmi%gwfflowja(iposnm)
74 if (qnm > dzero) then
75 ! -- positive flow into n means m is upstream
76 iup = m
77 idn = n
78
79 coef_up => phi_face%c_m
80 coef_dn => phi_face%c_n
81 else
82 iup = n
83 idn = m
84
85 coef_up => phi_face%c_n
86 coef_dn => phi_face%c_m
87 end if
88 elupdn = this%dis%con%cl1(isympos) + this%dis%con%cl2(isympos)
89 !
90 ! -- Add low order terms
91 coef_up = done
92 !
93 ! -- Add high order terms
94 !
95 ! -- Find second node upstream to iup
96 i2up = 0
97 qmax = dzero
98 do ipos = this%dis%con%ia(iup) + 1, this%dis%con%ia(iup + 1) - 1
99 j = this%dis%con%ja(ipos)
100 if (this%ibound(j) == 0) cycle
101 qupj = this%fmi%gwfflowja(ipos)
102 isympos = this%dis%con%jas(ipos)
103 if (qupj > qmax) then
104 qmax = qupj
105 i2up = j
106 elup2up = this%dis%con%cl1(isympos) + this%dis%con%cl2(isympos)
107 end if
108 end do
109 !
110 ! -- Calculate flux limiting term
111 if (i2up > 0) then
112 smooth = dzero
113 cdiff = abs(this%phi(idn) - this%phi(iup))
114 if (cdiff > dprec) then
115 smooth = (this%phi(iup) - this%phi(i2up)) / elup2up * &
116 elupdn / (this%phi(idn) - this%phi(iup))
117 end if
118 if (smooth > dzero) then
119 alimiter = dtwo * smooth / (done + smooth)
120 phi_face%rhs = -dhalf * alimiter * (this%phi(idn) - this%phi(iup))
121 end if
122 end if
123

◆ constructor()

type(tvdschemetype) function tvdschememodule::constructor ( class(disbasetype), intent(in), pointer dis,
type(tspfmitype), intent(in), pointer fmi,
integer(i4b), dimension(:), intent(in), pointer, contiguous ibound )
private

Definition at line 30 of file TVDScheme.f90.

31 ! -- return
32 type(TVDSchemeType) :: interpolation_scheme
33 ! --dummy
34 class(DisBaseType), pointer, intent(in) :: dis
35 type(TspFmiType), pointer, intent(in) :: fmi
36 integer(I4B), dimension(:), pointer, contiguous, intent(in) :: ibound
37
38 interpolation_scheme%dis => dis
39 interpolation_scheme%fmi => fmi
40 interpolation_scheme%ibound => ibound
41
Here is the caller graph for this function:

◆ set_field()

subroutine tvdschememodule::set_field ( class(tvdschemetype), target this,
real(dp), dimension(:), intent(in), pointer phi )
private

This method establishes a pointer to the scalar field data for subsequent TVD interpolation computations.

Definition at line 49 of file TVDScheme.f90.

50 ! -- dummy
51 class(TVDSchemeType), target :: this
52 real(DP), intent(in), dimension(:), pointer :: phi
53
54 this%phi => phi