MFC icon indicating copy to clipboard operation
MFC copied to clipboard

Add CFL Based Adaptive Time-Stepping

Open wilfonba opened this issue 1 year ago • 0 comments

Description

This PR adds constant CFL time-stepping for all physics. The new feature is compatible with the existing ability to restart cases with additional patches.

Fixes #298

Type of change

  • [x] New feature (non-breaking change which adds functionality)

Scope

  • [x] This PR comprises a set of related changes with a common goal

How Has This Been Tested?

  • [x] Test A: This test is a 1D sodshock tube ran with gfortran 14.1.0 on an Apple M2 processor. The figure shows the results of a constant CFL simulation overlayed over a constant dt simulation. asdf
  • [x] Test B: This test is a 2D Riemann problem ran with gfortran 14.1.0 on an Apple M2 procesor. The video shows the constant CFL result on the left and the constant dt simulation on the right. Some minor differences are expected. https://github.com/MFlowCode/MFC/assets/48168887/95bc7182-f013-49c5-8951-960ed68574ea
  • [x] Test C: This test shows a simulation that is restarted with a new patch. It was ran with gfortran 14.1.0 on an Apple M2 processor. https://github.com/MFlowCode/MFC/assets/48168887/fad28d4f-bec4-455e-a6a8-795db5724f36
  • [ ] Test D: This test is a 3D shock droplet ran with NVHPC 22.11 on Pace Phoenix with Nvidia V100 GPUs. The left panel shows the constant CFL result and the right panel shows the constant dt result. (Image to come)

Checklist

  • [x] I have added comments for the new code
  • [x] I added Doxygen docstrings to the new code
  • [x] I have made corresponding changes to the documentation (docs/)
  • [x] I have added regression tests to the test suite so that people can verify in the future that the feature is behaving as expected
  • [ ] I have added example cases in examples/ that demonstrate my new feature performing as expected. They run to completion and demonstrate "interesting physics"
  • [ ] I ran ./mfc.sh format before committing my code
  • [ ] New and existing tests pass locally with my changes, including with GPU capability enabled (both NVIDIA hardware with NVHPC compilers and AMD hardware with CRAY compilers) and disabled
  • [x] This PR does not introduce any repeated code (it follows the DRY principle)
  • [x] I cannot think of a way to condense this code and reduce any introduced additional line count

If 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:

  • [x] Checked that the code compiles using NVHPC compilers
  • [ ] Checked that the code compiles using CRAY compilers
  • [x] Ran the code on either V100, A100, or H100 GPUs and ensured the new feature performed as expected (the GPU results match the CPU results)
  • [ ] Ran the code on MI200+ GPUs and ensure the new features performed as expected (the GPU results match the CPU results)
  • [ ] Enclosed the new feature via nvtx ranges so that they can be identified in profiles
  • [ ] Ran a Nsight Systems profile using ./mfc.sh run XXXX --gpu -t simulation --nsys, and have attached the output file (.nsys-rep) and plain text results to this PR
  • [ ] Ran an Omniperf profile using ./mfc.sh run XXXX --gpu -t simulation --omniperf, and have attached the output file and plain text results to this PR.
  • [ ] Ran my code using various numbers of different GPUs (1, 2, and 8, for example) in parallel and made sure that the results scale similarly to what happens if you run without the new code/feature

wilfonba avatar Jul 09 '24 22:07 wilfonba