Skip to content

Implement stress to strain and strain to stress transformation according to Hooke's law #39

@JiriKuzelka

Description

@JiriKuzelka

ℹ️ General Information

Component Name: Hooke's Law
Component Location: material_laws/hookes_law
Suggested Python Name: hookes_law
FABER WG Relation: -
Brief Description: Elastic stress to strain and back conversion for linear elastic and isotropic material.
Priority: 3
Technical Complexity: 2
Estimated Effort: 2
Dependencies: -


Implementation Details

📋 Specification

2 Separate versions should be implemented for both stress to strain and strain to stress conversion:

  1. 1D Hooke's law for uniaxial stress and strain
  2. 2D Hooke's law for plane stress and plane strain conditions

Additional requirements:

  1. Voigt notation should be utilized for 2D and 3D cases, i.e. stress and strain tensors should be represented as 6-component vectors.

  2. Isotropic material behavior is assumed. This should be clearly stated in the documentation.

Mathematical Formulation

3D Hooke's Law (Strain-Stress Relationship):

Note: if images are not well visible, switch to light mode or click on them to open in a new tab

Hooke's Law

3D Hooke's Law (Stress-Strain Relationship):

Hooke's Law

2D Hooke's Law (Strain-Stress Relationship):

Hooke's Law

2D Hooke's Law (Stress-Strain Relationship):

Hooke's Law

Inputs

  1. Material parameters
Parameter Symbol Type Description Units Range
elastic_modulus $E$ array of floats Young's modulus MPa $(0;\infty)$
poisson_ratio $\nu$ array of floats Poisson's ratio - $(-\infty;0.5)$
  1. Stress / Strain values
Parameter Symbol Type Description Units Range
stress $\sigma$ array of floats stress MPa $(-\infty;\infty)$
strain $\epsilon$ array of floats strain - $(-\infty;\infty)$

Outputs

Parameter Symbol Type Description Units Range
stress $\sigma$ array of floats stress MPa $(-\infty;\infty)$
strain $\epsilon$ array of floats strain - $(-\infty;\infty)$

🔧 Implementation Guidelines

Code Structure

Create separate file hookes_law.py in the material_laws directory for better namespace organization.

Function Signature

# import numpy as np
# from numpy.typing import ArrayLike, NDArray

def calc_stress_xD(
    elastic_modulus: float,
    poisson_ratio: float,
    strain: ArrayLike,
) -> NDArray[np.float64]:
    # x should be repalaced with 2 or 3
    pass

def calc_strain_xD(
    elastic_modulus: float,
    poisson_ratio: float,
    stress: ArrayLike,
) -> NDArray[np.float64]:
    # x should be repalaced with 2 or 3
    pass

Error Handling

No error handling is required.

Testing

Test cases are not provided, but should be straightforward to implement.

📚 References & Resources

https://en.wikipedia.org/wiki/Hooke%27s_law

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions