Skip to content
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

Change slipwall scalar BC for BDS to respect the design choice that #166

Merged
merged 3 commits into from
Aug 5, 2024
Merged
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
5 changes: 5 additions & 0 deletions Source/NS_BC.H
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 13 additions & 6 deletions Source/NS_setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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]]);
}
}
}

Expand Down Expand Up @@ -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);
}
//
Expand Down