fracture module

This file is part of PyFrac.

Created by Haseeb Zia on Thu Dec 22 16:22:33 2016. Copyright (c) ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE, Switzerland, Geo-Energy Laboratory, 2016-2020. All rights reserved. See the LICENSE.TXT file for more details.

class fracture.Fracture(mesh, init_param, solid=None, fluid=None, injection=None, simulProp=None)[source]

Bases: object

Class defining propagating fracture.

Parameters
  • mesh (CartesianMesh) – – a CartesianMesh class object describing the grid.

  • init_param (tuple) – – a InitializationParameters class object (see class documentation).

  • solid (MaterialProperties) – – the MaterialProperties object giving the material properties.

  • fluid (FluidProperties) – – the FluidProperties class object giving the fluid properties.

  • injection (InjectionProperties) – – the InjectionProperties class object giving the injection properties.

  • simulProp (SimulationParameters) – – the SimulationParameters class object giving the numerical parameters to be used in the simulation.

w

– fracture opening (width)

Type

ndarray

pFluid

– the fluid pressure in the fracture.

Type

ndarray

pNet

– the net pressure in the fracture.

Type

ndarray

time

– time since the start of injection

Type

float

EltChannel

– list of cells currently in the channel region

Type

ndarray

EltCrack

– list of cells currently in the crack region

Type

ndarray

EltRibbon

– list of cells currently in the Ribbon region

Type

ndarray

EltTip

– list of cells currently in the Tip region

Type

ndarray

v

– propagation velocity for each cell in the tip cells

Type

ndarray

alpha

– angle prescribed by perpendicular on the fracture front (see Pierce 2015, Computation Methods Appl. Mech)

Type

ndarray

l

– length of perpendicular on the fracture front (see Pierce 2015, Computation Methods Appl. Mech)

Type

ndarray

ZeroVertex

– Vertex from which the perpendicular is drawn (can have value from 0 to 3, where 0 signify bottom left, 1 signifying bottom right, 2 signifying top right and 3 signifying top left vertex)

Type

ndarray

FillF

– filling fraction of each tip cell

Type

ndarray

CellStatus

– specifies which region each element currently belongs to

Type

ndarray

sgndDist

– signed minimum distance from fracture front of each cell in the domain

Type

ndarray

InCrack

– array specifying whether the cell is inside or outside the fracture.

Type

ndarray

FractureVolume

– fracture volume

Type

float

muPrime

– local viscosity parameter

Type

ndarray

Ffront

– a list containing the intersection of the front and grid lines for the tip cells. Each row contains the x and y coordinates of the two points.

Type

ndarray

regime_color

– RGB color code of the regime on Dontsov and Peirce, 2017

Type

ndarray

ReynoldsNumber

– the reynolds number at each edge of the cells in the fracture. The arrangement is left, right, bottom, top.

Type

ndarray

fluidFlux

– the fluid flux at each edge of the cells in the fracture. The arrangement is left, right, bottom, top.

Type

ndarray

fluidVelocity

– the fluid velocity at each edge of the cells in the fracture. The arrangement is left, right, bottom, top.

Type

ndarray

LkOffTotal

– total fluid volume leaked off from each of the cell in the mesh

Type

ndarray

Tarrival

– the arrival time of the fracture front for each of the cell in the domain. It is used to evaluate the leak off using Carter’s leak off formulation. The time is averaged over entering and leaving of the front from a cell.

Type

ndarray

TarrvlZrVrtx

– the time at which the front crosses the zero vertex. This is used to evaluate leak off in tip cells, i.e. for cells where the front has not left the cell.

Type

ndarray

closed

– the cells which have closed due to leak off or flow back of the fluid.

Type

ndarray

injectedVol

– the total volume that is injected into the fracture.

Type

float

sgndDist_last

– the signed distance of the last time step. Used for re-meshing.

Type

ndarray

timeStep_last

– the last time step. Required for re-meshing.

Type

float

source

– the list of injection cells i.e. the source elements.

Type

ndarray

SaveFracture(filename)[source]

This function saves the fracture object to a file on hard dist using dill module

plot_fracture(variable='complete', mat_properties=None, projection='3D', elements=None, backGround_param=None, plot_prop=None, fig=None, edge=4, contours_at=None, labels=None, plot_non_zero=True)[source]

This function plots the fracture.

