porepy.models.contact_mechanics_model module
This is a setup class for solving linear elasticity with contact mechanics governing the relative motion of fracture surfaces.
The setup handles parameters, variables and discretizations. Default (unitary-like) parameters are set.
For a description of the mathematical model, see e.g. the tutorials and the PhD thesis of Hüeber (2008): https://elib.uni-stuttgart.de/handle/11682/4854
- class ContactMechanics(params=None)[source]
Bases:
AbstractModel
This is a shell class for contact mechanics problems.
Setting up such problems requires a lot of boilerplate definitions of variables, parameters and discretizations. This class is intended to provide a standardized setup, with all discretizations in place and reasonable parameter and boundary values. The intended use is to inherit from this class, and do the necessary modifications and specifications for the problem to be fully defined. The minimal adjustment needed is to specify the method create_grid().
- Parameters
params (Optional[Dict]) –
- displacement_variable
Name assigned to the displacement variable in the highest-dimensional subdomain. Will be used throughout the simulations, including in ParaView export.
- Type
- mortar_displacement_variable
Name assigned to the displacement variable on the fracture walls. Will be used throughout the simulations, including in ParaView export.
- Type
- contact_traction_variable
Name assigned to the variable for contact forces in the fracture. Will be used throughout the simulations, including in ParaView export.
- Type
- mechanics_parameter_key
Keyword used to define parameters and discretizations for the mechanics problem.
- Type
- friction_coupling_term
Keyword used to define parameters and discretizations for the friction problem.
- Type
- params
Dictionary of parameters used to control the solution procedure. Default parameters are set in AbstractModel
- Type
- mdg
Mixed-dimensional grid. Should be set by a method create_grid which should be provided by the user.
- Type
pp.MixedDimensionalGrid
All attributes are given natural values at initialization of the class.
- after_newton_iteration(solution_vector)[source]
Extract parts of the solution for current iterate.
The iterate solutions in d[pp.STATE][pp.ITERATE] are updated for the mortar displacements and contact traction are updated. Method is a tailored copy from assembler.distribute_variable.
- Parameters
solution_vector (
np.array
) – solution vector for the current iterate.- Return type
None
- before_newton_loop()[source]
Will be run before entering a Newton loop. Discretize time-dependent quantities etc.
- check_convergence(solution, prev_solution, init_solution, nl_params)[source]
Check whether the solution has converged by comparing values from the two most recent iterations.
Tailored implementation if AD is not used. Else, the generic check in AbstractModel is used.
- Parameters
- Return type
- prepare_simulation()[source]
Is run prior to a time-stepping scheme. Use this to create a (mixed-dimensional) grid, initialize variables, parameters, equations, discretizations, export for visualization, linear solvers etc.
The ordering of operations may be significant. For instance, defining initial condition before parameters allows the latter to depend on the former.
- Return type
None
- reconstruct_local_displacement_jump(intf, projection, from_iterate=True)[source]
Reconstruct the displacement jump in local coordinates.
- Parameters
grid (intf represented by a mortar) –
projection (TangentialNormalProjection) –
pp.contact_conditions.set_projections (obtained by calling) –
intf (MortarGrid) –
projection –
from_iterate (bool) –
- Returns
ambient_dim x sd_l.num_cells. First 1-2 dimensions are in the tangential direction of the fracture, last dimension is normal.
- Return type
(np.array)
- reconstruct_stress(previous_iterate=False)[source]
Compute the stress in the highest-dimensional grid based on the displacement states in that grid, adjacent interfaces and global boundary conditions.
The stress is stored in the data dictionary of the highest-dimensional grid, in [pp.STATE][‘stress’].
- Parameters
previous_iterate (
boolean, optional
) – If True, use values from previous iteration to compute the stress. Defaults to False.- Return type
None
- class ContactMechanicsAdObjects[source]
Bases:
object
Storage class for ad related objects.
Stored objects include variables, compound ad operators and projections.
- mortar_projections_vector: MortarProjections
- subdomain_projections_vector: SubdomainProjections