Skip to content

Cont damage fix - #1723

Open
ChrisZYJ wants to merge 20 commits into
MFlowCode:masterfrom
ChrisZYJ:cont_damage_fix
Open

Cont damage fix#1723
ChrisZYJ wants to merge 20 commits into
MFlowCode:masterfrom
ChrisZYJ:cont_damage_fix

Conversation

@ChrisZYJ

@ChrisZYJ ChrisZYJ commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Description

Bug fix; closes #1673.

Following #1673, this PR made the following major changes to the continuous damage model:

  • Instead of the scalar D, now it advances the conservative $U_D=m_{solid}D$ with flux $U_D u$ and source $m_{solid} \dot{D}$
  • $-p\mathbf{I}$ is included correctly in the maximum principle stress, for 1D/2D/3D
  • Energy now tracks energy related to undamaged modulus $G_0$, so the states remain finite and stable as D->1
  • D is carefully clipped to [0,1] (and projects $U_D$) after each stage

Testing

Regenerated the affected continuous damage golden files.

All CI passed on CPU and GPU.

Shock-cylinder interaction - damage evolution in the cylinder:

fig3_disk_2d_first_row

Checklist

Check these like this [x] to indicate which of the below applies.

  • I added or updated tests for new behavior
  • I updated documentation if user-facing behavior changed

See the developer guide for full coding standards.

GPU changes (expand if you modified src/simulation/)
  • GPU results match CPU results
  • Tested on NVIDIA GPU or AMD GPU

AI code reviews

Reviews are not retriggered automatically. To request a review, comment on the PR:

  • @claude full review — Claude full review (also triggers on PR open/reopen/ready)
  • Or add label claude-full-review — Claude full review via label

@ChrisZYJ

Copy link
Copy Markdown
Contributor Author

Almost done. Will update very soon.

@ChrisZYJ
ChrisZYJ marked this pull request as ready for review September 1, 2026 02:57
@codecov

codecov Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 51.28205% with 57 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.64%. Comparing base (30e7004) to head (fd1f7ce).

Files with missing lines Patch % Lines
src/simulation/m_data_output.fpp 3.44% 28 Missing ⚠️
src/common/m_variables_conversion.fpp 44.44% 6 Missing and 4 partials ⚠️
src/simulation/m_hypoelastic.fpp 82.00% 0 Missing and 9 partials ⚠️
src/simulation/m_riemann_solver_hllc.fpp 0.00% 5 Missing and 1 partial ⚠️
src/simulation/m_riemann_solver_hll.fpp 62.50% 0 Missing and 3 partials ⚠️
src/simulation/m_riemann_state.fpp 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1723      +/-   ##
==========================================
- Coverage   61.68%   61.64%   -0.04%     
==========================================
  Files          84       84              
  Lines       21613    21674      +61     
  Branches     3196     3210      +14     
==========================================
+ Hits        13331    13362      +31     
- Misses       6090     6111      +21     
- Partials     2192     2201       +9     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sbryngelson

Copy link
Copy Markdown
Member

Merged master to resolve the conflicts from #1762, which moved the elastic-energy term into f_hypoelastic_energy. The resolution keeps this PR's physics under that API: the elastic energy uses the undamaged modulus (G_K in m_variables_conversion, G_undamaged in m_data_output) and the sound speed the damaged one. That leaves master's G_damaged block in s_convert_conservative_to_primitive dead, so it is removed, together with the stress_cons copies the new API no longer needs; the Riemann private lists are master's plus solid_partial_density_L/R. Please check the G_K choice there matches your intent. Verified on the Hypoelasticity set (61 passed).

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

Lines of Code

File Lines Diff
src/simulation/m_hypoelastic.fpp 628 +37
src/simulation/m_data_output.fpp 1336 +26
src/simulation/m_riemann_solver_hll.fpp 615 +20
src/common/m_variables_conversion.fpp 1144 +16
src/simulation/m_riemann_solver_hllc.fpp 1284 +16
src/simulation/m_time_steppers.fpp 829 +2
Directory Lines Diff
common 9962 +16
simulation 27769 +101
total 45555 +117

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Continuum-damage model has transport, stress-measure, principal-stress, and documentation inconsistencies

2 participants