The coefficient combines the half-cell conductances of cells n and m, each using the effective dispersion normal to the shared face and the saturated flow area. Connections to inactive or unsaturated cells get a coefficient of zero.
24
27
28 class(DisBaseType) :: dis
29 integer(I4B), dimension(:), intent(in) :: ibdsat
30 real(DP), dimension(:), intent(in) :: sat
31 real(DP), dimension(:), intent(in) :: d11
32 real(DP), dimension(:), intent(in) :: d22
33 real(DP), dimension(:), intent(in) :: d33
34 real(DP), dimension(:), intent(in) :: angle1
35 real(DP), dimension(:), intent(in) :: angle2
36 real(DP), dimension(:), intent(in) :: angle3
37 real(DP), dimension(:), intent(inout) :: dispcoef
38
39 integer(I4B) :: nodes, n, m, ipos
40 real(DP) :: clnm, clmn, dn, dm
41 real(DP) :: vg1, vg2, vg3
42 integer(I4B) :: ihc, isympos
43 integer(I4B) :: iavgmeth
44 real(DP) :: satn, satm
45 real(DP) :: cond, cn, cm, denom
46 real(DP) :: hwva, anm, amn
47
48
49 iavgmeth = 1
50
51 nodes = size(d11)
52 do n = 1, nodes
53 if (ibdsat(n) == 0) cycle
54 do ipos = dis%con%ia(n) + 1, dis%con%ia(n + 1) - 1
55 m = dis%con%ja(ipos)
56 if (m < n) cycle
57 isympos = dis%con%jas(ipos)
58 dispcoef(isympos) = dzero
59 if (ibdsat(m) == 0) cycle
60
61 clnm = dis%con%cl1(isympos)
62 clmn = dis%con%cl2(isympos)
63 ihc = dis%con%ihc(isympos)
64 satn = sat(n)
65 satm = sat(m)
66
67
68 call dis%connection_normal(n, m, ihc, vg1, vg2, vg3, ipos)
69 dn =
hyeff(d11(n), d22(n), d33(n), &
70 angle1(n), angle2(n), angle3(n), &
71 vg1, vg2, vg3, iavgmeth)
72 dm =
hyeff(d11(m), d22(m), d33(m), &
73 angle1(m), angle2(m), angle3(m), &
74 vg1, vg2, vg3, iavgmeth)
75
76 hwva = dis%con%hwva(isympos)
77 anm =
flow_area(ihc, hwva, dis%top(n), dis%bot(n), satn, &
78 dis%top(m), dis%bot(m))
79 amn =
flow_area(ihc, hwva, dis%top(m), dis%bot(m), satm, &
80 dis%top(n), dis%bot(n))
81 if (ihc == 0) then
82 clnm = satn * (dis%top(n) - dis%bot(n)) * dhalf
83 clmn = satm * (dis%top(m) - dis%bot(m)) * dhalf
84
85
86
87 if (satn == dzero) then
88 anm = dzero
89 else if (n > m .and. satn < done) then
90 anm = dzero
91 end if
92 if (satm == dzero) then
93 anm = dzero
94 else if (m > n .and. satm < done) then
95 anm = dzero
96 end if
97 amn = anm
98 else
99
100 if (satn == dzero .or. satm == dzero) then
101 anm = dzero
102 amn = dzero
103 end if
104 end if
105
106
107 cn = dzero
108 if (clnm > dzero) cn = dn * anm / clnm
109 cm = dzero
110 if (clmn > dzero) cm = dm * amn / clmn
111 denom = cn + cm
112 if (denom > dzero) then
113 cond = cn * cm / denom
114 else
115 cond = dzero
116 end if
117 dispcoef(isympos) = cond
118 end do
119 end do
This module contains stateless conductance functions.
real(dp) function, public flow_area(ihc, hwva, top, bot, sat, topc, botc)
Calculate the saturated flow area of a cell for a connection.
General-purpose hydrogeologic functions.
real(dp) function, public hyeff(k11, k22, k33, ang1, ang2, ang3, vg1, vg2, vg3, iavgmeth)
Calculate the effective horizontal hydraulic conductivity from an ellipse using a specified direction...