Skip to content

Commit

Permalink
replaced user_1 with new direction_dependent BCType in amrex
Browse files Browse the repository at this point in the history
  • Loading branch information
mukul1992 committed Jun 6, 2024
1 parent d1667ae commit 676e7a0
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
8 changes: 4 additions & 4 deletions amr-wind/boundary_conditions/BCInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,9 @@ void BCVelocity::set_bcrec()

case BC::mass_inflow_outflow:
if (side == amrex::Orientation::low) {
set_bcrec_lo(dir, amrex::BCType::user_1);
set_bcrec_lo(dir, amrex::BCType::direction_dependent);
} else {
set_bcrec_hi(dir, amrex::BCType::user_1);
set_bcrec_hi(dir, amrex::BCType::direction_dependent);
}
break;

Expand Down Expand Up @@ -326,9 +326,9 @@ void BCScalar::set_bcrec()

case BC::mass_inflow_outflow:
if (side == amrex::Orientation::low) {
set_bcrec_lo(dir, amrex::BCType::user_1);
set_bcrec_lo(dir, amrex::BCType::direction_dependent);
} else {
set_bcrec_hi(dir, amrex::BCType::user_1);
set_bcrec_hi(dir, amrex::BCType::direction_dependent);
}
break;

Expand Down
16 changes: 8 additions & 8 deletions amr-wind/convection/incflo_godunov_ppm.H
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void Godunov_trans_xbc(
// Low X
if (i <= domlo) {
if (bclo == BCType::ext_dir ||
(bclo == BCType::user_1 && velp >= 0.0)) {
(bclo == BCType::direction_dependent && velp >= 0.0)) {
//Print() << "trans_xbc_domlo_extdir triggered at " << i << " " << j << " " << k << " " << n
// << " as uedge is " << velp << std::endl;
// IAMR does this but it breaks lo/hi symmetry
Expand All @@ -43,7 +43,7 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void Godunov_trans_xbc(
} else if (
bclo == BCType::foextrap || bclo == BCType::hoextrap ||
bclo == BCType::reflect_even ||
(bclo == BCType::user_1 && velp < 0.0)) {
(bclo == BCType::direction_dependent && velp < 0.0)) {
//Print() << "trans_xbc_domlo_foextrap triggered at " << i << " " << j << " " << k << " " << n
// << " as uedge is " << velp << std::endl;
lo = hi;
Expand All @@ -57,7 +57,7 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void Godunov_trans_xbc(
// High X
if (i > domhi) {
if (bchi == BCType::ext_dir ||
(bchi == BCType::user_1 && velm <= 0.0)) { // is this correct use of uedge here??
(bchi == BCType::direction_dependent && velm <= 0.0)) { // is this correct use of uedge here??
//Print() << "trans_xbc_domhi_extdir triggered at " << i << " " << j << " " << k << " " << n
// << " as uedge is " << velm << std::endl;
// IAMR does this but it breaks lo/hi symmetry
Expand All @@ -69,7 +69,7 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void Godunov_trans_xbc(
} else if (
bchi == BCType::foextrap || bchi == BCType::hoextrap ||
bchi == BCType::reflect_even ||
(bchi == BCType::user_1 && velm > 0.0)) {
(bchi == BCType::direction_dependent && velm > 0.0)) {
//Print() << "trans_xbc_domhi_foextrap triggered at " << i << " " << j << " " << k << " " << n
// << " as uedge is " << velm << std::endl;
hi = lo;
Expand Down Expand Up @@ -217,7 +217,7 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void Godunov_cc_xbc_lo(

if (i == domlo) {
if ((bclo == BCType::ext_dir && uedge(i, j, k) >= 0.) ||
(bclo == BCType::user_1 && uedge(i, j, k) >= 0.)) {
(bclo == BCType::direction_dependent && uedge(i, j, k) >= 0.)) {
//Print() << "cc_xbc_lo_extdir triggered at " << i << " " << j << " " << k << " " << n
// << " as uedge is " << uedge(i,j,k) << std::endl;
hi = s(domlo - 1, j, k, n);
Expand All @@ -226,7 +226,7 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void Godunov_cc_xbc_lo(
bclo == BCType::foextrap || bclo == BCType::hoextrap ||
bclo == BCType::reflect_even ||
(bclo == BCType::ext_dir && uedge(i, j, k) < 0) ||
(bclo == BCType::user_1 && uedge(i, j, k) < 0)) {
(bclo == BCType::direction_dependent && uedge(i, j, k) < 0)) {
//Print() << "cc_xbc_lo_foextrap triggered at " << i << " " << j << " " << k << " " << n
// << " as uedge is " << uedge(i,j,k) << std::endl;
lo = hi;
Expand Down Expand Up @@ -256,7 +256,7 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void Godunov_cc_xbc_hi(

if (i == domhi + 1) {
if ((bchi == BCType::ext_dir && uedge(i, j, k) <= 0.) ||
(bchi == BCType::user_1 && uedge(i, j, k) <= 0.)) {
(bchi == BCType::direction_dependent && uedge(i, j, k) <= 0.)) {
//Print() << "cc_xbc_hi_extdir triggered at " << i << " " << j << " " << k << " " << n
// << " as uedge is " << uedge(i,j,k) << std::endl;
lo = s(domhi + 1, j, k, n);
Expand All @@ -265,7 +265,7 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void Godunov_cc_xbc_hi(
bchi == BCType::foextrap || bchi == BCType::hoextrap ||
bchi == BCType::reflect_even ||
(bchi == BCType::ext_dir && uedge(i, j, k) > 0) ||
(bchi == BCType::user_1 && uedge(i, j, k) > 0)) {
(bchi == BCType::direction_dependent && uedge(i, j, k) > 0)) {
//Print() << "cc_xbc_hi_foextrap triggered at " << i << " " << j << " " << k << " " << n
// << " as uedge is " << uedge(i,j,k) << std::endl;
hi = lo;
Expand Down
12 changes: 6 additions & 6 deletions amr-wind/convection/incflo_godunov_weno.H
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void Godunov_weno_xbc(
using namespace amrex;

if (bclo == BCType::ext_dir || bclo == BCType::hoextrap
|| (bclo == BCType::user_1 && velm >= 0.0)) {
|| (bclo == BCType::direction_dependent && velm >= 0.0)) {
if (i == domlo) {
//Print() << "weno_xbc_domlo_extdir triggered at " << i << " " << j << " " << k << " " << n
// << " as velm is " << velm << std::endl;
Expand All @@ -92,7 +92,7 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void Godunov_weno_xbc(
}

if (bchi == BCType::ext_dir || bchi == BCType::hoextrap
|| (bchi == BCType::user_1 && velp <= 0.0)) {
|| (bchi == BCType::direction_dependent && velp <= 0.0)) {
if (i == domhi) {
//Print() << "weno_xbc_domhi_extdir triggered at " << i << " " << j << " " << k << " " << n
// << " as velp is " << velp << std::endl;
Expand Down Expand Up @@ -132,7 +132,7 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void Godunov_weno_ybc(
using namespace amrex;

if (bclo == BCType::ext_dir || bclo == BCType::hoextrap
|| (bclo == BCType::user_1 && velm >= 0.0)) {
|| (bclo == BCType::direction_dependent && velm >= 0.0)) {
if (j == domlo) {
sp = -0.2 * s(i, domlo - 1, k, n) + 0.75 * s(i, domlo, k, n) +
0.5 * s(i, domlo + 1, k, n) - 0.05 * s(i, domlo + 2, k, n);
Expand All @@ -149,7 +149,7 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void Godunov_weno_ybc(
}

if (bchi == BCType::ext_dir || bchi == BCType::hoextrap
|| (bchi == BCType::user_1 && velp <= 0.0)) {
|| (bchi == BCType::direction_dependent && velp <= 0.0)) {
if (j == domhi) {
sm = -0.2 * s(i, domhi + 1, k, n) + 0.75 * s(i, domhi, k, n) +
0.5 * s(i, domhi - 1, k, n) - 0.05 * s(i, domhi - 2, k, n);
Expand Down Expand Up @@ -186,7 +186,7 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void Godunov_weno_zbc(
using namespace amrex;

if (bclo == BCType::ext_dir || bclo == BCType::hoextrap
|| (bclo == BCType::user_1 && velm >= 0.0)) {
|| (bclo == BCType::direction_dependent && velm >= 0.0)) {
if (k == domlo) {
sp = -0.2 * s(i, j, domlo - 1, n) + 0.75 * s(i, j, domlo, n) +
0.5 * s(i, j, domlo + 1, n) - 0.05 * s(i, j, domlo + 2, n);
Expand All @@ -203,7 +203,7 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void Godunov_weno_zbc(
}

if (bchi == BCType::ext_dir || bchi == BCType::hoextrap
|| (bchi == BCType::user_1 && velp <= 0.0)) {
|| (bchi == BCType::direction_dependent && velp <= 0.0)) {
if (k == domhi) {
sm = -0.2 * s(i, j, domhi + 1, n) + 0.75 * s(i, j, domhi, n) +
0.5 * s(i, j, domhi - 1, n) - 0.05 * s(i, j, domhi - 2, n);
Expand Down
2 changes: 1 addition & 1 deletion amr-wind/core/FieldBCOps.H
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ struct DirichletOp
// Check if this boundary is a dirichlet or mixed type
const auto bctyp = (ori.isLow() ? bc.lo(idir) : bc.hi(idir));
if ((bctyp != amrex::BCType::ext_dir)
&& (bctyp != amrex::BCType::user_1)) {
&& (bctyp != amrex::BCType::direction_dependent)) {
continue;
}

Expand Down

0 comments on commit 676e7a0

Please sign in to comment.