Git Product home page Git Product logo

crackfront's Introduction

CrackFront

This code implements a linearized Crack-Front model for the mechanics of adhesive contacts in Python. The model includes:

  • linear noncircular perturbation of the energy release rate with respect to the circular JKR solution.
  • solving for the equilibrium position of the crack-front on a heterogeneous work of adhesion field. Following resolution algorithms are implemented:
    • a modified trust-region Newton-CG minimization algorithm
    • the crack-propagation algorithm by Rosso and Krauth, that generates a monotonically increasing (or decreasing) sequence of crack positions
  • computation of the work of adhesion heterogeneity equivalent to surface roughness.

The crack-perturbation model for the adhesion of spheres with work of adhesion heterogeneity is described and validated against the boundary-element method in Sanner, Pastewka, JMPS (2023).

The crack-perturbation model for the adhesion of rough spheres is described and validated against the boundary-element method in Sanner, Kumar, Jacobs, Dhinojwala,Pastewka, Science Advances (2024).

The crack perturbation method is based on the first-order perturbation of the stress intensity factor derived by Gao and Rice using weight-function theory.

The crack-propagation algorithm by Rosso and Krauth is described in

GPU accelerated

This code can make use of GPUs accelaration using pytorch if the hardware is available.

Installation

First install the dependencies listed below, then quick install with: python3 -m pip install git+https://github.com/ContactEngineering/CrackFront.git

Dependencies

The package requires :

Funding

Development of this project is funded by the Deutsche Forschungsgemeinschaft within EXC 2193 and by the European Research Council within Starting Grant 757343.

crackfront's People

Contributors

sannant avatar pastewka avatar

Stargazers

 avatar

crackfront's Issues

Inconsistency in energy

def test_energy_vs_gradient_sinewave():
    n = 8
    w = 1 / np.pi
    Es = 3. / 4
    cf = SphereCrackFrontERRPenetrationEnergy(n,
                                              w_radius_integral=lambda a, theta: a ** 2 / 2 * w * 2 * np.pi / n,
                                              w_radius=lambda a, theta: a * w * 2 * np.pi / n,
                                              dw_radius=lambda a, theta: w * 2 * np.pi / n, )
    a = 0.65 * np.ones(n)
    # k = np.fft.fftfreq(len(a), 1 / len(a))
    penetration = JKR.penetration(contact_radius=0.6)
    # contact radius perturbation
    da = np.random.uniform(-1, 1, size=n)
    angle = np.arange(n) * 2 * np.pi / n
    da = 0.1 * np.sin(3 * angle)
    epsilons = np.logspace(-3, -9)
    dUel = np.array([cf.energy(a + eps * da, penetration) - cf.energy(a, penetration) for eps in epsilons])

    grad_da = np.vdot(cf.gradient(a, penetration), da)

    import matplotlib.pyplot as plt
    fig, ax = plt.subplots()
    ax.loglog(epsilons,abs(dUel/(grad_da * epsilons)- 1),".")
    # ax.plot(epsilons,)
    #ax.plot(epsilons, dUel / epsilons, ".")
    #ax.axhline(grad_da)

    plt.show(block=True)

With the current implementation of _n_an_2

    @staticmethod
    def _n_an_2(contact_radius):
        npx = len(contact_radius)
        nq = np.fft.rfftfreq(npx, 1 / npx)
        fourier_scalar_prod_factors = np.ones(npx // 2 + 1) * 2
        fourier_scalar_prod_factors[0] = 1
        if npx % 2 == 0:
            fourier_scalar_prod_factors[-1] == 1
        a_fourier = np.fft.rfft(contact_radius, norm="forward")
        return np.vdot(a_fourier * nq * fourier_scalar_prod_factors, a_fourier).real

this gives ๐Ÿ‘
image

with a less obscure implementation:

    @staticmethod
    def _n_an_2(a):
        k = np.fft.fftfreq(len(a), 1 / len(a))
        ak = np.fft.fft(a, norm="forward")
        return np.sum((abs(k) * ak * ak.conj())).real

image

which looks much more like convergence (I believe for the small epsilons on the x axis the errors are just truncation errors)

ClassNames are too long

There is a multtude of variants of the CF

To make the class names shorter:

  • replace CrackFront by CF or nothing
  • Use module hierarchy, for example extra file for crack front possessing an energy, like CircularERR, CircularSIF, CircularEnergy

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.