Professional Documents
Culture Documents
Project Res - Sim - Assignment 5 2020 PDF
Project Res - Sim - Assignment 5 2020 PDF
𝑖 𝐸(𝑖, 𝑗 + 1, 𝑘)
𝑘 𝐴(𝑖, 𝑗, 𝑘
)
𝐵(𝑖 − 1, 𝑗, 𝑘) 𝐶(𝑖 + 1, 𝑗, 𝑘)
𝐷(𝑖, 𝑗 − 1, 𝑘)
𝐺(𝑖, 𝑗, 𝑘 + 1)
Since the block A trough E are in the same horizon, you do not have to worry about the
gravitational term (i.e. you just compare pressure). Also, we assume no capillary pressure,
and the relation for the oil phase holds for the gas phase. For block A, F, and G, you must
include the gravitational term and you must compare for the potentials for oil and water
phases, separately.
Make poten.f90 return 8 flags. (ibw(i,j,k), icw(i,j,k), idw(i,j,k),
iew(i,j,k), ifw(i,j,k), and igw(i,j,k) for water phase and ifo(i,j,k),
and igo(i,j,k) for oil phase) These flags must be set zero (0) if potential of block A is
higher and must be set one (1) if the potential of block A is lower than the individual block
potentials. For instance ifw(i,j,k) may be determine as:
:
do i=1,nx
do j=1,ny
do k=1,nz
! node B
!
! node C
!
! node D
!
! node E
!
! node F
!
ifw(i,j,k)=0
pkk=pk(i,j,k)
if (k>1) then
pkkm1=pk(i,j,k-1)
pka=0.5*(pkk+pkkm1)
dpkm1=pkkm1-pkk
dzkm1=depth(k-1)-depth(k)
potw=dpkm1-dnw(pka)*dzkm1
if(potw>0.0)ifw(i,j,k)=1
end if
! node G
!
! node F oil
!
! node G oil
!
enddo
enddo
enddo
implicit none
!
:
!
call init
!
do k=1,nz
do j=1,ny
do i=1,nx
if (i/=2*(i/2)) pk(i,j,k)=pk(i,j,k)+10.
if (j/=2*(j/2)) pk(i,j,k)=pk(i,j,k)+10.
if (k/=2*(k/2)) pk(i,j,k)=pk(i,j,k)+10.
enddo
enddo
enddo
!
call poten
!
do k=1,nz
do j=1,ny
do i=1,nx
n1=n1+ibw(i,j,k)+icw(i,j,k)+idw(i,j,k)+iew(i,j,k)
n2=n2+ifw(i,j,k)+igw(i,j,k)+ifo(i,j,k)+igo(i,j,k)
n3=n3+ibw(i,j,k)*igw(i,j,k)+icw(i,j,k)*ifw(i,j,k)
n4=n4+idw(i,j,k)*igo(i,j,k)+iew(i,j,k)*ifo(i,j,k)
enddo
enddo
enddo
Submit the source code poten.f90 and your solution for n1, n2, n3, and n4.
Also solution for:
ibw(1,2,3), icw(2,3,4), idw(4,3,2), iew(3,2,1),
ifw(5,1,5), igw(4,2,4), ifw(3,3,3), igw(2,2,2).