-
Notifications
You must be signed in to change notification settings - Fork 73
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
GRCBC #698
GRCBC #698
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #698 +/- ##
==========================================
+ Coverage 42.96% 42.98% +0.01%
==========================================
Files 61 61
Lines 16339 16384 +45
Branches 1881 1889 +8
==========================================
+ Hits 7020 7042 +22
- Misses 8278 8293 +15
- Partials 1041 1049 +8 ☔ View full report in Codecov by Sentry. |
Please fix merge conflicts |
@sbryngelson the checks passed after conflict resolution, so should be ready for merge |
thanks @anandrdbz I will review this soon! |
docs/documentation/case.md
Outdated
| `bc_[x,y,z]%alpha_rho_in` | Real Array | Inflow density | | ||
| `bc_[x,y,z]%alpha_in` | Real Array | Inflow void fraction | | ||
|
||
*: This boundary condition can be used for subsonic inflow (`bc_[x,y,z]%[beg,end]` = -7) and subsonic outflow (`bc_[x,y,z]%[beg,end]` = -8) characteristic boundary conditions. These are based on [Pirozzoli (2013)](references.md#Pirozzoli13). This enables to provide inflow and outflow conditions outside the computational domain. The parameters associated with this feature are listed in table [Generalized Characteristic Boundary conditions](#generalized-characteristic-boundary-conditions). |
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.
where does the * go?
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.
it doesn't seem to be attached to any variables
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.
The parameters associated with this feature are listed in table Generalized Characteristic Boundary conditions.
This seems to be obvious given that the text is right below the table, no?
src/simulation/m_cbc.fpp
Outdated
@@ -102,6 +102,18 @@ module m_cbc | |||
integer :: cbc_dir, cbc_loc | |||
!$acc declare create(dj, bcxb, bcxe, bcyb, bcye, bczb, bcze, cbc_dir, cbc_loc) | |||
|
|||
real(kind(0d0)) :: ux_in, ux_out, vx_in, vx_out, wx_in, wx_out, presx_in, presx_out, Delx_in, Delx_out |
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.
you need docstrings/doxygen and comments. also this is a very messy way to implement this. you have [u/v/w][x/y/z]_[in/out] for a total of 18 variables. these could easily be stored in a single 3,3,2 array.
src/simulation/m_cbc.fpp
Outdated
!$acc declare create(uy_in, uy_out, vy_in, vy_out, wy_in, wy_out, presy_in, presy_out, Dely_in, Dely_out) | ||
!$acc declare create(uz_in, uz_out, vz_in, vz_out, wz_in, wz_out, presz_in, presz_out, Delz_in, Delz_out) | ||
|
||
real(kind(0d0)), allocatable, dimension(:) :: alpha_rhox_in, alphax_in |
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.
same comment as above
src/simulation/m_cbc.fpp
Outdated
|
||
#:for CBC_DIR, XYZ in [(1, 'x'), (2, 'y'), (3, 'z')] | ||
if (${CBC_DIR}$ == 1) then | ||
u${XYZ}$_in = bc_${XYZ}$%u_in |
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.
why use u/v/w when you can use u(1,2,3)?
@@ -1465,6 +1465,9 @@ contains | |||
!$acc update device(bc_y%vb1, bc_y%vb2, bc_y%vb3, bc_y%ve1, bc_y%ve2, bc_y%ve3) | |||
!$acc update device(bc_z%vb1, bc_z%vb2, bc_z%vb3, bc_z%ve1, bc_z%ve2, bc_z%ve3) | |||
|
|||
!$acc update device(bc_x%grcbc_in, bc_x%grcbc_out, bc_x%grcbc_vel_out) |
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.
9 variables when you could just have one?
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.
lots of messy verbose code that can be easily cleaned up. also only three new tests? should have more.
@sbryngelson I've made most of the suggested changes, the only repetition is in the bc variables, but this is how it's done for all other cases (separate variables for bc_x, bc_y and bc_z). However in the CBC module this is transformed into an array of size (3) as suggested. Most of the verbosity in the code should've been removed now. And I've added 3 more test cases; these should cover every possible line I've added in CBC, so further tests are unnecessary. I've added a few more comments in the CBC file as well |
Thanks I will review again shortly! |
@sbryngelson For some reason the job on Phoenix has been in queue for 2 days, every other test has passed and I've checked the test suite on phoenix on an interactive node |
@anandrdbz Yes those nodes are backed up big time for some reason. I'll merge it once it passes you don't have to do anything. |
Co-authored-by: Anand <anand@lawn-128-61-28-98.lawn.gatech.edu> Co-authored-by: Anand <anand@lawn-128-61-77-225.lawn.gatech.edu> Co-authored-by: Anand <anand@ipsec-10-2-68-64.vpn.gatech.edu> Co-authored-by: Anand Radhakrishnan <aradhakr34@login05.frontier.olcf.ornl.gov> Co-authored-by: Anand <anand@Anands-MacBook-Pro.local>
Description
Generalized CBC implementation given by Pirozolli and Colonius (2013). Provides the option to supplement non-reflecting subsonic inflow and subsonic outflow boundary conditions (bc = -7 and -8) with additional terms. Their effect can be turned on by setting bc%grcbc_in and bc%grcbc_out to be true (false by default). Additional option to turn on bc%grcbc_vel_out that includes outflow velocity specification.
If turned on, inflow boundary conditions require inflow velocities, pressure ,density and volume fraction specifications outside the domain. For outflow conditions, pressure and normal velocity specifications needed, although the normal velocity can be turned off using bc%grcbc_vel_out.
Refer to case file 2D_ibm_steady_shock for an example with GRCBC inflow conditions for a shock with a given velocity.
2 additional cases added to the examples directory.
2D_zero_circ_vortex advects a zero circulation isentropic vortex in the middle of the domain from left to right with Subsonic Inflow and subsonic outflow boundary conditions.
2D_acoustic_pulse has a radially outward pressure pulse with subsonic outflow boundary conditions on all 4 sides.
Fixes #(issue) [optional]
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?
Please describe the tests that you ran to verify your changes.
Provide instructions so we can reproduce.
Please also list any relevant details for your test configuration
Test Configuration:
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 --omniperf
, and have attached the output file and plain text results to this PR.