Skip to content

Add compressible Neo-Hookean USERMAT with penalty ramp and README note#2

Open
DexterQiu wants to merge 2 commits intomainfrom
codex/implement-large-deformation-neo-hookean-usermat
Open

Add compressible Neo-Hookean USERMAT with penalty ramp and README note#2
DexterQiu wants to merge 2 commits intomainfrom
codex/implement-large-deformation-neo-hookean-usermat

Conversation

@DexterQiu
Copy link
Copy Markdown
Owner

Motivation

  • Provide a reusable ANSYS USERMAT implementation for a large-deformation compressible Neo-Hookean model with a controllable volumetric penalty ramp to avoid abrupt penalty forces during early time steps.
  • Add a short README note showing how to force a direct solver in ANSYS Mechanical APDL to avoid unexpected iterative-solver warnings during transient structural runs.

Description

  • Added usermat_neohookean.f90, a USERMAT implementation that supports PROPS(1)=mu, PROPS(2)=d and an optional PROPS(3) ramp time and computes RAMP = min(1, TIME(1)/PROPS(3)) when PROPS(3)>0 to scale the volumetric penalty.
  • Introduced DPEN_EFF = DPEN / max(RAMP, 1.0D-12) and used it in the 2nd Piola–Kirchhoff stress computation, strain energy PSI, and numerical consistent tangent evaluations.
  • Implemented the consistent tangent by central finite differences in Green–Lagrange strain (perturbation EPS = 1.0D-8) and included small supporting matrix utilities (MAT_IDENTITY, MAT_MATMULT, MAT_INV3, MAT_DET3, ZERO_TANGENT, ISOTROPIC_TANGENT, NEOHOOK_S2PK).
  • Updated README.md with an ANSYS APDL snippet that forces a direct solver using EQSLV,SPARSE prior to SOLVE for transient structural analyses.

Testing

  • No automated tests were run for these changes; the README update is documentation-only and the Fortran USERMAT was added but not compiled or unit-tested in CI in this change.
  • Manual verification recommendations: compile and link usermat_neohookean.f90 into an ANSYS USERMAT build and run a transient structural case with and without PROPS(3) to confirm the ramp behavior (not executed here).

Codex Task

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b07e2d8e22

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +82 to +85
! Strain energy density
PSI = 0.5D0*MU*(TRC - 3.0D0) + (1.0D0/DPEN_EFF) * (J - 1.0D0)**2
SSE = PSI

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Initialize unused energy outputs to avoid garbage values

This subroutine sets SSE but leaves other standard USERMAT outputs (SPD, SCD, RPL, DDSDDT, DRPLDE, DRPLDT) untouched anywhere in the routine. In Fortran these will contain whatever was on the stack, and ANSYS can read them for energy bookkeeping or output even if your material doesn’t use them, which can lead to NaNs or non-deterministic results in runs where those fields are queried. Consider explicitly zeroing the unused outputs (as many USERMAT examples do) so solver behavior is stable across builds and platforms.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant