Skip to content

Commit

Permalink
added more BC options and add option to specify it by varialbe, like …
Browse files Browse the repository at this point in the history
…in ROMS
  • Loading branch information
hklion committed Aug 26, 2024
1 parent 31e526a commit 8005fb3
Show file tree
Hide file tree
Showing 4 changed files with 365 additions and 163 deletions.
12 changes: 6 additions & 6 deletions Source/BoundaryConditions/REMORA_FillPatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ REMORA::FillBdyCCVels (int lev, MultiFab& mf_cc_vel)
if (!Geom(lev).isPeriodic(0)) {
// Low-x side
if (bx.smallEnd(0) <= domain.smallEnd(0)) {
Real mult = (phys_bc_type[0] == REMORA_BC::no_slip_wall) ? -1. : 1.;
Real mult = (phys_bc_type[BCVars::xvel_bc][0] == REMORA_BC::no_slip_wall) ? -1. : 1.;
ParallelFor(makeSlab(bx,0,0), [=] AMREX_GPU_DEVICE(int , int j, int k) noexcept
{
vel_arr(-1,j,k,1) = mult*vel_arr(0,j,k,1); // v
Expand All @@ -435,7 +435,7 @@ REMORA::FillBdyCCVels (int lev, MultiFab& mf_cc_vel)

// High-x side
if (bx.bigEnd(0) >= domain.bigEnd(0)) {
Real mult = (phys_bc_type[3] == REMORA_BC::no_slip_wall) ? -1. : 1.;
Real mult = (phys_bc_type[BCVars::xvel_bc][3] == REMORA_BC::no_slip_wall) ? -1. : 1.;
ParallelFor(makeSlab(bx,0,0), [=] AMREX_GPU_DEVICE(int , int j, int k) noexcept
{
vel_arr(ihi+1,j,k,1) = mult*vel_arr(ihi,j,k,1); // v
Expand All @@ -447,7 +447,7 @@ REMORA::FillBdyCCVels (int lev, MultiFab& mf_cc_vel)
if (!Geom(lev).isPeriodic(1)) {
// Low-y side
if (bx.smallEnd(1) <= domain.smallEnd(1)) {
Real mult = (phys_bc_type[1] == REMORA_BC::no_slip_wall) ? -1. : 1.;
Real mult = (phys_bc_type[BCVars::yvel_bc][1] == REMORA_BC::no_slip_wall) ? -1. : 1.;
ParallelFor(makeSlab(bx,1,0), [=] AMREX_GPU_DEVICE(int i, int , int k) noexcept
{
vel_arr(i,-1,k,0) = mult*vel_arr(i,0,k,0); // u
Expand All @@ -457,7 +457,7 @@ REMORA::FillBdyCCVels (int lev, MultiFab& mf_cc_vel)

// High-y side
if (bx.bigEnd(1) >= domain.bigEnd(1)) {
Real mult = (phys_bc_type[4] == REMORA_BC::no_slip_wall) ? -1. : 1.;
Real mult = (phys_bc_type[BCVars::yvel_bc][4] == REMORA_BC::no_slip_wall) ? -1. : 1.;
ParallelFor(makeSlab(bx,1,0), [=] AMREX_GPU_DEVICE(int i, int , int k) noexcept
{
vel_arr(i,jhi+1,k,0) = mult*vel_arr(i,jhi,k,0); // u
Expand All @@ -469,7 +469,7 @@ REMORA::FillBdyCCVels (int lev, MultiFab& mf_cc_vel)
if (!Geom(lev).isPeriodic(2)) {
// Low-z side
if (bx.smallEnd(2) <= domain.smallEnd(2)) {
Real mult = (phys_bc_type[2] == REMORA_BC::no_slip_wall) ? -1. : 1.;
Real mult = (phys_bc_type[BCVars::zvel_bc][2] == REMORA_BC::no_slip_wall) ? -1. : 1.;
ParallelFor(makeSlab(bx,2,0), [=] AMREX_GPU_DEVICE(int i, int j, int) noexcept
{
vel_arr(i,j,-1,0) = mult*vel_arr(i,j,0,0); // u
Expand All @@ -479,7 +479,7 @@ REMORA::FillBdyCCVels (int lev, MultiFab& mf_cc_vel)

// High-z side
if (bx.bigEnd(2) >= domain.bigEnd(2)) {
Real mult = (phys_bc_type[5] == REMORA_BC::no_slip_wall) ? -1. : 1.;
Real mult = (phys_bc_type[BCVars::zvel_bc][5] == REMORA_BC::no_slip_wall) ? -1. : 1.;
ParallelFor(makeSlab(bx,2,0), [=] AMREX_GPU_DEVICE(int i, int j, int) noexcept
{
vel_arr(i,j,khi+1,0) = mult*vel_arr(i,j,khi,0); // u
Expand Down
13 changes: 11 additions & 2 deletions Source/IndexDefines.H
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ namespace BCVars {
xvel_bc = NCONS,
yvel_bc,
zvel_bc,
ubar_bc,
vbar_bc,
zeta_bc,
tke_bc,
foextrap_bc,
NumTypes
};
Expand All @@ -44,7 +48,8 @@ namespace BdyVars {
}

enum struct REMORA_BC {
symmetry, inflow, outflow, no_slip_wall, slip_wall, periodic, undefined
symmetry, inflow, outflow, no_slip_wall, slip_wall, periodic,
clamped, chapman, flather, orlanski_rad, undefined
};

// NOTE: the first of these must match up with the BCType enum
Expand All @@ -56,7 +61,11 @@ enum mathematicalBndryTypes : int { bogus = -666,
int_dir = 0,
reflect_even = 1,
foextrap = 2,
ext_dir = 3
ext_dir = 3,
clamped = 4,
chapman = 5,
flather = 6,
orlanski_rad = 7
};
}
#endif
Loading

0 comments on commit 8005fb3

Please sign in to comment.