Parameters
  • variable (string) – – the variable to be plotted. See supported_variables of the labels module for a list of supported variables.

  • mat_properties (MaterialProperties) – – the material properties. It is mainly used to colormap the mesh.

  • projection (string) – – a string specifying the projection. See supported_projections for the supported projections for each of the supported variable. If not provided, the default will be used.

  • elements (ndarray) – – the elements to be plotted.

  • backGround_param (string) –

    – the parameter according to which the the mesh will be color-mapped. Options are listed below:

    • ’confining stress’ or ‘sigma0’

    • ’fracture toughness’ or ‘K1c’

    • ’leak off coefficient’, ‘Cl’

  • plot_prop (PlotProperties) – – the properties to be used for the plot.

  • fig (Figure) – – the figure to superimpose on. New figure will be made if not provided.

  • edge (int) – – the edge of the cell that will be plotted. This is for variables that are evaluated on the cell edges instead of cell center. It can have a value from 0 to 4 (0->left, 1->right, 2->bottome, 3->top, 4->average).

  • contours_at (list) – – the values at which the contours are to be plotted.

  • labels (LabelProperties) – – the labels to be used for the plot.

  • plot_non_zero (bool) – – if true, only non-zero values will be plotted.

Returns

– A Figure object that can be used superimpose further plots.

Return type

(Figure)

plot_fracture_slice(variable='width', point1=None, point2=None, projection='2D', plot_prop=None, fig=None, edge=4, labels=None, plot_cell_center=False, orientation='horizontal')[source]

This function plots the fracture on a given slice of the domain. Two points are to be given that will be joined to form the slice. The values on the slice are interpolated from the values available on the cell centers. Exact values on the cell centers can also be plotted.

Parameters
  • variable (string) – – the variable to be plotted. See supported_variables of the labels module for a list of supported variables.

  • point1 (list or ndarray) – – the left point from which the slice should pass [x, y].

  • point2 (list or ndarray) – – the right point from which the slice should pass [x, y].

  • projection (string) – – a string specifying the projection. It can either ‘3D’ or ‘2D’.

  • plot_prop (PlotProperties) – – the properties to be used for the plot.

  • fig (Figure) – – the figure to superimpose on. New figure will be made if not provided.

  • edge (int) – – the edge of the cell that will be plotted. This is for variables that are evaluated on the cell edges instead of cell center. It can have a value from 0 to 4 (0->left, 1->right, 2->bottom, 3->top, 4->average).

  • labels (LabelProperties) – – the labels to be used for the plot.

  • plot_cell_center (bool) – – if True, the discrete values at the cell centers will be plotted. In this case, the slice passing through the center of the cell containing point1 will be taken. The slice will be made according to the given orientation (see orientation). If False, the values will be interpolated on the line joining the given two points.

  • orientation (string) – – the orientation according to which the slice is made in the case the plotted values are not interpolated and are taken at the cell centers. Any of the four (‘vertical’, ‘horizontal’, ‘ascending’ and ‘descending’) orientation can be used.

Returns

– A Figure object that can be used superimpose further plots.

Return type

(Figure)

plot_front(fig=None, plot_prop=None)[source]

This function plots the front lines in the tip cells of the fracture taken from the fFront variable.

plot_front_3D(fig=None, plot_prop=None)[source]

This function plots the front lines with 3D projection in the tip cells of the fracture taken from the fFront variable.

process_fracture_front()[source]

process fracture front and different regions of the fracture. This function adds the start and endpoints of the front lines in each of the tip cell to the Ffront variable of the Fracture class.

remesh(factor, C, coarse_mesh, material_prop, fluid_prop, inj_prop, sim_prop)[source]

This function compresses the fracture by the given factor once it has reached the end of the mesh. If the compression factor is two, each set of four cells in the fine mesh is replaced by a single cell. The volume of the fracture is conserved upto machine precision. The elasticity matrix and the properties objects are also re-adjusted according to the new mesh.

Parameters
  • factor (float) – – the factor by which the domain is to be compressed. For example, a factor of 2 will merge the adjacent four cells to a single cell.

  • C (ndarray) – – the elasticity matrix to be re-evaluated for the new mesh.

  • coarse_mesh (CartesianMesh) – – the coarse Cartesian mesh.

  • material_prop (MaterialProperties) – – the MaterialProperties object giving the material properties.

  • fluid_prop (FluidProperties) – – the FluidProperties class object giving the fluid properties to be re-evaluated for the new mesh..

  • inj_prop (InjectionProperties) – – the InjectionProperties class object giving the injection properties to be re-evaluated for the new mesh.

  • sim_prop (SimulationParameters) – – the SimulationParameters class object giving the numerical parameters to be used in the simulation.

Returns

– the new fracture after re-meshing.

Return type

Fr_coarse (Fracture)

update_tip_regime(mat_prop, fluid_prop, timeStep)[source]