def run_radial_simul(self, my_front_reconstruction, my_front_advancement, my_vertex_or_path, my_param): # setting up the verbosity level of the log at console # setup_logging_to_console(verbosity_level='error') outputfolder = "./Temp_Data/" + my_vertex_or_path + "_radial_" + my_front_advancement + "_" + my_front_reconstruction self.remove(outputfolder) # creating mesh Mesh = CartesianMesh(my_param['Lx'], my_param['Ly'], my_param['Nx'], my_param['Ny']) # solid properties nu = my_param['nu'] # Poisson's ratio youngs_mod = my_param['youngs_mod'] # Young's modulus Eprime = youngs_mod / (1 - nu**2) # plain strain modulus K_Ic = my_param['K_Ic'] # fracture toughness Cl = my_param['Cl'] # Carter's leak off coefficient # material properties Solid = MaterialProperties(Mesh, Eprime, K_Ic, Carters_coef=Cl) # injection parameters Q0 = my_param['Q0'] # injection rate Injection = InjectionProperties(Q0, Mesh) # fluid properties Fluid = FluidProperties(viscosity=my_param['viscosity']) # simulation properties simulProp = SimulationProperties() simulProp.finalTime = my_param[ 'finalTime'] # the time at which the simulation stops simulProp.set_tipAsymptote( my_vertex_or_path ) # tip asymptote is evaluated with the viscosity dominated assumption simulProp.frontAdvancing = my_front_advancement # to set explicit front tracking simulProp.plotFigure = False simulProp.set_solTimeSeries(np.asarray([2, 200, 5000, 30000, 100000])) simulProp.saveTSJump, simulProp.plotTSJump = 5, 5 # save and plot after every five time steps simulProp.set_outputFolder(outputfolder) simulProp.projMethod = my_front_reconstruction simulProp.log2file = False # initialization parameters Fr_geometry = Geometry('radial', radius=my_param['initialR']) init_param = InitializationParameters(Fr_geometry, regime=my_vertex_or_path) # creating fracture object Fr = Fracture(Mesh, init_param, Solid, Fluid, Injection, simulProp) # create a Controller controller = Controller(Fr, Solid, Fluid, Injection, simulProp) # run the simulation exitcode = controller.run() return exitcode, outputfolder
def test_toepliz_get_submatrix_hy_noteq_hx_and_nx_eq_ny(): # Mesh hx!=hy, nx=ny Mesh = CartesianMesh(1.4, 1.6, 19, 19) # old way C = load_isotropic_elasticity_matrix(Mesh, Ep) # new way C_obj = load_isotropic_elasticity_matrix_toepliz(Mesh, Ep) slice = np.asarray(range(Mesh.NumberOfElts)) C_new = C_obj[np.ix_(slice, slice)] common_test_for_all_toepliz_tests(C, C_new, expect_simmetric=True)
def get_HF_analytical_solution_at_point(regime, variable, point, mat_prop, inj_prop, fluid_prop=None, time_srs=None, length_srs=None, h=None, samp_cell=None, gamma=None): values_point = [] if time_srs is not None: srs_length = len(time_srs) else: srs_length = len(length_srs) from mesh import CartesianMesh if point[0] == 0.: mesh_Lx = 1. else: mesh_Lx = 2 * abs(point[0]) if point[1] == 0.: mesh_Ly = 1. else: mesh_Ly = 2 * abs(point[1]) mesh = CartesianMesh(mesh_Lx, mesh_Ly, 5, 5) for i in range(srs_length): if time_srs is not None: time = [time_srs[i]] else: time = None if length_srs is not None: length = [length_srs[i]] else: length = None value_mesh, mesh_list = get_HF_analytical_solution(regime, variable, mat_prop, inj_prop, mesh=mesh, fluid_prop=fluid_prop, time_srs=time, length_srs=length, h=h, samp_cell=samp_cell, gamma=gamma) if variable in ['front_dist_min', 'd_min', 'front_dist_max', 'd_max', 'front_dist_mean', 'd_mean', 'radius', 'r', 't', 'time']: values_point.append(value_mesh[0]) elif point == [0., 0.]: values_point.append(value_mesh[0][mesh_list[0].CenterElts]) else: value_point = value_mesh[0][18] values_point.append(value_point) return values_point
def test_toepliz_get_submatrix_same_dim(): Mesh = CartesianMesh(0.45, 0.6, 39, 49) # old way C = load_isotropic_elasticity_matrix(Mesh, Ep) # new way C_obj = load_isotropic_elasticity_matrix_toepliz(Mesh, Ep) xslice = np.asarray([33, 55, 66]) yslice = np.asarray([27, 12, 41]) C_new_sliced = C_obj[np.ix_(xslice, yslice)] C_sliced = C[np.ix_(xslice, yslice)] common_test_for_all_toepliz_tests(C_sliced, C_new_sliced, expect_simmetric=False)
def run(self): """ This function runs the simulation according to the parameters given in the properties classes. See especially the documentation of the :py:class:`properties.SimulationProperties` class to get details of the parameters controlling the simulation run. """ # output initial fracture if self.sim_prop.saveToDisk: # save properties if not os.path.exists(self.sim_prop.get_outputFolder()): os.makedirs(self.sim_prop.get_outputFolder()) prop = (self.solid_prop, self.fluid_prop, self.injection_prop, self.sim_prop) with open(self.sim_prop.get_outputFolder() + "properties", 'wb') as output: dill.dump(prop, output, -1) if self.sim_prop.plotFigure or self.sim_prop.saveToDisk: # save or plot fracture self.output(self.fracture) self.lastSavedTime = self.fracture.time if self.sim_prop.saveToDisk: if os.path.exists(self.logAddress + "log.txt"): os.remove(self.logAddress + "log.txt") with open(self.logAddress + 'log.txt', 'w+') as file: file.writelines('log file, simulation run at: ' + strftime("%Y-%m-%d %H:%M:%S", gmtime()) + '\n\n') # load elasticity matrix if self.C is None: print("Making elasticity matrix...") if self.sim_prop.symmetric: if not self.sim_prop.get_volumeControl(): raise ValueError( "Symmetric fracture is only supported for inviscid fluid yet!" ) if not self.solid_prop.TI_elasticity: if self.sim_prop.symmetric: self.C = load_isotropic_elasticity_matrix_symmetric( self.fracture.mesh, self.solid_prop.Eprime) else: self.C = load_isotropic_elasticity_matrix( self.fracture.mesh, self.solid_prop.Eprime) else: C = load_TI_elasticity_matrix(self.fracture.mesh, self.solid_prop, self.sim_prop) # compressing the elasticity matrix for symmetric fracture if self.sim_prop.symmetric: self.C = symmetric_elasticity_matrix_from_full( C, self.fracture.mesh) else: self.C = C print('Done!') # # perform first time step with implicit front advancing due to non-availability of velocity # if not self.sim_prop.symmetric: # if self.sim_prop.frontAdvancing == "predictor-corrector": # self.sim_prop.frontAdvancing = "implicit" print("Starting time = " + repr(self.fracture.time)) # starting time stepping loop while self.fracture.time < 0.999 * self.sim_prop.finalTime and self.TmStpCount < self.sim_prop.maxTimeSteps: timeStep = self.get_time_step() if self.sim_prop.collectPerfData: tmStp_perf = IterationProperties(itr_type="time step") else: tmStp_perf = None # advancing time step status, Fr_n_pls1 = self.advance_time_step(self.fracture, self.C, timeStep, tmStp_perf) if self.sim_prop.collectPerfData: tmStp_perf.CpuTime_end = time.time() tmStp_perf.status = status == 1 tmStp_perf.failure_cause = self.errorMessages[status] tmStp_perf.time = self.fracture.time tmStp_perf.NumbOfElts = len(self.fracture.EltCrack) self.perfData.append(tmStp_perf) if status == 1: # Successful time step print("Time step successful!") self.delta_w = Fr_n_pls1.w - self.fracture.w self.lstTmStp = Fr_n_pls1.time - self.fracture.time # output if self.sim_prop.plotFigure or self.sim_prop.saveToDisk: if Fr_n_pls1.time > self.lastSavedTime: self.output(Fr_n_pls1) # add the advanced fracture to the last five fractures list self.fracture = copy.deepcopy(Fr_n_pls1) self.fr_queue[self.successfulTimeSteps % 5] = copy.deepcopy(Fr_n_pls1) if self.fracture.time > self.lastSuccessfulTS: self.lastSuccessfulTS = self.fracture.time if self.maxTmStp < self.lstTmStp: self.maxTmStp = self.lstTmStp # put check point reattempts to zero if the simulation has advanced past the time where it failed if Fr_n_pls1.time > self.lastSuccessfulTS + 2 * self.maxTmStp: self.chkPntReattmpts = 0 # set the prefactor to the original value after four time steps (after the 5 time steps back jump) self.sim_prop.tmStpPrefactor = self.tmStpPrefactor_copy self.successfulTimeSteps += 1 # resetting the parameters for closure if self.fullyClosed: # set to solve for pressure if the fracture was fully closed in last time step and is open now self.sim_prop.solveDeltaP = False else: self.sim_prop.solveDeltaP = self.solveDetlaP_cp self.PstvInjJmp = None self.fullyClosed = False # set front advancing back as set in simulation properties originally if velocity becomes available. if np.max(Fr_n_pls1.v) > 0 or not np.isnan(Fr_n_pls1.v).any(): self.sim_prop.frontAdvancing = copy.copy( self.frontAdvancing) else: self.sim_prop.frontAdvancing = 'implicit' if self.TmStpCount == self.sim_prop.maxTimeSteps: print("Max time steps reached!") elif status == 12: # re-meshing required if self.sim_prop.enableRemeshing: self.C *= 1 / self.sim_prop.remeshFactor print("Remeshing...") coarse_mesh = CartesianMesh( self.sim_prop.remeshFactor * self.fracture.mesh.Lx, self.sim_prop.remeshFactor * self.fracture.mesh.Ly, self.fracture.mesh.nx, self.fracture.mesh.ny, symmetric=self.sim_prop.symmetric) self.solid_prop.remesh(coarse_mesh) self.injection_prop.remesh(coarse_mesh, self.fracture.mesh) self.fracture = self.fracture.remesh( self.sim_prop.remeshFactor, self.C, coarse_mesh, self.solid_prop, self.fluid_prop, self.injection_prop, self.sim_prop) # update the saved properties if self.sim_prop.saveToDisk: prop = (self.solid_prop, self.fluid_prop, self.injection_prop, self.sim_prop) with open( self.sim_prop.get_outputFolder() + "properties", 'wb') as output: dill.dump(prop, output, -1) self.remeshings += 1 print("Done!") self.write_to_log("\nRemeshed at " + repr(self.fracture.time)) else: print("Reached end of the domain. Exiting...") break elif status == 14: # fracture fully closed self.output(Fr_n_pls1) if self.PstvInjJmp is None: inp = input( "Fracture is fully closed.\n\nDo you want to jump to" " the time of next positive injection? [y/n]") while inp not in ['y', 'Y', 'n', 'N']: inp = input("Press y or n") if inp is 'y' or inp is 'Y': self.PstvInjJmp = True else: self.PstvInjJmp = False if self.PstvInjJmp: self.sim_prop.solveDeltaP = False # index of current time in the time series (first row) of the injection rate array time_larger = np.where( Fr_n_pls1.time <= self.injection_prop.injectionRate[ 0, :])[0] pos_inj = np.where( self.injection_prop.injectionRate[1, :] > 0)[0] after_time = np.intersect1d(time_larger, pos_inj) if len(after_time) == 0: print("Positive injection not found!") break jump_to = min(self.injection_prop.injectionRate[ 0, np.intersect1d(time_larger, pos_inj)]) Fr_n_pls1.time = jump_to elif inp is 'n' or inp is 'N': self.sim_prop.solveDeltaP = True self.fullyClosed = True self.fracture = copy.deepcopy(Fr_n_pls1) else: # time step failed self.write_to_log("\n" + self.errorMessages[status]) self.write_to_log("\nTime step failed at = " + repr(self.fracture.time)) # check if the queue with last 5 time steps is not empty, or max check points jumps done if self.fr_queue[self.successfulTimeSteps % 5] is None or \ self.chkPntReattmpts == 4: if self.sim_prop.collectPerfData: if self.sim_prop.saveToDisk: file_address = self.sim_prop.get_outputFolder( ) + "perf_data.dat" else: file_address = "./perf_data.dat" with open(file_address, 'wb') as perf_output: dill.dump(self.perfData, perf_output, -1) self.write_to_log("\n\n---Simulation failed---") raise SystemExit("Simulation failed.") else: # decrease time step pre-factor before taking the next fracture in the queue having last # five time steps if isinstance(self.sim_prop.tmStpPrefactor, np.ndarray): indxCurTime = max( np.where(self.fracture.time >= self.sim_prop.tmStpPrefactor[0, :])[0]) self.sim_prop.tmStpPrefactor[1, indxCurTime] *= 0.8 current_PreFctr = self.sim_prop.tmStpPrefactor[ 1, indxCurTime] else: self.sim_prop.tmStpPrefactor *= 0.8 current_PreFctr = self.sim_prop.tmStpPrefactor self.chkPntReattmpts += 1 self.fracture = copy.deepcopy( self.fr_queue[(self.successfulTimeSteps + self.chkPntReattmpts) % 5]) print( "Time step have failed despite of reattempts with slightly smaller/bigger time steps...\n" "Going " + repr(5 - self.chkPntReattmpts) + " time steps back and re-attempting with the" " time step pre-factor of " + repr(current_PreFctr)) self.write_to_log("\nTime step have failed. Going " + repr(6 - self.chkPntReattmpts) + " time steps" " back...\n") self.failedTimeSteps += 1 self.TmStpCount += 1 self.write_to_log("\n\n-----Simulation finished------") self.write_to_log("\n\nnumber of time steps = " + repr(self.successfulTimeSteps)) self.write_to_log("\nfailed time steps = " + repr(self.failedTimeSteps)) self.write_to_log("\nnumber of remeshings = " + repr(self.remeshings)) plt.show(block=False) plt.close('all') if self.sim_prop.collectPerfData: file_address = self.sim_prop.get_outputFolder() + "perf_data.dat" os.makedirs(os.path.dirname(file_address), exist_ok=True) with open(file_address, 'wb') as output: dill.dump(self.perfData, output, -1) print("\nFinal time = " + repr(self.fracture.time)) print("\n\n-----Simulation finished------") print("See log file for details\n\n")
import numpy as np import os # local imports from mesh import CartesianMesh from properties import MaterialProperties, FluidProperties, InjectionProperties, SimulationProperties from controller import Controller from fracture import Fracture from fracture_initialization import Geometry, InitializationParameters from utility import setup_logging_to_console # setting up the verbosity level of the log at console setup_logging_to_console(verbosity_level='info') # creating mesh Mesh = CartesianMesh(.75, .75, 41, 41) # solid properties nu = 0.15 # Poisson's ratio youngs_mod = 3e10 # Young's modulus Eprime = youngs_mod / (1 - nu**2) # plain strain modulus K_Ic = 2e6 # fracture toughness sigma0 = 15e6 # confining stress # material properties Solid = MaterialProperties(Mesh, Eprime, K_Ic, Carters_coef=1e-6, confining_stress=sigma0, minimum_width=1e-5)
# imports import os # local imports from mesh import CartesianMesh from properties import MaterialProperties, FluidProperties, InjectionProperties, SimulationProperties from fracture import Fracture from controller import Controller from fracture_initialization import Geometry, InitializationParameters from utility import setup_logging_to_console # setting up the verbosity level of the log at console setup_logging_to_console(verbosity_level='info') # creating mesh Mesh = CartesianMesh(20, 2.3, 125, 35) # solid properties nu = 0.4 # Poisson's ratio youngs_mod = 3.3e10 # Young's modulus Eprime = youngs_mod / (1 - nu ** 2) # plain strain modulus K_Ic = 0 # fracture toughness of the material def sigmaO_func(x, y): """ The function providing the confining stress""" if abs(y) > 3: return 7.5e6 else: return 1e6 Solid = MaterialProperties(Mesh,
# imports import os # local imports from mesh import CartesianMesh from properties import MaterialProperties, FluidProperties, InjectionProperties, SimulationProperties from fracture import Fracture from controller import Controller from fracture_initialization import Geometry, InitializationParameters from utility import setup_logging_to_console # setting up the verbosity level of the log at console setup_logging_to_console(verbosity_level='info') # creating mesh Mesh = CartesianMesh(50, 50, 41, 41) # solid properties nu = 0.4 # Poisson's ratio youngs_mod = 3.3e10 # Young's modulus Eprime = youngs_mod / (1 - nu**2) # plain strain modulus K1c = 0 # zero toughness case Cl = 0.5e-6 # Carter's leak off coefficient # material properties Solid = MaterialProperties(Mesh, Eprime, K1c, Carters_coef=Cl, minimum_width=1e-12)
import numpy as np # local imports from mesh import CartesianMesh from properties import MaterialProperties, FluidProperties, InjectionProperties, SimulationProperties from fracture import Fracture from controller import Controller from fracture_initialization import Geometry, InitializationParameters from utility import setup_logging_to_console # setting up the verbosity level of the log at console setup_logging_to_console(verbosity_level='info') # creating mesh Mesh = CartesianMesh(0.5, 0.5, 41, 41) # solid properties nu = 0.4 # Poisson's ratio youngs_mod = 3.3e10 # Young's modulus Eprime = youngs_mod / (1 - nu**2) # plain strain modulus K1c = 1e6 # Fracture toughness Cl = 5.875e-6 # Carter's leak off coefficient # material properties Solid = MaterialProperties(Mesh, Eprime, K1c, Carters_coef=Cl) # injection parameters Q0 = 0.01 # injection rate Injection = InjectionProperties(Q0, Mesh)
Copyright (c) "ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE, Switzerland, Geo-Energy Laboratory", 2016-2019. All rights reserved. See the LICENSE.TXT file for more details. """ import numpy as np # local imports from mesh import CartesianMesh from properties import MaterialProperties, FluidProperties, InjectionProperties, SimulationProperties from fracture import Fracture from controller import Controller from fracture_initialization import Geometry, InitializationParameters from elasticity import load_isotropic_elasticity_matrix # creating mesh Mesh = CartesianMesh(500, 1500, 61, 141) # solid properties nu = 0.25 # Poisson's ratio youngs_mod = 20e9 # Young's modulus Eprime = youngs_mod / (1 - nu**2) # plain strain modulus def sigmaO_func(x, y): """ This function provides the confining stress over the domain""" density_high = 2700 density_low = 2400 #layer = 1000 Ly = 2800 #if y > layer: #return (Ly - y) * density_low * 9.8
import numpy as np import os # local imports from mesh import CartesianMesh from properties import MaterialProperties, FluidProperties, InjectionProperties, SimulationProperties from fracture import Fracture from controller import Controller from fracture_initialization import Geometry, InitializationParameters from utility import setup_logging_to_console # setting up the verbosity level of the log at console setup_logging_to_console(verbosity_level='info') # creating mesh Mesh = CartesianMesh(2, 2, 41, 41) # solid properties nu = 0.4 # Poisson's ratio youngs_mod = 3.3e10 # Young's modulus Eprime = youngs_mod / (1 - nu**2) # plain strain modulus K1c = 0 # Zero toughness case # material properties Solid = MaterialProperties(Mesh, Eprime, K1c) # injection parameters Q0 = np.asarray([[0.0, 50], [0.01, 0]]) # injection rate Injection = InjectionProperties(Q0, Mesh)
# imports import os # local imports from mesh import CartesianMesh from properties import MaterialProperties, FluidProperties, InjectionProperties, SimulationProperties from fracture import Fracture from controller import Controller from fracture_initialization import Geometry, InitializationParameters from utility import setup_logging_to_console # setting up the verbosity level of the log at console setup_logging_to_console(verbosity_level='info') # creating mesh Mesh = CartesianMesh(2.75, 2.4, 17, 35) # solid properties nu = 0.4 # Poisson's ratio youngs_mod = 3.3e10 # Young's modulus Eprime = youngs_mod / (1 - nu**2) # plain strain modulus K_Ic = 0 # fracture toughness of the material def sigmaO_func(x, y): """ The function providing the confining stress""" if abs(y) > 3: return 7.5e6 else: return 1e6
from fracture import Fracture from controller import Controller from fracture_initialization import Geometry, InitializationParameters from utility import setup_logging_to_console # imports import numpy as np from scipy import interpolate import os # setting up the verbosity level of the log at console setup_logging_to_console(verbosity_level='info') # creating mesh Mesh = CartesianMesh(0.6, 0.6, 41, 41) # solid properties Eprime = 10e9 # plain strain modulus Kprime = 3.19e6 K_Ic = Kprime / (4 * np.sqrt(2 / np.pi)) # fracture toughness # material properties Solid = MaterialProperties(Mesh, Eprime, K_Ic) Q0 = 0.005 Injection = InjectionProperties(Q0, Mesh) # fluid properties
import numpy as np import os # local imports from mesh import CartesianMesh from properties import MaterialProperties, FluidProperties, InjectionProperties, SimulationProperties from fracture import Fracture from controller import Controller from fracture_initialization import Geometry, InitializationParameters from utility import setup_logging_to_console # setting up the verbosity level of the log at console setup_logging_to_console(verbosity_level='info') # creating mesh Mesh = CartesianMesh(0.15, [-0.175, 0.05], 47, 71) # solid properties nu = 0.4 # Poisson's ratio youngs_mod = 3.3e9 # Young's modulus Eprime = youngs_mod / (1 - nu**2) # plain strain modulus def sigmaO_func(x, y): """ The function providing the confining stress""" if y > 0.025: return 11.2e6 elif y < -0.025: return 5.0e6 else: return 7.0e6
Created by Haseeb Zia on Fri March 13 2018. Copyright (c) "ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE, Switzerland, Geo-Energy Laboratory", 2016-2019. All rights reserved. See the LICENSE.TXT file for more details. """ import numpy as np # local imports from mesh import CartesianMesh from properties import MaterialProperties, FluidProperties, InjectionProperties, SimulationProperties from fracture import Fracture from controller import Controller from fracture_initialization import Geometry, InitializationParameters # creating mesh Mesh = CartesianMesh(0.065, 0.085, 31, 41) # solid properties nu = 0.4 # Poisson's ratio youngs_mod = 3.3e9 # Young's modulus Eprime = youngs_mod / (1 - nu**2) # plain strain modulus def sigmaO_func(x, y): """ The function providing the confining stress""" if y > 0.025: return 11.2e6 elif y < -0.025: return 5.0e6 else: return 7.0e6
This file is part of PyFrac. Created by Haseeb Zia on Fri June 16 17:49:21 2017. Copyright (c) "ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE, Switzerland, Geo-Energy Laboratory", 2016-2019. All rights reserved. See the LICENSE.TXT file for more details. """ # local imports from mesh import CartesianMesh from properties import MaterialProperties, FluidProperties, InjectionProperties, SimulationProperties from fracture import Fracture from controller import Controller from fracture_initialization import Geometry, InitializationParameters # creating mesh Mesh = CartesianMesh(0.3, 0.3, 41, 41, symmetric=True) # solid properties nu = 0.4 # Poisson's ratio youngs_mod = 3.3e10 # Young's modulus Eprime = youngs_mod / (1 - nu**2) # plain strain modulus K_Ic = 1e6 # fracture toughness Solid = MaterialProperties(Mesh, Eprime, K_Ic) # injection parameters Q0 = 0.001 # injection rate Injection = InjectionProperties(Q0, Mesh) # fluid properties Fluid = FluidProperties(viscosity=0)
def get_HF_analytical_solution(regime, variable, mat_prop, inj_prop, mesh=None, fluid_prop=None, time_srs=None, length_srs=None, h=None, samp_cell=None, gamma=None): if time_srs is None and length_srs is None: raise ValueError('Either time series or lengths series is to be provided.') if regime is 'E_K': Kc_1 = mat_prop.Kc1 else: Kc_1 = None if regime is 'E_E': Cij = mat_prop.Cij else: Cij = None if regime is 'MDR': density = fluid_prop.density else: density = None if regime in ['M', 'MDR', 'Mt', 'PKN']: if fluid_prop is None: raise ValueError('Fluid properties required for ' + regime + ' type analytical solution') muPrime = fluid_prop.muPrime else: muPrime = None if samp_cell is None: samp_cell = int(len(mat_prop.Kprime) / 2) if time_srs is not None: srs_length = len(time_srs) else: srs_length = len(length_srs) mesh_list = [] return_list = [] for i in range(srs_length): if length_srs is not None: length = length_srs[i] else: length = None if time_srs is not None: time = time_srs[i] else: time = None if variable in ['time', 't', 'width', 'w', 'net pressure', 'pn', 'front velocity', 'v']: if mesh is None and variable in ['width', 'w', 'net pressure', 'pn']: x_len, y_len = get_fracture_dimensions_analytical_with_properties(regime, time_srs[i], mat_prop, inj_prop, fluid_prop=fluid_prop, h=h, samp_cell=samp_cell, gamma=gamma) from mesh import CartesianMesh mesh_i = CartesianMesh(x_len, y_len, 151, 151) else: mesh_i = mesh mesh_list.append(mesh_i) t, r, p, w, v, actvElts = HF_analytical_sol(regime, mesh_i, mat_prop.Eprime, inj_prop.injectionRate[1, 0], inj_point=inj_prop.sourceCoordinates, muPrime=muPrime, Kprime=mat_prop.Kprime[samp_cell], Cprime=mat_prop.Cprime[samp_cell], length=length, t=time, Kc_1=Kc_1, h=h, density=density, Cij=Cij, gamma=gamma, required=required_string[variable]) if variable is 'time' or variable is 't': return_list.append(t) elif variable is 'width' or variable is 'w': return_list.append(w) elif variable is 'net pressure' or variable is 'pn': return_list.append(p) elif variable is 'front velocity' or variable is 'v': return_list.append(v) elif variable in ['front_dist_min', 'd_min', 'front_dist_max', 'd_max', 'front_dist_mean', 'd_mean', 'radius', 'r']: x_len, y_len = get_fracture_dimensions_analytical_with_properties(regime, time, mat_prop, inj_prop, fluid_prop=fluid_prop, h=h, samp_cell=samp_cell, gamma=gamma) if variable is 'radius' or variable is 'r': return_list.append(x_len) elif variable is 'front_dist_min' or variable is 'd_min': return_list.append(y_len) elif variable is 'front_dist_max' or variable is 'd_max': return_list.append(x_len) elif variable is 'front_dist_mean' or variable is 'd_mean': if regime in ('E_K', 'E_E'): raise ValueError('Mean distance not available.') else: return_list.append(x_len) else: raise ValueError('The variable type is not correct or the analytical solution not available. Select' ' one of the following:\n' '-- \'r\' or \'radius\'\n' '-- \'w\' or \'width\'\n' '-- \'pn\' or \'net pressure\'\n' '-- \'v\' or \'front velocity\'\n' '-- \'d_min\' or \'front_dist_min\'\n' '-- \'d_max\' or \'front_dist_max\'\n' '-- \'d_mean\' or \'front_dist_mean\'\n' ) return return_list, mesh_list
Copyright (c) "ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE, Switzerland, Geo-Energy Laboratory", 2016-2019. All rights reserved. See the LICENSE.TXT file for more details. """ import numpy as np # local imports from mesh import CartesianMesh from properties import MaterialProperties, FluidProperties, InjectionProperties, SimulationProperties from fracture import Fracture from controller import Controller from fracture_initialization import Geometry, InitializationParameters from elasticity import load_isotropic_elasticity_matrix # creating mesh Mesh = CartesianMesh(3200, 2800, 83, 83) # solid properties nu = 0.25 # Poisson's ratio youngs_mod = 1.125e9 # Young's modulus Eprime = youngs_mod / (1 - nu**2) # plain strain modulus def sigmaO_func(x, y): """ This function provides the confining stress over the domain""" density_high = 2700 density_low = 2300 layer = 1500 Ly = 2800 if y > layer: return (Ly - y) * density_low * 9.8
This file is part of PyFrac. Created by Haseeb Zia on Fri June 16 17:49:21 2017. Copyright (c) "ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE, Switzerland, Geo-Energy Laboratory", 2016-2019. All rights reserved. See the LICENSE.TXT file for more details. """ # local imports from mesh import CartesianMesh from properties import MaterialProperties, FluidProperties, InjectionProperties, SimulationProperties from fracture import Fracture from controller import Controller from fracture_initialization import Geometry, InitializationParameters # creating mesh Mesh = CartesianMesh(0.3, 0.3, 41, 41) # solid properties nu = 0.4 # Poisson's ratio youngs_mod = 3.3e10 # Young's modulus Eprime = youngs_mod / (1 - nu**2) # plain strain modulus K_Ic = 0.5 # fracture toughness # material properties Solid = MaterialProperties(Mesh, Eprime, K_Ic) # injection parameters Q0 = 0.001 # injection rate Injection = InjectionProperties(Q0, Mesh) # fluid properties
Created by Haseeb Zia on Fri June 16 17:49:21 2017. Copyright (c) "ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE, Switzerland, Geo-Energy Laboratory", 2016-2019. All rights reserved. See the LICENSE.TXT file for more details. """ # local imports from mesh import CartesianMesh from properties import MaterialProperties, FluidProperties, InjectionProperties, SimulationProperties from fracture import Fracture from controller import Controller from fracture_initialization import Geometry, InitializationParameters # creating mesh Mesh = CartesianMesh(100, 150, 41, 61) # solid properties nu = 0.4 # Poisson's ratio youngs_mod = 3.3e10 # Young's modulus Eprime = youngs_mod / (1 - nu ** 2) # plain strain modulus K_Ic = 0.5 # fracture toughness def sigmaO_func(x, y): """ This function provides the confining stress over the domain""" # only dependant on the depth density = 2000 return -(y - 400) * density * 9.8
Created by Haseeb Zia on Aug 31 17:49:21 2017. Copyright (c) "ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE, Switzerland, Geo-Energy Laboratory", 2016-2019. All rights reserved. See the LICENSE.TXT file for more details. """ import numpy as np # local imports from mesh import CartesianMesh from properties import MaterialProperties, FluidProperties, InjectionProperties, SimulationProperties from fracture import Fracture from controller import Controller from fracture_initialization import Geometry, InitializationParameters # creating mesh Mesh = CartesianMesh(100, 60, 101, 81, symmetric=True) # solid properties nu = 0.4 # Poisson's ratio youngs_mod = 3.3e10 # Young's modulus Eprime = youngs_mod / (1 - nu**2) # plain strain modulus # the function below will make the fracture propagate a specific shape at large time (see Zia et al. IJF 2018) # somehow "eye" like at large time def K1c_func(alpha): K1c_1 = 2.0e6 # fracture toughness along x-axis K1c_2 = 3.0e6 # fracture toughness along y-axis # the evolution between the 0 and 90 deg angle is a smooth Heaviside starting at "sharp" angle 3 pi/20 j = 3 * np.pi / 20 f = 1 / (1 + np.e**(-2 * 5 * (alpha - j)))
import os # local imports from mesh import CartesianMesh from properties import MaterialProperties, FluidProperties, InjectionProperties, SimulationProperties from fracture import Fracture from controller import Controller from fracture_initialization import Geometry, InitializationParameters import math from utility import setup_logging_to_console # setting up the verbosity level of the log at console setup_logging_to_console(verbosity_level='info') # creating mesh Mesh = CartesianMesh(0.65, 0.65, 69, 69) # solid properties nu = 0.4 # Poisson's ratio youngs_mod = 3.3e10 # Young's modulus Eprime = youngs_mod / (1 - nu ** 2) # plain strain modulus K_Ic1 = 5.6e6 # fracture toughness def My_KIc_func(x, y): """ The function providing the fracture toughness""" return K_Ic1 # material properties def sigmaO_func(x, y):
Created by Haseeb Zia on Fri June 16 17:49:21 2017. Copyright (c) "ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE, Switzerland, Geo-Energy Laboratory", 2016-2019. All rights reserved. See the LICENSE.TXT file for more details. """ # local imports from mesh import CartesianMesh from properties import MaterialProperties, FluidProperties, InjectionProperties, SimulationProperties from fracture import Fracture from controller import Controller from fracture_initialization import Geometry, InitializationParameters from visualization import * # creating mesh Mesh = CartesianMesh(8, 4, 81, 41, symmetric=True) # solid properties nu = 0.4 # Poisson's ratio youngs_mod = 3.3e10 # Young's modulus Eprime = youngs_mod / (1 - nu**2) # plain strain modulus # the function below will make the fracture propagate in the form of an ellipse (see Zia and Lecampion 2018) def K1c_func(alpha): K1c_1 = 1.e6 # fracture toughness along x-axis K1c_2 = 1.414e6 # fracture toughness along y-axis beta = np.arctan((K1c_1 / K1c_2)**2 * np.tan(alpha)) return 4 * (2 / np.pi)**0.5 * K1c_2 * ( np.sin(beta)**2 + (K1c_1 / K1c_2)**4 * np.cos(beta)**2)**0.25
Created by Haseeb Zia on Fri June 16 17:49:21 2017. Copyright (c) "ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE, Switzerland, Geo-Energy Laboratory", 2016-2019. All rights reserved. See the LICENSE.TXT file for more details. """ import numpy as np # local imports from mesh import CartesianMesh from properties import MaterialProperties, FluidProperties, InjectionProperties, SimulationProperties from fracture import Fracture from controller import Controller from fracture_initialization import Geometry, InitializationParameters # creating mesh Mesh = CartesianMesh(90, 66, 41, 27) # solid properties nu = 0.4 # Poisson's ratio youngs_mod = 4e10 # Young's modulus Eprime = youngs_mod / (1 - nu**2) # plain strain modulus K_Ic = 5.0e5 # fracture toughness def sigmaO_func(x, y): """ This function provides the confining stress over the domain""" if 0 < y < 7: return 5.25e6 elif y < -50: return 5.25e6 else:
import os # local imports from mesh import CartesianMesh from properties import MaterialProperties, FluidProperties, InjectionProperties, SimulationProperties from fracture import Fracture from controller import Controller from fracture_initialization import Geometry, InitializationParameters, get_eliptical_survey_cells from elasticity import load_isotropic_elasticity_matrix from utility import setup_logging_to_console # setting up the verbosity level of the log at console setup_logging_to_console(verbosity_level='info') # creating mesh Mesh = CartesianMesh(115, 115, 51, 51) # solid properties nu = 0.4 # Poisson's ratio youngs_mod = 3.3e10 # Young's modulus Eprime = youngs_mod / (1 - nu**2) # plain strain modulus K_Ic = 0.5 # fracture toughness def sigmaO_func(x, y): """ This function provides the confining stress over the domain""" # only dependant on the depth density = 2000 return -(y - 400) * density * 9.8
import numpy as np import os # local imports from mesh import CartesianMesh from properties import MaterialProperties, FluidProperties, InjectionProperties, SimulationProperties from fracture import Fracture from controller import Controller from fracture_initialization import Geometry, InitializationParameters from utility import setup_logging_to_console # setting up the verbosity level of the log at console setup_logging_to_console(verbosity_level='info') # creating mesh Mesh = CartesianMesh(5, 5, 41, 41) # solid properties nu = 0.4 # Poisson's ratio youngs_mod = 3.3e10 # Young's modulus Eprime = youngs_mod / (1 - nu**2) # plain strain modulus K1c = 5e5 / (32 / np.pi)**0.5 # K' = 5e5 Cl = 0.5e-6 # Carter's leak off coefficient # material properties Solid = MaterialProperties(Mesh, Eprime, K1c, Carters_coef=Cl) # injection parameters Q0 = 0.01 # injection rate Injection = InjectionProperties(Q0, Mesh)
import os # local imports from mesh import CartesianMesh from properties import MaterialProperties, FluidProperties, InjectionProperties, SimulationProperties from fracture import Fracture from controller import Controller from fracture_initialization import Geometry, InitializationParameters from utility import setup_logging_to_console # setting up the verbosity level of the log at console setup_logging_to_console(verbosity_level='info') # creating mesh Mesh = CartesianMesh(0.2, 0.2, 41, 41) # solid properties nu = 0.4 # Poisson's ratio youngs_mod = 3.3e10 # Young's modulus Eprime = youngs_mod / (1 - nu**2) # plain strain modulus K1c = 5e5 / (32 / np.pi)**0.5 # K' = 5e5 Cl = 0.5e-6 # Carter's leak off coefficient # material properties Solid = MaterialProperties(Mesh, Eprime, K1c, Carters_coef=Cl) # injection parameters
import os # local imports from mesh import CartesianMesh from properties import MaterialProperties, FluidProperties, InjectionProperties, SimulationProperties from fracture import Fracture from controller import Controller from fracture_initialization import Geometry, InitializationParameters from elasticity import load_isotropic_elasticity_matrix_toepliz from utility import setup_logging_to_console # setting up the verbosity level of the log at console setup_logging_to_console(verbosity_level='info') # creating mesh Mesh = CartesianMesh(425, [-425, 455], 13, 15) # solid properties nu = 0.25 # Poisson's ratio youngs_mod = 1.125e9 # Young's modulus Eprime = youngs_mod / (1 - nu**2) # plain strain modulus def sigmaO_func(x, y): """ This function provides the confining stress over the domain""" density_high = 2700 density_low = 2300 layer = 2900 Ly = 3400 if y > layer: return (Ly - y) * density_low * 9.8
import numpy as np # local imports from mesh import CartesianMesh from properties import MaterialProperties, FluidProperties, InjectionProperties, SimulationProperties from fracture import Fracture from controller import Controller from fracture_initialization import Geometry, InitializationParameters from utility import setup_logging_to_console # setting up the verbosity level of the log at console setup_logging_to_console(verbosity_level='info') # creating mesh Mesh = CartesianMesh(6, 6, 41, 41) # solid properties nu = 0.4 # Poisson's ratio youngs_mod = 3.3e10 # Young's modulus Eprime = youngs_mod / (1 - nu**2) # plain strain modulus K_Ic = 1e7 # fracture toughness Solid = MaterialProperties(Mesh, Eprime, K_Ic, minimum_width=1e-9) # injection parameters Q0 = 0.001 # injection rate Injection = InjectionProperties(Q0, Mesh) # fluid properties viscosity = 1.1e-3
All rights reserved. See the LICENSE.TXT file for more details. """ # local imports from mesh import CartesianMesh from properties import MaterialProperties, FluidProperties, InjectionProperties, SimulationProperties from fracture import Fracture from controller import Controller from fracture_initialization import Geometry, InitializationParameters from utility import setup_logging_to_console # setting up the verbosity level of the log at console setup_logging_to_console(verbosity_level='debug') # creating mesh Mesh = CartesianMesh(0.25, 0.15, 69, 39) # solid properties nu = 0.4 # Poisson's ratio youngs_mod = 3.3e10 # Young's modulus Eprime = youngs_mod / (1 - nu**2) # plain strain modulus K_Ic1 = 5.6e6 # fracture toughness def My_KIc_func(x, y): """ The function providing the fracture toughness""" if x < 0.2: return K_Ic1 else: return K_Ic1 * 3.6