-
Notifications
You must be signed in to change notification settings - Fork 114
Adding MUSCL Reconstruction #966
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor changes requested
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #966 +/- ##
=========================================
Coverage ? 43.67%
=========================================
Files ? 70
Lines ? 19818
Branches ? 2473
=========================================
Hits ? 8655
Misses ? 9644
Partials ? 1519 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
well done! passing all tests. some minor corrections from the AI reviewers, looks like @wilfonba already parsed those for you to get rid of the false positives |
you removed |
Wait its still there no? |
Code is working! I will look in more detail shortly before merging. |
User description
Description
Added MUSCL Reconstruction with Interface Compression.
Fixes #277
Type of change
Please delete options that are not relevant.
Scope
If you cannot check the above box, please split your PR into multiple PRs that each have a common goal.
How Has This Been Tested?
Test Configuration:
Phoenix, Frontier, Locally using GCC 15.1, and NVHPC 24.5
Checklist
docs/
)examples/
that demonstrate my new feature performing as expected.They run to completion and demonstrate "interesting physics"
./mfc.sh format
before committing my codeIf your code changes any code source files (anything in
src/simulation
)To make sure the code is performing as expected on GPU devices, I have:
nvtx
ranges so that they can be identified in profiles./mfc.sh run XXXX --gpu -t simulation --nsys
, and have attached the output file (.nsys-rep
) and plain text results to this PR./mfc.sh run XXXX --gpu -t simulation --rsys --hip-trace
, and have attached the output file and plain text results to this PR.PR Type
Enhancement
Description
• Added complete MUSCL (Monotonic Upstream-centered Scheme for Conservation Laws) reconstruction implementation as an alternative to WENO
• Implemented first and second-order MUSCL schemes with multiple slope limiters (Van Albada, MC, Minmod, Superbee, UMIST)
• Added THINC (Tangent of Hyperbola for Interface Capturing) interface compression method for sharp interface preservation
• Integrated MUSCL reconstruction throughout the codebase: viscous module, RHS computation, CBC, surface tension, and MPI support
• Added comprehensive input validation and parameter checking for MUSCL-specific settings
• Created extensive test suite with 6 new example cases: Sod shock tube, shock-droplet interactions, Riemann tests, Rayleigh-Taylor instability, and advection
• Updated documentation with detailed parameter descriptions for reconstruction type selection and MUSCL configuration
• Added GPU acceleration support with OpenACC directives for MUSCL reconstruction
• Extended toolchain to support MUSCL parameter preprocessing and test case generation
Diagram Walkthrough
File Walkthrough
20 files
m_viscous.fpp
Integrate MUSCL reconstruction into viscous module
src/simulation/m_viscous.fpp
• Added import for
m_muscl
module• Replaced hardcoded WENO calls with
templated reconstruction scheme selection
• Introduced
recon_dir
variable to replace
weno_dir
for generic reconstruction direction•
Added debug print statement in viscous reconstruction loop
m_muscl.fpp
Add new MUSCL reconstruction module
src/simulation/m_muscl.fpp
• New complete MUSCL reconstruction module implementation
• Implements
first and second-order MUSCL schemes with multiple limiters
• Includes
interface compression using THINC method
• Provides GPU-accelerated
reconstruction with OpenACC directives
m_cbc.fpp
Extend CBC module for MUSCL reconstruction support
src/simulation/m_cbc.fpp
• Extended CBC coefficient allocation to support both WENO and MUSCL
schemes
• Added conditional logic for reconstruction type selection in
CBC computations
• Modified buffer size calculations to accommodate
MUSCL polynomial degrees
• Updated deallocation routines for both
reconstruction types
m_rhs.fpp
Integrate MUSCL reconstruction into RHS computation
src/simulation/m_rhs.fpp
• Added import for
m_muscl
module• Replaced hardcoded WENO
reconstruction calls with templated scheme selection
• Modified
reconstruction direction variable naming for genericity
• Extended
first-order reconstruction to support both WENO and MUSCL types
m_global_parameters.fpp
Add MUSCL and interface compression global parameters
src/simulation/m_global_parameters.fpp
• Added new parameters for MUSCL reconstruction:
recon_type
,muscl_polyn
,muscl_order
,muscl_lim
• Added interface compression
parameters:
int_comp
,ic_eps
,ic_beta
• Extended case optimization
macros to include MUSCL parameters
• Updated GPU memory declarations
for new parameters
m_surface_tension.fpp
Extend surface tension module for MUSCL reconstruction
src/simulation/m_surface_tension.fpp
• Added import for
m_muscl
module• Modified capillary reconstruction
to support both WENO and MUSCL schemes
• Replaced hardcoded
reconstruction calls with templated scheme selection
• Updated
reconstruction direction variable naming
m_mpi_proxy.fpp
Add MPI support for MUSCL parameters
src/simulation/m_mpi_proxy.fpp
• Added MPI broadcast calls for new MUSCL parameters:
recon_type
,muscl_order
,muscl_lim
• Extended parameter broadcasting to include
interface compression parameters
• Updated logical parameter broadcast
list for new features
m_start_up.fpp
Integrate MUSCL module initialization into startup
src/simulation/m_start_up.fpp
• Added import for
m_muscl
module• Extended module initialization to
support MUSCL reconstruction
• Added conditional initialization and
finalization for both WENO and MUSCL modules
• Updated parameter
declarations for new MUSCL and interface compression features
m_checker.fpp
Add input validation for MUSCL reconstruction
src/simulation/m_checker.fpp
• Added new input validation subroutine
s_check_inputs_muscl
•
Extended input checking to validate MUSCL parameters and constraints
•
Added conditional reconstruction type checking in main validation
routine
m_global_parameters.fpp
Add MUSCL parameters to pre-process global parameters
src/pre_process/m_global_parameters.fpp
• Added MUSCL reconstruction parameters:
recon_type
,muscl_polyn
,muscl_order
• Updated parameter initialization with default values
•
Modified polynomial degree calculation to support both WENO and MUSCL
• Extended coordinate bounds configuration for MUSCL support
m_checker_common.fpp
Add common MUSCL input validation
src/common/m_checker_common.fpp
• Added new
s_check_inputs_muscl
subroutine for MUSCL parametervalidation
• Extended common input checking to support both WENO and
MUSCL reconstruction types
• Added constraints checking for MUSCL
order and grid size requirements
m_mpi_common.fpp
Extend MPI domain decomposition for MUSCL support
src/common/m_mpi_common.fpp
• Modified MPI domain decomposition to support both WENO and MUSCL
reconstruction orders
• Updated error messages to include MUSCL in
reconstruction order references
• Added conditional logic for
reconstruction order determination
m_helper_basic.fpp
Extend coordinate bounds configuration for MUSCL
src/common/m_helper_basic.fpp
• Modified
s_configure_coordinate_bounds
to accept MUSCL polynomialparameters
• Added buffer size calculation logic for MUSCL
reconstruction type
• Extended coordinate bounds configuration for
multiple reconstruction schemes
m_constants.fpp
Add constants for MUSCL and interface compression
src/common/m_constants.fpp
• Added reconstruction type constants:
WENO_TYPE
andMUSCL_TYPE
•
Added interface compression default parameters:
dflt_ic_eps
,dflt_ic_beta
,moncon_cutoff
• Defined new constants for MUSCL and
THINC interface compression features
m_mpi_proxy.fpp
Add MPI broadcast for MUSCL parameters in pre-process
src/pre_process/m_mpi_proxy.fpp
• Added MPI broadcast support for new MUSCL parameters:
recon_type
andmuscl_order
• Extended parameter broadcasting list to include
reconstruction type selection
m_global_parameters.fpp
Add MUSCL parameters to post-process global parameters
src/post_process/m_global_parameters.fpp
• Added MUSCL reconstruction parameters:
recon_type
andmuscl_order
•
Updated parameter initialization with default values for
post-processing
• Extended global parameter declarations for
reconstruction type support
m_mpi_proxy.fpp
Add MPI broadcast for MUSCL in post-process
src/post_process/m_mpi_proxy.fpp
• Added MPI broadcast support for
muscl_order
parameter• Extended
parameter broadcasting for post-processing MUSCL support
m_start_up.fpp
Add MUSCL parameter reading in pre-process startup
src/pre_process/m_start_up.fpp
• Added MUSCL parameters to input file reading:
recon_type
andmuscl_order
• Extended parameter declarations for pre-processing MUSCL
support
m_start_up.f90
Add MUSCL parameter reading in post-process startup
src/post_process/m_start_up.f90
• Added MUSCL parameters to input file reading:
recon_type
andmuscl_order
• Extended parameter declarations for post-processing
MUSCL support
case.py
Add MUSCL parameters to case preprocessing
toolchain/mfc/case.py
• Adds MUSCL reconstruction parameters to simulation preprocessing
•
Introduces
recon_type
,muscl_order
,muscl_polyn
, andmuscl_lim
variables
• Fixes bug with WENO order allocation when using MUSCL
reconstruction
10 files
case.py
Add 3D shock-droplet example with MUSCL reconstruction
examples/3D_shockdroplet_muscl/case.py
• New 3D shock-droplet interaction example using MUSCL reconstruction
• Configures MUSCL order 2 with Van Albada limiter and interface
compression
• Sets up water droplet in air with shock wave interaction
physics
case.py
Add 1D Sod shock tube example with MUSCL reconstruction
examples/1D_sodshocktube_muscl/case.py
• New 1D Sod shock tube example using MUSCL reconstruction
•
Configures MUSCL order 2 with MC limiter and interface compression
•
Implements classic shock tube test case for MUSCL validation
case.py
New 2D shock-droplet example with MUSCL reconstruction
examples/2D_shockdroplet_muscl/case.py
• Creates a new 2D shock-droplet test case using MUSCL reconstruction
• Configures simulation parameters including domain, patches, and
fluid properties
• Sets MUSCL-specific parameters:
recon_type=2
,muscl_order=2
,muscl_lim=4
,int_comp=T
case.py
New 2D Riemann test example with MUSCL reconstruction
examples/2D_riemann_test_muscl/case.py
• Creates a new 2D Riemann test case using MUSCL reconstruction
•
Configures four patches with different initial conditions for Riemann
problem
• Sets MUSCL parameters:
recon_type=2
,muscl_order=2
,muscl_lim=1
,int_comp=T
case.py
New 3D Rayleigh-Taylor example with MUSCL reconstruction
examples/3D_rayleigh_taylor_muscl/case.py
• Creates a new 3D Rayleigh-Taylor instability test case using MUSCL
reconstruction
• Includes viscous effects and body forces for gravity
simulation
• Sets MUSCL parameters:
recon_type=2
,muscl_order=2
,muscl_lim=4
,int_comp=T
case.py
New 2D advection example with MUSCL reconstruction
examples/2D_advection_muscl/case.py
• Creates a new 2D advection test case using MUSCL reconstruction
•
Configures circular density patch for advection testing
• Sets MUSCL
parameters:
recon_type=2
,muscl_order=2
,muscl_lim=2
,int_comp=T
cases.py
Add MUSCL reconstruction test case generation
toolchain/mfc/test/cases.py
• Adds
alter_muscl()
function to generate MUSCL test variations•
Creates test cases for different MUSCL orders (1,2) and limiters (1-5)
• Integrates MUSCL testing into the test case generation pipeline
golden.txt
Golden reference data for MUSCL reconstruction tests
tests/86E9A6D4/golden.txt
• Provides golden reference data for MUSCL reconstruction validation
•
Contains numerical results for conservative and primitive variables
•
Includes time evolution data at different simulation steps
golden.txt
New MUSCL reconstruction test golden reference data
tests/F33CC4CA/golden.txt
• Added new golden test file containing numerical simulation output
data
• Contains density, momentum, energy, and pressure field data at
different time steps
• Includes both conservative and primitive
variable outputs for validation
golden-metadata.txt
Test metadata for MUSCL reconstruction validation
tests/86E9A6D4/golden-metadata.txt
• Added test metadata file with build configuration details
• Contains
CMake configuration for pre_process, simulation, and post_process
•
Includes CPU information and system specifications for test
environment
• Records test invocation with
muscl_order=1
parameter2 files
case_dicts.py
Add MUSCL parameter definitions to case dictionaries
toolchain/mfc/run/case_dicts.py
• Adds MUSCL-related parameter definitions to case dictionaries
•
Includes
recon_type
,muscl_order
,muscl_lim
,int_comp
,ic_eps
,ic_beta
• Updates case optimization list to include MUSCL parameters
case.py
Add default reconstruction type to test configuration
toolchain/mfc/test/case.py
• Adds default
recon_type=1
parameter to test case configuration•
Ensures backward compatibility with existing test cases
1 files
case.md
Documentation updates for MUSCL reconstruction parameters
docs/documentation/case.md
• Added
recon_type
parameter to specify reconstruction method (WENO vsMUSCL)
• Added MUSCL-specific parameters:
muscl_order
,muscl_lim
,int_comp
,ic_eps
,ic_beta
• Updated Riemann solver description to
include 4 options instead of 3
• Added detailed descriptions for MUSCL
slope limiters and interface compression