22 integer :: ipv, ipv1, ipv2, ipv3, ipv4
23 integer,
dimension(4) :: ipvnxt = (/2, 3, 4, 1/)
24 double precision :: x1, y1, x2, y2, x4, y4
25 double precision :: dx2, dy2, dx4, dy4, areax, areay, areaz
26 double precision :: xorigin, yorigin, zorigin, dx, dy, dz, sinrot, cosrot
27 double precision :: factor, term
49 x4 = defn%polyvert(1, ipv4)
50 y4 = defn%polyvert(2, ipv4)
51 x1 = defn%polyvert(1, ipv1)
52 y1 = defn%polyvert(2, ipv1)
55 x2 = defn%polyvert(1, ipv2)
57 y2 = defn%polyvert(2, ipv2)
60 else if (y1 .ge. y4)
then
62 y2 = defn%polyvert(2, ipv2)
64 x2 = defn%polyvert(1, ipv2)
81 dx = dsqrt(dx4 * dx4 + dy4 * dy4)
82 dy = dsqrt(dx2 * dx2 + dy2 * dy2)
83 dz = defn%top - zorigin
92 rect%xOrigin = xorigin
93 rect%yOrigin = yorigin
94 rect%zOrigin = zorigin
101 factor =
done / (defn%retfactor * defn%porosity)
102 term = factor / areax
103 rect%vx1 = defn%faceflow(ipv1) * term
104 rect%vx2 = -defn%faceflow(ipv3) * term
105 term = factor / areay
106 rect%vy1 = defn%faceflow(ipv4) * term
107 rect%vy2 = -defn%faceflow(ipv2) * term
108 term = factor / areaz
109 rect%vz1 = defn%faceflow(6) * term
110 rect%vz2 = -defn%faceflow(7) * term
122 integer :: i, irv, isc
123 double precision :: qhalf, qdisttopbot, q1, q2, q4
126 call quad%init_from(poly%defn)
133 quad%irvOrigin = quad%get_irectvertSW()
134 call quad%get_rectDimensionsRotation( &
135 quad%irvOrigin, quad%xOrigin, &
136 quad%yOrigin, quad%zOrigin, &
138 quad%dz, quad%sinrot, &
145 if (.not. quad%face_is_refined(irv))
then
146 qhalf = 5d-1 * quad%get_rectflow(1, irv)
147 quad%qextl2(isc) = qhalf
149 quad%qextl1(isc) = qhalf
151 quad%qextl2(isc) = quad%get_rectflow(1, irv)
153 quad%qextl1(isc) = quad%get_rectflow(2, irv)
156 qdisttopbot = 2.5d-1 * (quad%defn%get_distflow() &
157 + quad%defn%get_botflow() &
158 + quad%defn%get_topflow())
159 q1 = qdisttopbot + quad%qextl1(1) + quad%qextl2(1)
160 q2 = qdisttopbot + quad%qextl1(2) + quad%qextl2(2)
161 q4 = qdisttopbot + quad%qextl1(4) + quad%qextl2(4)
162 quad%qintl(1) = -5d-1 * (q1 + 5d-1 * (q2 - q4))
163 quad%qintl(2) = quad%qintl(1) + q1
164 quad%qintl(3) = quad%qintl(2) + q2
165 quad%qintl(4) = quad%qintl(1) - q4
166 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 if possible.
subroutine, public cell_poly_to_quad(poly, quad)
Convert CellPoly representation to CellRectQuad if possible.
This module contains simulation constants.
real(dp), parameter done
real constant 1
Base grid cell definition.