MFC icon indicating copy to clipboard operation
MFC copied to clipboard

Add Surface Tension

Open wilfonba opened this issue 1 year ago • 2 comments

Description

This PR adds the surface tension model of Schmidmayer et. al 2017 to MFC.

Fixes #276

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] This is the 2D equilibration of pressure inside a water droplet in air. It's discretized onto a 50x50 Grid with reflective boundary conditions at x[y]_beg and ghost cell extrapolation for x[y]_end. The case file is available in examples/2D_equilibration/. This simulation was run on M2 Apple Silicone.

https://github.com/MFlowCode/MFC/assets/48168887/12fed2fe-ae11-4b81-bc4f-51104150a1b7

  • [x] This is the 2D relaxation of a square to a circle in 2D. It's discretized onto a 129x128 grid with reflective boundary conditions at x[y]_beg and ghost cell extrapolation for x[y]_end. The case file is available in examples/2D_recoverCircle. This simulation was run on 2 V100 GPUs.

https://github.com/MFlowCode/MFC/assets/48168887/4ab34fa0-12ae-40f2-a507-b56517e15984

  • [x] This is the 3D equilibration of pressure inside a water droplet in air. It's discretized on a 100x100x100 grid with reflecting boundary conditions at x[y,z]_beg and ghost cell extrapolation at x[yz]_end. This simulation was ran using 4 V100 GPUs on Pace Phoenix.

https://github.com/MFlowCode/MFC/assets/48168887/e1b8280d-3630-49da-af75-7eeb893b678c

  • [ ] This is the 3D relaxation of a cube to a sphere. It's discretized on a 128x128x128 grid with reflecting boundary conditions at x[y,z]_beg and ghost cell extrapolation at x[yz]_end. This simulation was ran using 8 MI250 GPUs on OLCF Frontier.

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
  • [x] I have added example cases in examples/ that demonstrate my new feature performing as expected
  • [x] I ran ./mfc.sh format before committing my code
  • [x] New and existing tests pass locally with my changes, including with GPU capability enabled 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/)

To make sure the code is performing as expected on GPU devices, I have:

  • [x] Checked that the code compiles using NVHPC compilers
  • [x] 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)
  • [x] Ran the code on MI200+ GPUs and ensure the new feature performed as expected (the GPU results match the CPU results)
  • [x] Enclosed the new feature via nvtx ranges so that they can be identified in profiles
  • [x] 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 nsysRaw.txt
  • [ ] Ran an Omniperf profile using './mfc.sh run XXX --gpu -t simulation --omniperf', and have attached the output file and play text results to this PR.
  • [x] 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 image image

wilfonba avatar Apr 06 '24 18:04 wilfonba

@wilfonba check s_rectangle subroutine in m_patches.fpp, it only defines smooth_patch_id when ib is not true (lines 893-894), and you added a further check at line 928 where that variable is no longer defined, which is causing a bug in the 3D IBM case

anandrdbz avatar May 03 '24 21:05 anandrdbz

I forgot I'd added that stuff. Thanks for taking a look @anandrdbz!

wilfonba avatar May 03 '24 23:05 wilfonba

PRs are on hold until #419 is fixed

sbryngelson avatar May 16 '24 19:05 sbryngelson

add more example cases in examples/!

sbryngelson avatar May 16 '24 19:05 sbryngelson

PRs are on hold until #419 is fixed

I'm aware of this. I figured starting the review process wouldn't hurt anything so that I can fix any revisions while that issue is being resolved.

wilfonba avatar May 16 '24 19:05 wilfonba

per This PR comprises a set of related changes with a common goal please move the template updates to a separate PR

sbryngelson avatar May 16 '24 19:05 sbryngelson

@wilfonba sync w/ master

sbryngelson avatar May 23 '24 01:05 sbryngelson

should be able to debug these Test Suite / Github (macos, mpi, debug, false) (pull_request) from your own mac

sbryngelson avatar May 26 '24 15:05 sbryngelson

Note: ./mfc.sh count_diff is called from master so the Check Line Counts workflow is expected to fail despite the fixes I pushed to this PR.

henryleberre avatar May 29 '24 12:05 henryleberre

Let me fix the macOS no debug runners. Not sure why those would have failed, but I haven't ran the test suite with no debug recently

wilfonba avatar May 29 '24 15:05 wilfonba

Let me fix the macOS no debug runners. Not sure why those would have failed, but I haven't ran the test suite with no debug recently

Related to new issue #443

sbryngelson avatar May 29 '24 18:05 sbryngelson

Can merge this PR without that runner working

sbryngelson avatar May 29 '24 18:05 sbryngelson