Skip to main content

A Python package for fracture growth modeling.

Project description

fracmechpy: Fracture Mechanics

Overview

fracmechpy is a Python package that calculates the fatigue crack growth rate (da/dN) and the stress intensity factor range (ΔK) for Compact Tension (CT) specimens with the Secant method based on ASTM E647.

Features

  • Computes fatigue crack growth rate (da/dN)
  • Computes stress intensity factor range (ΔK)
  • Implements ASTM E647 standard
  • Includes error handling for ASTM E647 validity limits
  • Newly added: Incremental Polynomial Regression (IncPoly) method for crack growth rate calculation.

Installation

Installing from PyPI (Future Deployment)

If FracGrowM is available on PyPI, you can install it using:

pip install fracmechpy

Installing from Source

To install the package manually:

  1. Clone the repository:
    git clone https://github.com/dhaselib/fracmechpy.git
    
  2. Navigate to the directory:
    cd FracGrowM
    
  3. Install using pip:
    pip install .
    

Ensure you have NumPy installed using:

pip install numpy

Functions

Secant(N, af, ab, W, p_max, p_min, B)

This function calculates the fatigue crack growth rate (da/dN) and the stress intensity factor range (ΔK) for a CT specimen.

Parameters:

  • N (numpy array): Number of cycles
  • af (numpy array): Crack length at the front face of the specimen
  • ab (numpy array): Crack length at the back face of the specimen
  • W (float): Width of the specimen
  • p_max (float): Maximum applied load
  • p_min (float): Minimum applied load
  • B (float): Thickness of the specimen

Returns:

  • dadN (numpy array): Fatigue crack growth rate (da/dN)
  • dK (numpy array): Stress intensity factor range (ΔK)

IncPoly(N, af, ab, W, p_max, p_min, B, n)

This function calculates the crack growth rate (da/dN) using the Incremental Polynomial Regression method for a CT specimen.

Parameters:

  • N (numpy array): Number of cycles
  • af (numpy array): Crack length at the front face of the specimen
  • ab (numpy array): Crack length at the back face of the specimen
  • W (float): Width of the specimen
  • p_max (float): Maximum applied load
  • p_min (float): Minimum applied load
  • B (float): Thickness of the specimen
  • n (int): Number of neighboring points for regression

Returns:

  • dadN (numpy array): Incremental crack growth rate (da/dN)
  • dK (numpy array): Stress intensity factor range (ΔK)

Limitations on Choosing the Value of n

  • Dataset Size: Ensure that n is smaller than the length of the dataset. If n exceeds the available data points, the method may fail to run, leading to errors or empty results.

  • Accuracy vs. Data Availability: A larger n improves regression accuracy but may result in fewer available data points, especially in smaller datasets. Conversely, smaller n might yield less stable results but can handle more data points.

  • Edge Effects: For data points near the beginning or end of the dataset, the number of available neighbors may be limited. If n is too large, it may not be possible to compute regression near the edges.

  • Performance Considerations: Large values of n can increase memory usage and slow down performance, especially for larger datasets. Start with smaller values of n and increase it as needed.

Example Usage

import numpy as np
from fracmechpy import Secant, IncPoly

# Sample input data
N = np.array([70000, 90000, 100000, 110000,120000,130000])
af = np.array([1.90, 3.09, 3.78, 4.45, 6.19, 6.84])
ab = np.array([0.89, 2.07, 2.81, 3.53, 5.09, 6.21])
W = 50  # Width in (mm)
p_max = 4000  # Maximum load in (N)
p_min = 400  # Minimum load in (N)
B = 5  # Thickness in (mm)
n = 1  # Number of neighboring points for regression

# Compute crack growth rate and stress intensity factor range using Secant method
dadN_secant, dK_secant = Secant(N, af, ab, W, p_max, p_min, B)
print("Secant Method - da/dN:", dadN_secant)
print("Secant Method - dK:", dK_secant)

# Compute crack growth rate and stress intensity factor range using IncPoly method
dadN_incpoly, dK_incpoly = IncPoly(N, af, ab, W, p_max, p_min, B, n)
print("IncPoly Method - da/dN:", dadN_incpoly)
print("IncPoly Method - dK:", dK_incpoly)

Error Handling

The function enforces ASTM E647 validity limits for crack growth increments (da). If the increment exceeds the standard-defined limits based on α = aᵥₑ/W , the function prints an error message and returns None.

License

This package is distributed under the MIT License.

Contact

For questions or contributions, please reach out to the author at dhaselib@gmail.com.


### Key Updates:
1. **New Section for `IncPoly`**: Added a description of the `IncPoly` method in the functions section.
2. **Updated Example Usage**: Added an example that demonstrates the usage of both `Secant` and `IncPoly` functions.
3. **Feature Addition**: Mentioned the addition of the `IncPoly` method in the Features section.
4. **Limitations of `n`**: Provided detailed information about the limitations on choosing the value of `n`, including dataset size, accuracy vs. data availability, edge effects, and performance considerations.

This should now fully reflect the functionality of the `IncPoly` method and the limitations for the `n` parameter.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fracmechpy-0.0.2.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fracmechpy-0.0.2-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file fracmechpy-0.0.2.tar.gz.

File metadata

  • Download URL: fracmechpy-0.0.2.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for fracmechpy-0.0.2.tar.gz
Algorithm Hash digest
SHA256 85b2f1a3fc3cffaa82b30c320dd3e08a5753b18e72fa655095174da95ae0a8c5
MD5 6681cb19878bb711bdb46b05bb5be56e
BLAKE2b-256 9f6f032ab694894f13d22812fb9caae438e67d430b11ec2e5c60e97dfc0311be

See more details on using hashes here.

File details

Details for the file fracmechpy-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: fracmechpy-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for fracmechpy-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 86e4732040d76336aa91a6d04a38993248bdf0dfce618c785fd5da1a893873d7
MD5 c52a2284a5d9b48bc7ded3c4396fc7b5
BLAKE2b-256 bdb0cb5b02ce15657c965701c757e4af25297953d5fd8cb7abdc22b9d4a2eb83

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page