-
Notifications
You must be signed in to change notification settings - Fork 75
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
Add STL geom_type for EB in Source/InitEB.cpp #771
Conversation
=> this is edited in Source/InitEB.cpp (line 355). Additionally, we exclude stl geom_type from the amrex::EB2:: addFineLevels(max_level - eb_max_level) condition: => This is not updated or implemented well in AMReX-EB code (yet). => See Source/InitEB.cpp (line 370) Please find "EY" comments for these update.
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.
Couple minor things on the implementation. I'll have some suggestions on the example case later.
I ran the example case with the cylinder-x-dir.STL file, which is aligned in the x-direction. I manually scaled the cylinder in the input file (eb-c9-cyhliner.inp) by adding "eb2.stl_scale = 50" line. The original cylinder has a radius of 0.5. |
I think we should update the regtest to use the STL version instead of the version with the cylinder geom_type. We have plenty of other tests that use the cylinder geometry and this would serve as both a test and a demo of the STL capability. @ejyoo921 to do this, just modify |
A quick check (that maybe you already did) is if those 2 cases give the same answer. |
The running study case for density and its error? |
…to give a larger one - It seems like using the eb2.stl_scale parameter is somehow not okay. We may investigate further about this. For now, use the new file 'cylinder-x-r50.stl' for the C9 test. We also modified the eb-c9.inp to show how to use stl file for eb2. Former way of eb2.geom_type = cylinder is commented at the end
Exec/RegTests/EB-C9/cylinder.stl
Outdated
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.
This file can be deleted
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.
This file can also be deleted
Yeah if you can re-run the case study with your latest changes that should be sufficient. It would also be interesting to run amrex fcompare to compare both the initial and final plot files to those for the old cylinder. I'd imagine there will be small diffs in the vfrac field that lead to small diffs in other fields over time. |
yup I am running it now. I see that AMReX could not load the new stl file I just pushed 🤦🏻♀️ |
Density, entropy, and density error plots |
Where can I see the test file or script? |
I was checking the Tests/CMakeLists.txt file, and my guess is that it copies the input file - {TEST_NAME}.inp - to the test working directory but does not bring the stl file. I had the same issue when I was testing on my machine. Copy files to test working directory
|
ah yes it needs to bring over the stl file as well. You can edit this line: |
@@ -365,8 +366,12 @@ initialize_EB2( | |||
|
|||
// Add finer level, might be inconsistent with the coarser level created | |||
// above. | |||
if (geom_type != "chkfile") { | |||
// EY: This condition is not acceptable in AMReX with stl format |
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.
Instead of a silent comment, maybe we could replace this with an actual Abort? That way we know it breaks loudly and we can always go back and check if amrex accepts it later? Or maybe they never will? Or maybe I have no idea what I am talking about.
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 invalid condition gets caught by the AMREX_ALWAYS_ASSERT below. The addFineLevels function isn't supported for chkfile and stl, but it's ok to just skip if no levels are being added. So we catch the error for either of these options only when max_level != eb_max_level
2) Changed the cylinder-r50.stl location in the eb-c9.inp file by adjusting the center 3) Edited the setup_test in the Tests/CMakeLists.txt: => Added *.stl to copy for tests (line 53)
The latest (Hopefully the last one) results with corrected cylinder location. |
…#4123) ## Summary The `addFineLevels` function is not supported for EB2 for chk_file and stl geometries. However, it may be called in some for some trivial cases where it is adding 0 levels, in which case it is a no-op. There is no reason to abort in those cases. ## Additional background For PeleC, a work-around was put in to not call the function in the trivial cases (AMReX-Combustion/PeleC#771). I was thinking about adding the same work around to address the same thing in PeleLMeX (AMReX-Combustion/PeleLMeX#407), but maybe it would be better to simply allow the function to be called in trivial cases. If there's a reason not to do this, I'll just put the workaround in for PeleLMeX.
The current version of PeleC does not recognize "stl" as an eb.geom_type.
=> This is edited in Source/InitEB.cpp (line 355).
Additionally, we exclude stl geom_type from the amrex::EB2:: addFineLevels(max_level - eb_max_level) condition: => This is not updated or implemented well in AMReX-EB code (yet). => See Source/InitEB.cpp (line 370)
Please find "EY" comments for these updates.
As a test case, I used Exec/RegTests/EB-C9:
An example stl file => cylinder.stl
and an input file to use this stl => eb-c90-cylinder.inp
are included. Please see the last few lines in the input file for the EB-STL parameters.
Please contact me, Eunji, if you have any questions.