-
Notifications
You must be signed in to change notification settings - Fork 78
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
DRAFT PR: inflow-outflow boundary condition #1066
base: main
Are you sure you want to change the base?
Conversation
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.
Made a first quick pass.
const int nlevels = m_field.repo().num_active_levels(); | ||
const bool ib = (idim == 0), jb = (idim == 1), kb = (idim == 2); | ||
|
||
amrex::Print() << "***** Applying MIO custom Neumann fills at orientation: " << idx << std::endl; |
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.
remove debug statement
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.
yes, I am keeping them until all the bugs are ironed out an will clean things up when it's ready to merge
const auto islow = m_ori.isLow(); | ||
const auto ishigh = m_ori.isHigh(); | ||
const int nlevels = m_field.repo().num_active_levels(); | ||
const bool ib = (idim == 0), jb = (idim == 1), kb = (idim == 2); |
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.
these bools are implicetly cast to ints later. I would prefer something like const amrex::IntVect ivp = {blah}
and then you can just iv + ivp
in the parallelfor loops
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.
will do
if (bclo == BCType::ext_dir) { | ||
if (bclo == BCType::ext_dir || | ||
(bclo == BCType::user_1 && velp >= 0.0)) { | ||
//Print() << "trans_xbc_domlo_extdir triggered at " << i << " " << j << " " << k << " " << n |
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.
when we get close to merging, let's remove all these print statements.
@@ -79,6 +79,7 @@ macro(init_amrex_hydro) | |||
else() | |||
set(CMAKE_PREFIX_PATH ${AMReX-Hydro_DIR} ${CMAKE_PREFIX_PATH}) | |||
find_package(AMReX-Hydro CONFIG REQUIRED) | |||
add_subdirectory(${AMReX-Hydro_DIR} build) |
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.
Is this needed? Feels strange
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.
I needed it to compile with an external AMReX-Hydro, but it may just be my inexperience with CMake. I will look into it..
{ | ||
struct DeviceOp | ||
{ | ||
// clang-format off |
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.
remove this block
amr-wind/physics/udfs/TwoLayer.cpp
Outdated
|
||
namespace amr_wind::udf { | ||
|
||
TwoLayer::TwoLayer(const Field& /*fld*/) |
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.
clean up this cpp and H files from comments and clang format off stuff
@@ -6,6 +6,9 @@ | |||
#include "amr-wind/core/field_ops.H" | |||
#include "amr-wind/wind_energy/ABL.H" | |||
|
|||
// for debugging |
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.
remove these later
@@ -0,0 +1,71 @@ | |||
# This is a 2D poiseuille flow when run to steady state |
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.
move these into test/test_files
and then add to test/CMakeLists.txt
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.
yes, makes sense
Most of my comments right now are just noting the obvious things to clean up before actually merging. Thank you for taking this task on!! |
Speaking of merging, it looks like there are some complicated merge conflicts between this branch and main. It may be helpful to rebase your branch to upstream/main to remove some of those conflicts and get the unrelated parts of this branch up-to-date. Removing the merge conflicts will also allow the CI tests to run. |
PS. I have been able to rebase this code with the latest changes in the |
…ls in the same boundary
Summary
Enabling the
mass_inflow_outflow
(MIO) BC which allows for both inflow and outflow cells in a boundary.Pull request type
Please check the type of change introduced:
Checklist
The following is included:
This PR was tested by running:
Additional background
This functionality would be required for coupling with ERF and was started after discussions with @gdeskos and @mchurchf, along with @asalmgren, as it was a desired functionality within AMR-Wind too. Additionally, @hgopalan has expressed interest, and @marchdf has helped along the way.
Description
The changes required can be organized into six categories:
MassInflowOutflowBC.cpp
ext_dir
andfoextrap
behavior respectively.enforceSolvability
routine in AMReX-Hydro before the mac-projection, which adjusts the outflux to match with influx (will link to the corresponding PR in Hydro).input_inout
.