Skip to content

Implement 2D Pfrommer shock finder with thermal-energy dissipation#4

Open
markorn-01 wants to merge 37 commits into
leo1200:mainfrom
plienta:playground
Open

Implement 2D Pfrommer shock finder with thermal-energy dissipation#4
markorn-01 wants to merge 37 commits into
leo1200:mainfrom
plienta:playground

Conversation

@markorn-01

Copy link
Copy Markdown

Description

Summary

This PR implements a 2D shock-finding pipeline based on the Pfrommer methodology and adds thermal-energy dissipation calculations at detected shock surfaces.

Main changes

  • Added ShockFinderResult data structures for storing:

    • shock-zone cells
    • shock-surface cells
    • shock directions
    • Mach numbers
    • thermal-energy flux
    • shock and shock-zone IDs
  • Implemented the main 2D shock-finder components:

    • temperature and density gradients
    • shock-direction calculation
    • shock-zone identification
    • shock-surface refinement
    • Mach-number calculation
    • pre-shock and post-shock state sampling
  • Added thermal-energy dissipation:

    • computes the pre-shock sound speed
    • computes incoming kinetic-energy flux
    • computes Mach-dependent thermalization efficiency
    • stores thermal-energy flux only at valid shock-surface cells
    • excludes boundary-adjacent cells where shifted pre/post sampling is unreliable
    • supports configurable pre/post sampling distance

Validation cases

Added 2D validation and visualization cases for:

  • Standard Sod shock tube
  • Rotated Sod shock tube
  • Two parallel shocks
  • X-shaped shock interaction
  • Sedov-like point explosion

The cases validate shock position, shock direction, Mach number, shock zones, shock surfaces, and thermal-energy flux.

Validation figures

Generated validation plots for the implemented 2D test cases include:

  • standard Sod shock
  • rotated Sod shock
  • parallel shocks
  • X-shaped shock interaction
  • Sedov blast
  • thermal-energy dissipation results

Code locations

  • Main implementation: astronomix/_physics_modules/_shock_finder/
  • Validation cases: docs/source/notebooks/shock_finder/
  • Generated validation figures: images/

Current scope

  • The implementation currently focuses on Cartesian 2D simulations.
  • The validation scripts are intended both as numerical checks and as examples of how to use and visualize the shock finder.
  • More complex 3D shock-surface handling and total surface-integrated dissipation can be added separately.

plienta and others added 30 commits May 11, 2026 20:19
- Documented pressure and velocity regions in two panels
- Included descriptions for shock front and rarefaction fan
- Remove deprecated 2D_pfrommer_diverse_x_y.py and replace with 2D_pfrommer_rotated_sod.py for improved clarity and structure.
- Introduce 2D_pfrommer_standard_sod.py to implement standard Sod tube conditions in 2D, ensuring consistency with expected shock behavior.
- Enhance diagnostics and plotting for better visualization of shock surfaces and Mach numbers across different scenarios.
- Remove 2D_pfrommer_2_dif_angle_dif_pos_shock.py and 2D_pfrommer_2_dif_angle_same_pos.py.
- Add new test 2D_pfrommer_x_shock_interation.py for intersecting shocks forming an X shape.
- Update 2D_pfrommer_parallel_shock.py and 2D_pfrommer_rotated_sod.py to use consistent naming for shock angles.
plienta and others added 5 commits June 24, 2026 18:04
- Implemented a new test for the 2D rotated Sod tube, validating shock detection and energy dissipation.
- Added a point explosion test (Sedov-like) to assess shock propagation and directionality.
- Created a standard 2D Sod tube test to verify shock surface detection and thermal energy flux.
- Enhanced diagnostics and visualization for shock properties across different test scenarios.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants