diff --git a/Source/NS_BC.H b/Source/NS_BC.H index cfd01946..b3681e42 100644 --- a/Source/NS_BC.H +++ b/Source/NS_BC.H @@ -14,6 +14,11 @@ static int tang_vel_bc[] = amrex::BCType::int_dir, amrex::BCType::ext_dir, amrex::BCType::foextrap, amrex::BCType::reflect_even, amrex::BCType::hoextrap, amrex::BCType::ext_dir }; +// NOTE BDS advection scheme has different BC due to it's design choice that it not introduce new extrema +static int bds_scalar_bc[] = +{ + amrex::BCType::int_dir, amrex::BCType::ext_dir, amrex::BCType::foextrap, amrex::BCType::reflect_even, amrex::BCType::foextrap, amrex::BCType::foextrap +}; static int scalar_bc[] = { amrex::BCType::int_dir, amrex::BCType::ext_dir, amrex::BCType::foextrap, amrex::BCType::reflect_even, amrex::BCType::hoextrap, amrex::BCType::foextrap diff --git a/Source/NS_setup.cpp b/Source/NS_setup.cpp index f98bcf74..a6c73b71 100644 --- a/Source/NS_setup.cpp +++ b/Source/NS_setup.cpp @@ -70,14 +70,21 @@ set_z_vel_bc (BCRec& bc, static void set_scalar_bc (BCRec& bc, - const BCRec& phys_bc) + const BCRec& phys_bc, + const std::string& advection) { const int* lo_bc = phys_bc.lo(); const int* hi_bc = phys_bc.hi(); for (int i = 0; i < AMREX_SPACEDIM; i++) { - bc.setLo(i,scalar_bc[lo_bc[i]]); - bc.setHi(i,scalar_bc[hi_bc[i]]); + if (advection == "BDS"){ + bc.setLo(i,bds_scalar_bc[lo_bc[i]]); + bc.setHi(i,bds_scalar_bc[hi_bc[i]]); + } + else { + bc.setLo(i,scalar_bc[lo_bc[i]]); + bc.setHi(i,scalar_bc[hi_bc[i]]); + } } } @@ -262,15 +269,15 @@ NavierStokes::variableSetUp () // // ************** DEFINE SCALAR VARIABLES ******************** // - set_scalar_bc(bc,phys_bc); + set_scalar_bc(bc,phys_bc,advection_scheme); desc_lst.setComponent(State_Type,Density,"density",bc,state_bf); - set_scalar_bc(bc,phys_bc); + set_scalar_bc(bc,phys_bc,advection_scheme); desc_lst.setComponent(State_Type,Tracer,"tracer",bc,state_bf); if (do_trac2) { - set_scalar_bc(bc,phys_bc); + set_scalar_bc(bc,phys_bc,advection_scheme); desc_lst.setComponent(State_Type,Tracer2,"tracer2",bc,state_bf); } //