Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Source/NS_BC.H
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ static int tang_gradp_bc[] =
amrex::BCType::int_dir, amrex::BCType::foextrap, amrex::BCType::foextrap, amrex::BCType::reflect_even, amrex::BCType::foextrap, amrex::BCType::foextrap
};

// NOTE BDS advection scheme has different BC due to it's design choice that it not introduce new extrema
static int bds_temp_bc[] =
{
amrex::BCType::int_dir, amrex::BCType::ext_dir, amrex::BCType::foextrap, amrex::BCType::reflect_even, amrex::BCType::reflect_even, amrex::BCType::reflect_even
};
static int temp_bc[] =
{
amrex::BCType::int_dir, amrex::BCType::ext_dir, amrex::BCType::hoextrap, amrex::BCType::reflect_even, amrex::BCType::reflect_even, amrex::BCType::reflect_even
Expand All @@ -54,7 +59,9 @@ static int dsdt_bc[] =
amrex::BCType::int_dir, amrex::BCType::ext_dir, amrex::BCType::ext_dir, amrex::BCType::reflect_even, amrex::BCType::reflect_even, amrex::BCType::reflect_even
};

// NOTE ghost cells of Average_Type are only ever filled by FillPatch, so the physical
// BCs must extrapolate; int_dir would claim they are interior and leave them unfilled
static int average_bc[] =
{
amrex::BCType::int_dir, amrex::BCType::int_dir, amrex::BCType::int_dir, amrex::BCType::int_dir, amrex::BCType::int_dir, amrex::BCType::int_dir
amrex::BCType::int_dir, amrex::BCType::foextrap, amrex::BCType::foextrap, amrex::BCType::foextrap, amrex::BCType::foextrap, amrex::BCType::foextrap
};
15 changes: 11 additions & 4 deletions Source/NS_setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,21 @@ set_scalar_bc (BCRec& bc,
static
void
set_temp_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,temp_bc[lo_bc[i]]);
bc.setHi(i,temp_bc[hi_bc[i]]);
if (advection == "BDS"){
bc.setLo(i,bds_temp_bc[lo_bc[i]]);
bc.setHi(i,bds_temp_bc[hi_bc[i]]);
}
else {
bc.setLo(i,temp_bc[lo_bc[i]]);
bc.setHi(i,temp_bc[hi_bc[i]]);
}
}
}

Expand Down Expand Up @@ -285,7 +292,7 @@ NavierStokes::variableSetUp ()
//
if (do_temp)
{
set_temp_bc(bc,phys_bc);
set_temp_bc(bc,phys_bc,advection_scheme);
desc_lst.setComponent(State_Type,Temp,"temp",bc,state_bf);
}

Expand Down
Loading