import matplotlib.pyplot as plt import numpy as np from input_file import inputfile ''' inputfile(fluid,reservoir,numerical,BC,IC) #uploading all input properties def analytical(time,blocks): tol = 0.0001 x = np.arange(blocks)*dx + dx/2 P1 = 500-((D-reservoir.length*np.sin(dip*np.pi/180))*(rho/144))- 14.7; #based on boundary 500 psi at L P1 at pooint n check P0 = 0 alpha = 6.33E-3*k/(phi*u*ct) n = 0 SUM = 0 for i in range(10000000): new = (-1)**(n+1)*np.cos((n+1/2)*np.pi*x/Length)*np.exp(-(2*n+1)**2/Length**2*alpha*np.pi**2*time/4)/(2*n+1) SUM = 4/np.pi*(P1-P0)*new + SUM error=max(abs(new)); if error > tol: n = n +1 else: break P = SUM + p + P1 return P; ''' #fluid, reservoir and simulation parameters def post_process(P_plot, xc, time, nmax):
def __init__(self): self.Bw = [] class reservoir: def __init__(self): self.dt = [] class grid: def __init__(self): self.xmin = [] class BC: def __init__(self): self.xmin = [] class IC: def __init__(self): self.xmin = [] inputfile(fluid,reservoir,numerical,BC,IC) #uploading all input properties #Calculating the arrays [T, B, Q, G] = myarrays(fluid,reservoir,numerical,BC,IC) # time marching initialization time = 0 #initializing time n = 0 #time step initialization nmax = int(numerical.tfinal / numerical.dt) #total number of time steps time = np.zeros((nmax+1)) #initializing time vector P_plot = np.zeros((numerical.N, nmax+1)) #matrix to save pressure P = (IC.P).copy() #initializing iterable current pressure P_plot[:,n] = P[:,0] #saving initial pressure start = timer.clock() # time marching
#import inbuilt libraries import numpy as np #importing personal libraries from input_file import inputfile from rel_perm import rel_perm from petroplots import petroplots from cap_press import cap_press #making petrophysics class class petro: def __init__(self): self.Sor = [] inputfile(petro) #uploading petrophysical properties Sw = np.transpose([np.linspace(0,1,10000)]) #initializing water saturation as a column vector #Sw_actual = np.transpose([np.linspace(petro.Swr,1-petro.Sor,10000)]) #initializing water saturation krw = np.zeros((len(Sw),1)) #allocating column vector for relative permeability (water) kro = np.zeros((len(Sw),1)) #allocating column vector for relative permeability (oil) Pci = np.zeros((len(Sw),1)) #allocating column vector for imbibition capillary pressure [psi] Pcd = np.zeros((len(Sw),1)) #allocating column vector for drainage capillary pressure [psi] #evaluating relative permeabilities using Corey-Brooks model for j in range(0, len(Sw)): [krw[j], kro[j]] = rel_perm(petro,Sw[j,0]) [Pci[j], Pcd[j]] = cap_press(petro,Sw[j,0]) #plotting