23 integer(I4B) :: ipv, ipv1, ipv2, ipv3, ipv4
24 integer(I4B),
dimension(4) :: ipvnxt = (/2, 3, 4, 1/)
25 real(dp) :: x1, y1, x2, y2, x4, y4
26 real(dp) :: dx2, dy2, dx4, dy4, areax, areay, areaz
27 real(dp) :: xorigin, yorigin, zorigin, dx, dy, dz, sinrot, cosrot
28 real(dp) :: factor, term
48 x4 = defn%polyvert(1, ipv4)
49 y4 = defn%polyvert(2, ipv4)
50 x1 = defn%polyvert(1, ipv1)
51 y1 = defn%polyvert(2, ipv1)
54 x2 = defn%polyvert(1, ipv2)
56 y2 = defn%polyvert(2, ipv2)
59 else if (y1 .ge. y4)
then
61 y2 = defn%polyvert(2, ipv2)
63 x2 = defn%polyvert(1, ipv2)
80 dx = dsqrt(dx4 * dx4 + dy4 * dy4)
81 dy = dsqrt(dx2 * dx2 + dy2 * dy2)
82 dz = defn%top - zorigin
91 rect%xOrigin = xorigin
92 rect%yOrigin = yorigin
93 rect%zOrigin = zorigin
100 factor =
done / (defn%retfactor * defn%porosity)
101 term = factor / areax
102 rect%vx1 = defn%faceflow(ipv1) * term
103 rect%vx2 = -defn%faceflow(ipv3) * term
104 term = factor / areay
105 rect%vy1 = defn%faceflow(ipv4) * term
106 rect%vy2 = -defn%faceflow(ipv2) * term
107 term = factor / areaz
108 rect%vz1 = defn%faceflow(6) * term
109 rect%vz2 = -defn%faceflow(7) * term
122 integer(I4B) :: i, irv, isc
123 real(dp) :: qhalf, qdisttopbot, q1, q2, q4
126 call quad%init_from(poly%defn)
132 quad%irvOrigin = quad%get_rect_ivert_sw()
133 call quad%get_rect_dim_rot()
139 if (.not. quad%face_is_refined(irv))
then
140 qhalf = 5d-1 * quad%get_rect_flow(1, irv)
141 quad%qextl2(isc) = qhalf
143 quad%qextl1(isc) = qhalf
145 quad%qextl2(isc) = quad%get_rect_flow(1, irv)
147 quad%qextl1(isc) = quad%get_rect_flow(2, irv)
150 qdisttopbot = 2.5d-1 * (quad%defn%get_distflow() &
151 + quad%defn%get_botflow() &
152 + quad%defn%get_topflow())
153 q1 = qdisttopbot + quad%qextl1(1) + quad%qextl2(1)
154 q2 = qdisttopbot + quad%qextl1(2) + quad%qextl2(2)
155 q4 = qdisttopbot + quad%qextl1(4) + quad%qextl2(4)
156 quad%qintl(1) = -5d-1 * (q1 + 5d-1 * (q2 - q4))
157 quad%qintl(2) = quad%qintl(1) + q1
158 quad%qintl(3) = quad%qintl(2) + q2
159 quad%qintl(4) = quad%qintl(1) - q4
160 quad%qintl(5) = quad%qintl(1)
subroutine, public create_cell_rect(cell)
Create a new rectangular cell.
subroutine, public create_cell_rect_quad(cell)
Create a new rectangular-quad cell.
subroutine, public cell_poly_to_rect(poly, rect)
Convert CellPoly representation to CellRect. Assumes the conversion is possible.
subroutine, public cell_poly_to_quad(poly, quad)
Convert CellPoly representation to CellRectQuad. Assumes the conversion is possible.
This module contains simulation constants.
real(dp), parameter done
real constant 1
This module defines variable data types.
Base grid cell definition.