Skip to content

Commit

Permalink
Minor formating of contact mechanics modules
Browse files Browse the repository at this point in the history
  • Loading branch information
keileg committed Jul 2, 2019
1 parent bfe25d3 commit 71c4c77
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/porepy/models/contact_mechanics_biot_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
The domain $[0, 2]\times[0, 1]$ with six fractures. We do not consider any fluid, and
solve only for the linear elasticity coupled to the contact
NOTE: This module should be considered an experimental feature, which will likely
undergo major changes (or be deleted).
"""
import numpy as np
import scipy.sparse as sps
from scipy.spatial.distance import cdist
import porepy as pp

from porepy.utils import assign_discretizations
Expand Down
7 changes: 7 additions & 0 deletions src/porepy/models/contact_mechanics_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@
The setup handles parameters, variables and discretizations. Default (unitary-like)
parameters are set. A "run script" function for setting up the class and solving the
nonlinear contact mechanics problem is also provided.
NOTE: This module should be considered an experimental feature, which will likely
undergo major changes (or be deleted).
"""
import numpy as np
import scipy.sparse as sps
from scipy.spatial.distance import cdist

import porepy as pp


Expand Down Expand Up @@ -43,6 +48,7 @@ def create_grid(self):
gb (pp.GridBucket): The produced grid bucket.
Nd (int): The dimension of the matrix, i.e., the highest dimension in the
grid bucket.
"""
# List the fracture points
self.frac_pts = np.array([[0.2, 0.8], [0.5, 0.5]])
Expand Down Expand Up @@ -261,6 +267,7 @@ def extract_iterate(self, assembler, solution_vector):
Returns:
(np.array): displacement solution vector for the Nd grid.
"""
dof = np.cumsum(np.append(0, np.asarray(assembler.full_dof)))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,13 +398,18 @@ class MatrixScalarToForceBalance:
We account for the grad P contribution to the forces on the higher-dimensional
internal boundary, i.e. the last term of:
boundary_traction_hat = stress * u_hat + bound_stress * u_mortar + gradP * p_hat
Note that with this approach to discretization of the boundary pressure force, it
will only be included for nonzero values of the biot_alpha coefficient.
If the scalar is e.g. pressure, subtraction of the pressure contribution is needed:
\lambda_contact - p_check I \dot n = boundary_traction_hat
This is taken care of by FracturePressureToForceBalance.
"""

def __init__(self, keyword, discr_master, discr_slave):
Expand Down Expand Up @@ -542,6 +547,7 @@ class FractureScalarToForceBalance:
For the contact mechanics, we only want to consider the _contact_ traction. Thus, we
have to subtract the pressure contribution, i.e.
\lambda_contact - p_check I \dot n = boundary_traction_hat,
since the full tractions experienced by a fracture surface are the sum of the
Expand Down

0 comments on commit 71c4c77

Please sign in to comment.